Index: Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/PresentationObjects/PipingInputContextTest.cs =================================================================== diff -u -r614c1aa4bf54ed2852d93a58ba8d49b549d5f46c -rd515de49557312e4af41b1c051c900d39d1f9e2f --- Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/PresentationObjects/PipingInputContextTest.cs (.../PipingInputContextTest.cs) (revision 614c1aa4bf54ed2852d93a58ba8d49b549d5f46c) +++ Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/PresentationObjects/PipingInputContextTest.cs (.../PipingInputContextTest.cs) (revision d515de49557312e4af41b1c051c900d39d1f9e2f) @@ -20,15 +20,12 @@ // All rights reserved. using System; -using System.Collections.Generic; using System.Linq; using Core.Common.Base; -using Core.Common.Base.Geometry; using Core.Common.TestUtil; using NUnit.Framework; using Rhino.Mocks; using Ringtoets.Common.Data.AssessmentSection; -using Ringtoets.Common.Data.FailureMechanism; using Ringtoets.Piping.Data; using Ringtoets.Piping.Data.TestUtil; using Ringtoets.Piping.Forms.PresentationObjects; @@ -93,218 +90,6 @@ } [Test] - public void SetStochasticSoilModelAndStochasticSoilProfileForSurfaceLine_NewStochasticSoilModelWithOneStochasticSoilProfile_SetsStochasticSoilProfile() - { - // Setup - var mocks = new MockRepository(); - var assessmentSection = mocks.StrictMock(); - mocks.ReplayAll(); - - var surfaceLine = new RingtoetsPipingSurfaceLine - { - Name = "Surface line 1", - ReferenceLineIntersectionWorldPoint = new Point2D(0.0, 0.0) - }; - surfaceLine.SetGeometry(new[] - { - new Point3D(0.0, 5.0, 0.0), - new Point3D(0.0, 0.0, 1.0), - new Point3D(0.0, -5.0, 0.0) - }); - - var stochasticSoilProfile = new StochasticSoilProfile(0.3, SoilProfileType.SoilProfile1D, 1) - { - SoilProfile = new PipingSoilProfile("Profile 1", -10.0, new[] - { - new PipingSoilLayer(-5.0), - new PipingSoilLayer(-2.0), - new PipingSoilLayer(1.0) - }, SoilProfileType.SoilProfile1D, 1) - }; - - var stochasticSoilModel = new StochasticSoilModel(1, "Model A", "Model B") - { - Geometry = - { - new Point2D(0.0, 0.0), new Point2D(5.0, 0.0) - }, - StochasticSoilProfiles = - { - stochasticSoilProfile - } - }; - - var pipingInput = new PipingInput(new GeneralPipingInput()); - - pipingInput.SurfaceLine = surfaceLine; - - PipingInputContext pipingInputContext = new PipingInputContext(pipingInput, new[] - { - surfaceLine - }, new[] - { - stochasticSoilModel - }, assessmentSection); - - // Call - pipingInputContext.SetStochasticSoilModelAndStochasticSoilProfileForSurfaceLine(); - - // Assert - Assert.AreEqual(stochasticSoilModel, pipingInputContext.WrappedData.StochasticSoilModel); - Assert.AreEqual(stochasticSoilProfile, pipingInputContext.WrappedData.StochasticSoilProfile); - - mocks.VerifyAll(); - } - - [Test] - public void SetStochasticSoilModelAndStochasticSoilProfileForSurfaceLine_NewStochasticSoilModelWithMultipleStochasticSoilProfiles_SetsStochasticSoilProfileToNull() - { - // Setup - var mocks = new MockRepository(); - var assessmentSection = mocks.StrictMock(); - mocks.ReplayAll(); - - var surfaceLine = new RingtoetsPipingSurfaceLine - { - Name = "Surface line 1", - ReferenceLineIntersectionWorldPoint = new Point2D(0.0, 0.0) - }; - surfaceLine.SetGeometry(new[] - { - new Point3D(0.0, 5.0, 0.0), - new Point3D(0.0, 0.0, 1.0), - new Point3D(0.0, -5.0, 0.0) - }); - - var stochasticSoilModel = new StochasticSoilModel(1, "Model A", "Model B") - { - Geometry = - { - new Point2D(0.0, 0.0), new Point2D(5.0, 0.0) - }, - StochasticSoilProfiles = - { - new StochasticSoilProfile(0.3, SoilProfileType.SoilProfile1D, 1) - { - SoilProfile = new PipingSoilProfile("Profile 1", -10.0, new[] - { - new PipingSoilLayer(-5.0), - new PipingSoilLayer(-2.0), - new PipingSoilLayer(1.0) - }, SoilProfileType.SoilProfile1D, 1) - }, - new StochasticSoilProfile(0.3, SoilProfileType.SoilProfile1D, 1) - { - SoilProfile = new PipingSoilProfile("Profile 2", -10.0, new[] - { - new PipingSoilLayer(-5.0), - new PipingSoilLayer(-2.0), - new PipingSoilLayer(1.0) - }, SoilProfileType.SoilProfile1D, 2) - } - } - }; - - var pipingInput = new PipingInput(new GeneralPipingInput()); - pipingInput.SurfaceLine = surfaceLine; - - PipingInputContext pipingInputContext = new PipingInputContext(pipingInput, new[] - { - surfaceLine - }, new[] - { - stochasticSoilModel - }, assessmentSection); - - // Call - pipingInputContext.SetStochasticSoilModelAndStochasticSoilProfileForSurfaceLine(); - - // Assert - Assert.AreEqual(stochasticSoilModel, pipingInputContext.WrappedData.StochasticSoilModel); - Assert.IsNull(pipingInputContext.WrappedData.StochasticSoilProfile); - - mocks.VerifyAll(); - } - - [Test] - public void SetStochasticSoilModelAndStochasticSoilProfileForSurfaceLine_MatchingStochasticSoilProfileAlreadySet_DoesNotSetsStochasticSoilProfileToNull() - { - // Setup - var mocks = new MockRepository(); - var assessmentSection = mocks.StrictMock(); - mocks.ReplayAll(); - - var surfaceLine = new RingtoetsPipingSurfaceLine - { - Name = "Surface line 1", - ReferenceLineIntersectionWorldPoint = new Point2D(0.0, 0.0) - }; - surfaceLine.SetGeometry(new[] - { - new Point3D(0.0, 5.0, 0.0), - new Point3D(0.0, 0.0, 1.0), - new Point3D(0.0, -5.0, 0.0) - }); - - - - var stochasticSoilProfile = new StochasticSoilProfile(0.3, SoilProfileType.SoilProfile1D, 1) - { - SoilProfile = new PipingSoilProfile("Profile 1", -10.0, new[] - { - new PipingSoilLayer(-5.0), - new PipingSoilLayer(-2.0), - new PipingSoilLayer(1.0) - }, SoilProfileType.SoilProfile1D, 1) - }; - - var stochasticSoilModel = new StochasticSoilModel(1, "Model A", "Model B") - { - Geometry = - { - new Point2D(0.0, 0.0), new Point2D(5.0, 0.0) - }, - StochasticSoilProfiles = - { - stochasticSoilProfile, - new StochasticSoilProfile(0.3, SoilProfileType.SoilProfile1D, 1) - { - SoilProfile = new PipingSoilProfile("Profile 2", -10.0, new[] - { - new PipingSoilLayer(-5.0), - new PipingSoilLayer(-2.0), - new PipingSoilLayer(1.0) - }, SoilProfileType.SoilProfile1D, 2) - } - } - }; - - var pipingInput = new PipingInput(new GeneralPipingInput()); - pipingInput.SurfaceLine = surfaceLine; - - PipingInputContext pipingInputContext = new PipingInputContext(pipingInput, new[] - { - surfaceLine - }, new[] - { - stochasticSoilModel - }, assessmentSection); - - // Precondition - pipingInputContext.WrappedData.StochasticSoilModel = stochasticSoilModel; - pipingInputContext.WrappedData.StochasticSoilProfile = stochasticSoilProfile; - - // Call - pipingInputContext.SetStochasticSoilModelAndStochasticSoilProfileForSurfaceLine(); - - // Assert - Assert.AreEqual(stochasticSoilModel, pipingInputContext.WrappedData.StochasticSoilModel); - Assert.AreEqual(stochasticSoilProfile, pipingInputContext.WrappedData.StochasticSoilProfile); - - mocks.VerifyAll(); - } - - [Test] public void Attach_Observer_ObserverAttachedToPipingInput() { // Setup