Index: Riskeer/ClosingStructures/test/Riskeer.ClosingStructures.Forms.Test/Views/ClosingStructuresFailureMechanismViewTest.cs =================================================================== diff -u -ree22b428f3d9e6c3e31f8e804b2d8bae5cd0adc4 -r2d1b590dd680ce0450549d8b293f86bc8849c1a2 --- Riskeer/ClosingStructures/test/Riskeer.ClosingStructures.Forms.Test/Views/ClosingStructuresFailureMechanismViewTest.cs (.../ClosingStructuresFailureMechanismViewTest.cs) (revision ee22b428f3d9e6c3e31f8e804b2d8bae5cd0adc4) +++ Riskeer/ClosingStructures/test/Riskeer.ClosingStructures.Forms.Test/Views/ClosingStructuresFailureMechanismViewTest.cs (.../ClosingStructuresFailureMechanismViewTest.cs) (revision 2d1b590dd680ce0450549d8b293f86bc8849c1a2) @@ -26,17 +26,12 @@ using System.Windows.Forms; using Core.Common.Base; using Core.Common.Base.Geometry; -using Core.Common.TestUtil; using Core.Components.Gis.Data; using Core.Components.Gis.Features; using Core.Components.Gis.Forms; using Core.Components.Gis.Geometries; using NUnit.Framework; using Rhino.Mocks; -using Riskeer.AssemblyTool.Data; -using Riskeer.AssemblyTool.KernelWrapper.Calculators; -using Riskeer.AssemblyTool.KernelWrapper.TestUtil.Calculators; -using Riskeer.AssemblyTool.KernelWrapper.TestUtil.Calculators.Assembly; using Riskeer.ClosingStructures.Data; using Riskeer.ClosingStructures.Data.TestUtil; using Riskeer.ClosingStructures.Forms.Views; @@ -150,8 +145,6 @@ public void Constructor_WithAllData_DataUpdatedToCollectionOfFilledMapData() { // Setup - var random = new Random(39); - var calculationA = new StructuresCalculationScenario { InputParameters = @@ -220,40 +213,24 @@ new HydraulicBoundaryLocation(1, "test", 1.0, 2.0) }); - var expectedSimpleAssembly = new FailureMechanismSectionAssembly(random.NextDouble(), random.NextEnumValue()); - var expectedDetailedAssembly = new FailureMechanismSectionAssembly(random.NextDouble(), random.NextEnumValue()); - var expectedTailorMadeAssembly = new FailureMechanismSectionAssembly(random.NextDouble(), random.NextEnumValue()); - var expectedCombinedAssembly = new FailureMechanismSectionAssembly(random.NextDouble(), random.NextEnumValue()); + // Call + ClosingStructuresFailureMechanismView view = CreateView(failureMechanism, assessmentSection); - using (new AssemblyToolCalculatorFactoryConfig()) - { - var calculatorFactory = (TestAssemblyToolCalculatorFactory) AssemblyToolCalculatorFactory.Instance; - FailureMechanismSectionAssemblyCalculatorStub calculator = calculatorFactory.LastCreatedFailureMechanismSectionAssemblyCalculator; + IMapControl map = ((RiskeerMapControl) view.Controls[0]).MapControl; - calculator.SimpleAssessmentAssemblyOutput = expectedSimpleAssembly; - calculator.DetailedAssessmentAssemblyOutput = expectedDetailedAssembly; - calculator.TailorMadeAssessmentAssemblyOutput = expectedTailorMadeAssembly; - calculator.CombinedAssemblyOutput = expectedCombinedAssembly; + // Assert + MapDataCollection mapData = map.Data; + Assert.IsInstanceOf(mapData); - // Call - ClosingStructuresFailureMechanismView view = CreateView(failureMechanism, assessmentSection); + List mapDataList = mapData.Collection.ToList(); + Assert.AreEqual(5, mapDataList.Count); + MapDataTestHelper.AssertReferenceLineMapData(assessmentSection.ReferenceLine, mapDataList[referenceLineIndex]); - IMapControl map = ((RiskeerMapControl) view.Controls[0]).MapControl; - - // Assert - MapDataCollection mapData = map.Data; - Assert.IsInstanceOf(mapData); - - List mapDataList = mapData.Collection.ToList(); - Assert.AreEqual(5, mapDataList.Count); - MapDataTestHelper.AssertReferenceLineMapData(assessmentSection.ReferenceLine, mapDataList[referenceLineIndex]); - - MapDataTestHelper.AssertHydraulicBoundaryLocationsMapData(assessmentSection, mapDataList[hydraulicBoundaryLocationsIndex]); - MapDataTestHelper.AssertForeshoreProfilesMapData(failureMechanism.ForeshoreProfiles, mapDataList[foreshoreProfilesIndex]); - AssertCalculationsMapData( - failureMechanism.Calculations.Cast>(), - mapDataList[calculationsIndex]); - } + MapDataTestHelper.AssertHydraulicBoundaryLocationsMapData(assessmentSection, mapDataList[hydraulicBoundaryLocationsIndex]); + MapDataTestHelper.AssertForeshoreProfilesMapData(failureMechanism.ForeshoreProfiles, mapDataList[foreshoreProfilesIndex]); + AssertCalculationsMapData( + failureMechanism.Calculations.Cast>(), + mapDataList[calculationsIndex]); } [Test] Index: Riskeer/DuneErosion/test/Riskeer.DuneErosion.Forms.Test/Views/DuneErosionFailureMechanismViewTest.cs =================================================================== diff -u -ra57e6b5e198e898a2cbfc3c35e50a3dfb25a55fe -r2d1b590dd680ce0450549d8b293f86bc8849c1a2 --- Riskeer/DuneErosion/test/Riskeer.DuneErosion.Forms.Test/Views/DuneErosionFailureMechanismViewTest.cs (.../DuneErosionFailureMechanismViewTest.cs) (revision a57e6b5e198e898a2cbfc3c35e50a3dfb25a55fe) +++ Riskeer/DuneErosion/test/Riskeer.DuneErosion.Forms.Test/Views/DuneErosionFailureMechanismViewTest.cs (.../DuneErosionFailureMechanismViewTest.cs) (revision 2d1b590dd680ce0450549d8b293f86bc8849c1a2) @@ -26,15 +26,10 @@ using System.Windows.Forms; using Core.Common.Base; using Core.Common.Base.Geometry; -using Core.Common.TestUtil; using Core.Components.Gis.Data; using Core.Components.Gis.Forms; using NUnit.Framework; using Rhino.Mocks; -using Riskeer.AssemblyTool.Data; -using Riskeer.AssemblyTool.KernelWrapper.Calculators; -using Riskeer.AssemblyTool.KernelWrapper.TestUtil.Calculators; -using Riskeer.AssemblyTool.KernelWrapper.TestUtil.Calculators.Assembly; using Riskeer.Common.Data.AssessmentSection; using Riskeer.Common.Data.FailureMechanism; using Riskeer.Common.Data.TestUtil; @@ -163,8 +158,6 @@ public void Constructor_WithAllData_DataUpdatedToCollectionOfFilledMapData() { // Setup - var random = new Random(39); - var assessmentSection = new AssessmentSectionStub { ReferenceLine = new ReferenceLine() @@ -195,36 +188,20 @@ new FailureMechanismSection("C", geometryPoints.Skip(2).Take(2)) }); - var expectedSimpleAssembly = new FailureMechanismSectionAssembly(random.NextDouble(), random.NextEnumValue()); - var expectedDetailedAssemblyCategory = random.NextEnumValue(); - var expectedTailorMadeAssemblyCategory = random.NextEnumValue(); - var expectedCombinedAssemblyCategory = random.NextEnumValue(); + // Call + DuneErosionFailureMechanismView view = CreateView(failureMechanism, assessmentSection); - using (new AssemblyToolCalculatorFactoryConfig()) - { - var calculatorFactory = (TestAssemblyToolCalculatorFactory) AssemblyToolCalculatorFactory.Instance; - FailureMechanismSectionAssemblyCalculatorStub calculator = calculatorFactory.LastCreatedFailureMechanismSectionAssemblyCalculator; + IMapControl map = ((RiskeerMapControl) view.Controls[0]).MapControl; - calculator.SimpleAssessmentAssemblyOutput = expectedSimpleAssembly; - calculator.DetailedAssessmentAssemblyGroupOutput = expectedDetailedAssemblyCategory; - calculator.TailorMadeAssemblyCategoryOutput = expectedTailorMadeAssemblyCategory; - calculator.CombinedAssemblyCategoryOutput = expectedCombinedAssemblyCategory; + // Assert + MapDataCollection mapData = map.Data; + Assert.IsInstanceOf(mapData); - // Call - DuneErosionFailureMechanismView view = CreateView(failureMechanism, assessmentSection); + List mapDataList = mapData.Collection.ToList(); + Assert.AreEqual(2, mapDataList.Count); + MapDataTestHelper.AssertReferenceLineMapData(assessmentSection.ReferenceLine, mapDataList[referenceLineIndex]); - IMapControl map = ((RiskeerMapControl) view.Controls[0]).MapControl; - - // Assert - MapDataCollection mapData = map.Data; - Assert.IsInstanceOf(mapData); - - List mapDataList = mapData.Collection.ToList(); - Assert.AreEqual(2, mapDataList.Count); - MapDataTestHelper.AssertReferenceLineMapData(assessmentSection.ReferenceLine, mapDataList[referenceLineIndex]); - - AssertDuneLocationsMapData(failureMechanism, mapDataList[duneLocationsIndex]); - } + AssertDuneLocationsMapData(failureMechanism, mapDataList[duneLocationsIndex]); } [Test] Index: Riskeer/GrassCoverErosionInwards/test/Riskeer.GrassCoverErosionInwards.Forms.Test/Views/GrassCoverErosionInwardsFailureMechanismViewTest.cs =================================================================== diff -u -r4d1aefb330c43c108d0f61fc774b88f55d5bfb26 -r2d1b590dd680ce0450549d8b293f86bc8849c1a2 --- Riskeer/GrassCoverErosionInwards/test/Riskeer.GrassCoverErosionInwards.Forms.Test/Views/GrassCoverErosionInwardsFailureMechanismViewTest.cs (.../GrassCoverErosionInwardsFailureMechanismViewTest.cs) (revision 4d1aefb330c43c108d0f61fc774b88f55d5bfb26) +++ Riskeer/GrassCoverErosionInwards/test/Riskeer.GrassCoverErosionInwards.Forms.Test/Views/GrassCoverErosionInwardsFailureMechanismViewTest.cs (.../GrassCoverErosionInwardsFailureMechanismViewTest.cs) (revision 2d1b590dd680ce0450549d8b293f86bc8849c1a2) @@ -26,17 +26,12 @@ using System.Windows.Forms; using Core.Common.Base; using Core.Common.Base.Geometry; -using Core.Common.TestUtil; using Core.Components.Gis.Data; using Core.Components.Gis.Features; using Core.Components.Gis.Forms; using Core.Components.Gis.Geometries; using NUnit.Framework; using Rhino.Mocks; -using Riskeer.AssemblyTool.Data; -using Riskeer.AssemblyTool.KernelWrapper.Calculators; -using Riskeer.AssemblyTool.KernelWrapper.TestUtil.Calculators; -using Riskeer.AssemblyTool.KernelWrapper.TestUtil.Calculators.Assembly; using Riskeer.Common.Data.AssessmentSection; using Riskeer.Common.Data.DikeProfiles; using Riskeer.Common.Data.FailureMechanism; @@ -149,8 +144,6 @@ public void Constructor_WithAllData_DataUpdatedToCollectionOfFilledMapData() { // Setup - var random = new Random(39); - var calculationA = new GrassCoverErosionInwardsCalculationScenario { InputParameters = @@ -217,39 +210,23 @@ new HydraulicBoundaryLocation(1, "test", 1.0, 2.0) }); - var expectedSimpleAssembly = new FailureMechanismSectionAssembly(random.NextDouble(), random.NextEnumValue()); - var expectedDetailedAssembly = new FailureMechanismSectionAssembly(random.NextDouble(), random.NextEnumValue()); - var expectedTailorMadeAssembly = new FailureMechanismSectionAssembly(random.NextDouble(), random.NextEnumValue()); - var expectedCombinedAssembly = new FailureMechanismSectionAssembly(random.NextDouble(), random.NextEnumValue()); + // Call + GrassCoverErosionInwardsFailureMechanismView view = CreateView(failureMechanism, assessmentSection); - using (new AssemblyToolCalculatorFactoryConfig()) - { - var calculatorFactory = (TestAssemblyToolCalculatorFactory) AssemblyToolCalculatorFactory.Instance; - FailureMechanismSectionAssemblyCalculatorStub calculator = calculatorFactory.LastCreatedFailureMechanismSectionAssemblyCalculator; + IMapControl map = ((RiskeerMapControl) view.Controls[0]).MapControl; - calculator.SimpleAssessmentAssemblyOutput = expectedSimpleAssembly; - calculator.DetailedAssessmentAssemblyOutput = expectedDetailedAssembly; - calculator.TailorMadeAssessmentAssemblyOutput = expectedTailorMadeAssembly; - calculator.CombinedAssemblyOutput = expectedCombinedAssembly; + // Assert + MapDataCollection mapData = map.Data; + Assert.IsInstanceOf(mapData); - // Call - GrassCoverErosionInwardsFailureMechanismView view = CreateView(failureMechanism, assessmentSection); + List mapDataList = mapData.Collection.ToList(); + Assert.AreEqual(5, mapDataList.Count); + MapDataTestHelper.AssertReferenceLineMapData(assessmentSection.ReferenceLine, mapDataList[referenceLineIndex]); - IMapControl map = ((RiskeerMapControl) view.Controls[0]).MapControl; - - // Assert - MapDataCollection mapData = map.Data; - Assert.IsInstanceOf(mapData); - - List mapDataList = mapData.Collection.ToList(); - Assert.AreEqual(5, mapDataList.Count); - MapDataTestHelper.AssertReferenceLineMapData(assessmentSection.ReferenceLine, mapDataList[referenceLineIndex]); - - MapDataTestHelper.AssertHydraulicBoundaryLocationsMapData(assessmentSection, mapDataList[hydraulicBoundaryLocationsIndex]); - AssertDikeProfiles(failureMechanism.DikeProfiles, mapDataList[dikeProfilesIndex]); - MapDataTestHelper.AssertForeshoreProfilesMapData(failureMechanism.DikeProfiles.Select(dp => dp.ForeshoreProfile), mapDataList[foreshoreProfilesIndex]); - AssertCalculationsMapData(failureMechanism.Calculations.Cast(), mapDataList[calculationsIndex]); - } + MapDataTestHelper.AssertHydraulicBoundaryLocationsMapData(assessmentSection, mapDataList[hydraulicBoundaryLocationsIndex]); + AssertDikeProfiles(failureMechanism.DikeProfiles, mapDataList[dikeProfilesIndex]); + MapDataTestHelper.AssertForeshoreProfilesMapData(failureMechanism.DikeProfiles.Select(dp => dp.ForeshoreProfile), mapDataList[foreshoreProfilesIndex]); + AssertCalculationsMapData(failureMechanism.Calculations.Cast(), mapDataList[calculationsIndex]); } [Test] Index: Riskeer/GrassCoverErosionOutwards/test/Riskeer.GrassCoverErosionOutwards.Forms.Test/Views/GrassCoverErosionOutwardsFailureMechanismViewTest.cs =================================================================== diff -u -rc2cb259e6b44db8bf47ee91b9ce66957cd84a083 -r2d1b590dd680ce0450549d8b293f86bc8849c1a2 --- Riskeer/GrassCoverErosionOutwards/test/Riskeer.GrassCoverErosionOutwards.Forms.Test/Views/GrassCoverErosionOutwardsFailureMechanismViewTest.cs (.../GrassCoverErosionOutwardsFailureMechanismViewTest.cs) (revision c2cb259e6b44db8bf47ee91b9ce66957cd84a083) +++ Riskeer/GrassCoverErosionOutwards/test/Riskeer.GrassCoverErosionOutwards.Forms.Test/Views/GrassCoverErosionOutwardsFailureMechanismViewTest.cs (.../GrassCoverErosionOutwardsFailureMechanismViewTest.cs) (revision 2d1b590dd680ce0450549d8b293f86bc8849c1a2) @@ -26,17 +26,12 @@ using System.Windows.Forms; using Core.Common.Base; using Core.Common.Base.Geometry; -using Core.Common.TestUtil; using Core.Components.Gis.Data; using Core.Components.Gis.Features; using Core.Components.Gis.Forms; using Core.Components.Gis.Geometries; using NUnit.Framework; using Rhino.Mocks; -using Riskeer.AssemblyTool.Data; -using Riskeer.AssemblyTool.KernelWrapper.Calculators; -using Riskeer.AssemblyTool.KernelWrapper.TestUtil.Calculators; -using Riskeer.AssemblyTool.KernelWrapper.TestUtil.Calculators.Assembly; using Riskeer.Common.Data.AssessmentSection; using Riskeer.Common.Data.FailureMechanism; using Riskeer.Common.Data.Hydraulics; @@ -77,8 +72,11 @@ yield return new TestCaseData(new Func( (assessmentSection, failureMechanism) => assessmentSection.WaterLevelCalculationsForLowerLimitNorm.First())); yield return new TestCaseData(new Func( - (assessmentSection, failureMechanism) => failureMechanism.WaterLevelCalculationsForMechanismSpecificFactorizedSignalingNorm.First())); + (assessmentSection, failureMechanism) => assessmentSection.WaterLevelCalculationsForFactorizedLowerLimitNorm.First())); + yield return new TestCaseData(new Func( + (assessmentSection, failureMechanism) => failureMechanism.WaveHeightCalculationsForMechanismSpecificFactorizedSignalingNorm.First())); + yield return new TestCaseData(new Func( (assessmentSection, failureMechanism) => failureMechanism.WaveHeightCalculationsForMechanismSpecificSignalingNorm.First())); yield return new TestCaseData(new Func( (assessmentSection, failureMechanism) => failureMechanism.WaveHeightCalculationsForMechanismSpecificLowerLimitNorm.First())); @@ -175,8 +173,6 @@ public void Constructor_WithAllData_DataUpdatedToCollectionOfFilledMapData() { // Setup - var random = new Random(39); - var calculationA = new GrassCoverErosionOutwardsWaveConditionsCalculation { InputParameters = @@ -245,39 +241,23 @@ new HydraulicBoundaryLocation(1, "test", 1.0, 2.0) }); - var expectedSimpleAssembly = new FailureMechanismSectionAssembly(random.NextDouble(), random.NextEnumValue()); - var expectedDetailedAssemblyCategory = random.NextEnumValue(); - var expectedTailorMadeAssemblyCategory = random.NextEnumValue(); - var expectedCombinedAssemblyCategory = random.NextEnumValue(); + // Call + GrassCoverErosionOutwardsFailureMechanismView view = CreateView(failureMechanism, assessmentSection); - using (new AssemblyToolCalculatorFactoryConfig()) - { - var calculatorFactory = (TestAssemblyToolCalculatorFactory) AssemblyToolCalculatorFactory.Instance; - FailureMechanismSectionAssemblyCalculatorStub calculator = calculatorFactory.LastCreatedFailureMechanismSectionAssemblyCalculator; + IMapControl map = ((RiskeerMapControl) view.Controls[0]).MapControl; - calculator.SimpleAssessmentAssemblyOutput = expectedSimpleAssembly; - calculator.DetailedAssessmentAssemblyGroupOutput = expectedDetailedAssemblyCategory; - calculator.TailorMadeAssemblyCategoryOutput = expectedTailorMadeAssemblyCategory; - calculator.CombinedAssemblyCategoryOutput = expectedCombinedAssemblyCategory; + // Assert + MapDataCollection mapData = map.Data; + Assert.IsInstanceOf(mapData); - // Call - GrassCoverErosionOutwardsFailureMechanismView view = CreateView(failureMechanism, assessmentSection); + List mapDataList = mapData.Collection.ToList(); + Assert.AreEqual(4, mapDataList.Count); + MapDataTestHelper.AssertReferenceLineMapData(assessmentSection.ReferenceLine, mapDataList[referenceLineIndex]); - IMapControl map = ((RiskeerMapControl) view.Controls[0]).MapControl; - - // Assert - MapDataCollection mapData = map.Data; - Assert.IsInstanceOf(mapData); - - List mapDataList = mapData.Collection.ToList(); - Assert.AreEqual(4, mapDataList.Count); - MapDataTestHelper.AssertReferenceLineMapData(assessmentSection.ReferenceLine, mapDataList[referenceLineIndex]); - - GrassCoverErosionOutwardsMapDataTestHelper.AssertHydraulicBoundaryLocationsMapData(failureMechanism, assessmentSection, mapDataList[hydraulicBoundaryLocationsIndex]); - MapDataTestHelper.AssertForeshoreProfilesMapData(failureMechanism.ForeshoreProfiles, mapDataList[foreshoreProfilesIndex]); - AssertCalculationsMapData(failureMechanism.Calculations.Cast(), - mapDataList[calculationsIndex]); - } + GrassCoverErosionOutwardsMapDataTestHelper.AssertHydraulicBoundaryLocationsMapData(failureMechanism, assessmentSection, mapDataList[hydraulicBoundaryLocationsIndex]); + MapDataTestHelper.AssertForeshoreProfilesMapData(failureMechanism.ForeshoreProfiles, mapDataList[foreshoreProfilesIndex]); + AssertCalculationsMapData(failureMechanism.Calculations.Cast(), + mapDataList[calculationsIndex]); } [Test] Index: Riskeer/HeightStructures/test/Riskeer.HeightStructures.Forms.Test/Views/HeightStructuresFailureMechanismViewTest.cs =================================================================== diff -u -r985d9f64806f0db6a86dd8d742119bcc072d435d -r2d1b590dd680ce0450549d8b293f86bc8849c1a2 --- Riskeer/HeightStructures/test/Riskeer.HeightStructures.Forms.Test/Views/HeightStructuresFailureMechanismViewTest.cs (.../HeightStructuresFailureMechanismViewTest.cs) (revision 985d9f64806f0db6a86dd8d742119bcc072d435d) +++ Riskeer/HeightStructures/test/Riskeer.HeightStructures.Forms.Test/Views/HeightStructuresFailureMechanismViewTest.cs (.../HeightStructuresFailureMechanismViewTest.cs) (revision 2d1b590dd680ce0450549d8b293f86bc8849c1a2) @@ -26,17 +26,12 @@ using System.Windows.Forms; using Core.Common.Base; using Core.Common.Base.Geometry; -using Core.Common.TestUtil; using Core.Components.Gis.Data; using Core.Components.Gis.Features; using Core.Components.Gis.Forms; using Core.Components.Gis.Geometries; using NUnit.Framework; using Rhino.Mocks; -using Riskeer.AssemblyTool.Data; -using Riskeer.AssemblyTool.KernelWrapper.Calculators; -using Riskeer.AssemblyTool.KernelWrapper.TestUtil.Calculators; -using Riskeer.AssemblyTool.KernelWrapper.TestUtil.Calculators.Assembly; using Riskeer.Common.Data.AssessmentSection; using Riskeer.Common.Data.FailureMechanism; using Riskeer.Common.Data.Hydraulics; @@ -150,8 +145,6 @@ public void Constructor_WithAllData_DataUpdatedToCollectionOfFilledMapData() { // Setup - var random = new Random(39); - var calculationA = new StructuresCalculationScenario { InputParameters = @@ -220,40 +213,24 @@ new HydraulicBoundaryLocation(1, "test", 1.0, 2.0) }); - var expectedSimpleAssembly = new FailureMechanismSectionAssembly(random.NextDouble(), random.NextEnumValue()); - var expectedDetailedAssembly = new FailureMechanismSectionAssembly(random.NextDouble(), random.NextEnumValue()); - var expectedTailorMadeAssembly = new FailureMechanismSectionAssembly(random.NextDouble(), random.NextEnumValue()); - var expectedCombinedAssembly = new FailureMechanismSectionAssembly(random.NextDouble(), random.NextEnumValue()); + // Call + HeightStructuresFailureMechanismView view = CreateView(failureMechanism, assessmentSection); - using (new AssemblyToolCalculatorFactoryConfig()) - { - var calculatorFactory = (TestAssemblyToolCalculatorFactory) AssemblyToolCalculatorFactory.Instance; - FailureMechanismSectionAssemblyCalculatorStub calculator = calculatorFactory.LastCreatedFailureMechanismSectionAssemblyCalculator; + IMapControl map = ((RiskeerMapControl) view.Controls[0]).MapControl; - calculator.SimpleAssessmentAssemblyOutput = expectedSimpleAssembly; - calculator.DetailedAssessmentAssemblyOutput = expectedDetailedAssembly; - calculator.TailorMadeAssessmentAssemblyOutput = expectedTailorMadeAssembly; - calculator.CombinedAssemblyOutput = expectedCombinedAssembly; + // Assert + MapDataCollection mapData = map.Data; + Assert.IsInstanceOf(mapData); - // Call - HeightStructuresFailureMechanismView view = CreateView(failureMechanism, assessmentSection); + List mapDataList = mapData.Collection.ToList(); + Assert.AreEqual(5, mapDataList.Count); + MapDataTestHelper.AssertReferenceLineMapData(assessmentSection.ReferenceLine, mapDataList[referenceLineIndex]); - IMapControl map = ((RiskeerMapControl) view.Controls[0]).MapControl; - - // Assert - MapDataCollection mapData = map.Data; - Assert.IsInstanceOf(mapData); - - List mapDataList = mapData.Collection.ToList(); - Assert.AreEqual(5, mapDataList.Count); - MapDataTestHelper.AssertReferenceLineMapData(assessmentSection.ReferenceLine, mapDataList[referenceLineIndex]); - - MapDataTestHelper.AssertHydraulicBoundaryLocationsMapData(assessmentSection, mapDataList[hydraulicBoundaryLocationsIndex]); - MapDataTestHelper.AssertForeshoreProfilesMapData(failureMechanism.ForeshoreProfiles, mapDataList[foreshoreProfilesIndex]); - AssertCalculationsMapData( - failureMechanism.Calculations.Cast>(), - mapDataList[calculationsIndex]); - } + MapDataTestHelper.AssertHydraulicBoundaryLocationsMapData(assessmentSection, mapDataList[hydraulicBoundaryLocationsIndex]); + MapDataTestHelper.AssertForeshoreProfilesMapData(failureMechanism.ForeshoreProfiles, mapDataList[foreshoreProfilesIndex]); + AssertCalculationsMapData( + failureMechanism.Calculations.Cast>(), + mapDataList[calculationsIndex]); } [Test] Index: Riskeer/MacroStabilityInwards/test/Riskeer.MacroStabilityInwards.Forms.Test/Views/MacroStabilityInwardsFailureMechanismViewTest.cs =================================================================== diff -u -rb9be1b9015f4bb40fa2942fb4f1c26a4b2f1ae7d -r2d1b590dd680ce0450549d8b293f86bc8849c1a2 --- Riskeer/MacroStabilityInwards/test/Riskeer.MacroStabilityInwards.Forms.Test/Views/MacroStabilityInwardsFailureMechanismViewTest.cs (.../MacroStabilityInwardsFailureMechanismViewTest.cs) (revision b9be1b9015f4bb40fa2942fb4f1c26a4b2f1ae7d) +++ Riskeer/MacroStabilityInwards/test/Riskeer.MacroStabilityInwards.Forms.Test/Views/MacroStabilityInwardsFailureMechanismViewTest.cs (.../MacroStabilityInwardsFailureMechanismViewTest.cs) (revision 2d1b590dd680ce0450549d8b293f86bc8849c1a2) @@ -27,17 +27,12 @@ using System.Windows.Forms; using Core.Common.Base; using Core.Common.Base.Geometry; -using Core.Common.TestUtil; using Core.Components.Gis.Data; using Core.Components.Gis.Features; using Core.Components.Gis.Forms; using Core.Components.Gis.Geometries; using NUnit.Framework; using Rhino.Mocks; -using Riskeer.AssemblyTool.Data; -using Riskeer.AssemblyTool.KernelWrapper.Calculators; -using Riskeer.AssemblyTool.KernelWrapper.TestUtil.Calculators; -using Riskeer.AssemblyTool.KernelWrapper.TestUtil.Calculators.Assembly; using Riskeer.Common.Data.AssessmentSection; using Riskeer.Common.Data.FailureMechanism; using Riskeer.Common.Data.Hydraulics; @@ -152,8 +147,6 @@ public void Constructor_WithAllData_DataUpdatedToCollectionOfFilledMapData() { // Setup - var random = new Random(39); - MacroStabilityInwardsStochasticSoilModel stochasticSoilModel1 = MacroStabilityInwardsStochasticSoilModelTestFactory.CreateValidStochasticSoilModel("name1", new[] { @@ -239,39 +232,23 @@ hydraulicBoundaryLocation2 }); - var expectedSimpleAssembly = new FailureMechanismSectionAssembly(random.NextDouble(), random.NextEnumValue()); - var expectedDetailedAssembly = new FailureMechanismSectionAssembly(random.NextDouble(), random.NextEnumValue()); - var expectedTailorMadeAssembly = new FailureMechanismSectionAssembly(random.NextDouble(), random.NextEnumValue()); - var expectedCombinedAssembly = new FailureMechanismSectionAssembly(random.NextDouble(), random.NextEnumValue()); + // Call + MacroStabilityInwardsFailureMechanismView view = CreateView(failureMechanism, assessmentSection); - using (new AssemblyToolCalculatorFactoryConfig()) - { - var calculatorFactory = (TestAssemblyToolCalculatorFactory) AssemblyToolCalculatorFactory.Instance; - FailureMechanismSectionAssemblyCalculatorStub calculator = calculatorFactory.LastCreatedFailureMechanismSectionAssemblyCalculator; + IMapControl map = ((RiskeerMapControl) view.Controls[0]).MapControl; - calculator.SimpleAssessmentAssemblyOutput = expectedSimpleAssembly; - calculator.DetailedAssessmentAssemblyOutput = expectedDetailedAssembly; - calculator.TailorMadeAssessmentAssemblyOutput = expectedTailorMadeAssembly; - calculator.CombinedAssemblyOutput = expectedCombinedAssembly; + // Assert + MapDataCollection mapData = map.Data; + Assert.IsInstanceOf(mapData); - // Call - MacroStabilityInwardsFailureMechanismView view = CreateView(failureMechanism, assessmentSection); + List mapDataList = mapData.Collection.ToList(); + Assert.AreEqual(5, mapDataList.Count); + MapDataTestHelper.AssertReferenceLineMapData(assessmentSection.ReferenceLine, mapDataList[referenceLineIndex]); + AssertSurfaceLinesMapData(failureMechanism.SurfaceLines, mapDataList[surfaceLinesIndex]); - IMapControl map = ((RiskeerMapControl) view.Controls[0]).MapControl; - - // Assert - MapDataCollection mapData = map.Data; - Assert.IsInstanceOf(mapData); - - List mapDataList = mapData.Collection.ToList(); - Assert.AreEqual(5, mapDataList.Count); - MapDataTestHelper.AssertReferenceLineMapData(assessmentSection.ReferenceLine, mapDataList[referenceLineIndex]); - AssertSurfaceLinesMapData(failureMechanism.SurfaceLines, mapDataList[surfaceLinesIndex]); - - MapDataTestHelper.AssertHydraulicBoundaryLocationsMapData(assessmentSection, mapDataList[hydraulicBoundaryLocationsIndex]); - AssertStochasticSoilModelsMapData(failureMechanism.StochasticSoilModels, mapDataList[stochasticSoilModelsIndex]); - AssertCalculationsMapData(failureMechanism.Calculations.Cast(), mapDataList[calculationsIndex]); - } + MapDataTestHelper.AssertHydraulicBoundaryLocationsMapData(assessmentSection, mapDataList[hydraulicBoundaryLocationsIndex]); + AssertStochasticSoilModelsMapData(failureMechanism.StochasticSoilModels, mapDataList[stochasticSoilModelsIndex]); + AssertCalculationsMapData(failureMechanism.Calculations.Cast(), mapDataList[calculationsIndex]); } [Test] Index: Riskeer/Piping/test/Riskeer.Piping.Forms.Test/Views/PipingFailureMechanismViewTest.cs =================================================================== diff -u -r7379eeacf9841d628d8e81d92480690b99b44576 -r2d1b590dd680ce0450549d8b293f86bc8849c1a2 --- Riskeer/Piping/test/Riskeer.Piping.Forms.Test/Views/PipingFailureMechanismViewTest.cs (.../PipingFailureMechanismViewTest.cs) (revision 7379eeacf9841d628d8e81d92480690b99b44576) +++ Riskeer/Piping/test/Riskeer.Piping.Forms.Test/Views/PipingFailureMechanismViewTest.cs (.../PipingFailureMechanismViewTest.cs) (revision 2d1b590dd680ce0450549d8b293f86bc8849c1a2) @@ -27,17 +27,12 @@ using System.Windows.Forms; using Core.Common.Base; using Core.Common.Base.Geometry; -using Core.Common.TestUtil; using Core.Components.Gis.Data; using Core.Components.Gis.Features; using Core.Components.Gis.Forms; using Core.Components.Gis.Geometries; using NUnit.Framework; using Rhino.Mocks; -using Riskeer.AssemblyTool.Data; -using Riskeer.AssemblyTool.KernelWrapper.Calculators; -using Riskeer.AssemblyTool.KernelWrapper.TestUtil.Calculators; -using Riskeer.AssemblyTool.KernelWrapper.TestUtil.Calculators.Assembly; using Riskeer.Common.Data.AssessmentSection; using Riskeer.Common.Data.FailureMechanism; using Riskeer.Common.Data.Hydraulics; @@ -164,8 +159,6 @@ public void Constructor_WithAllData_DataUpdatedToCollectionOfFilledMapData() { // Setup - var random = new Random(39); - PipingStochasticSoilModel stochasticSoilModel1 = PipingStochasticSoilModelTestFactory.CreatePipingStochasticSoilModel("name1", new[] { new Point2D(1.0, 2.0), @@ -254,45 +247,29 @@ hydraulicBoundaryLocation2 }); - var expectedSimpleAssembly = new FailureMechanismSectionAssembly(random.NextDouble(), random.NextEnumValue()); - var expectedDetailedAssembly = new FailureMechanismSectionAssembly(random.NextDouble(), random.NextEnumValue()); - var expectedTailorMadeAssembly = new FailureMechanismSectionAssembly(random.NextDouble(), random.NextEnumValue()); - var expectedCombinedAssembly = new FailureMechanismSectionAssembly(random.NextDouble(), random.NextEnumValue()); + // Call + PipingFailureMechanismView view = CreateView(failureMechanism, assessmentSection); - using (new AssemblyToolCalculatorFactoryConfig()) - { - var calculatorFactory = (TestAssemblyToolCalculatorFactory) AssemblyToolCalculatorFactory.Instance; - FailureMechanismSectionAssemblyCalculatorStub calculator = calculatorFactory.LastCreatedFailureMechanismSectionAssemblyCalculator; + IMapControl map = ((RiskeerMapControl) view.Controls[0]).MapControl; - calculator.SimpleAssessmentAssemblyOutput = expectedSimpleAssembly; - calculator.DetailedAssessmentAssemblyOutput = expectedDetailedAssembly; - calculator.TailorMadeAssessmentAssemblyOutput = expectedTailorMadeAssembly; - calculator.CombinedAssemblyOutput = expectedCombinedAssembly; + // Assert + MapDataCollection mapData = map.Data; + Assert.IsInstanceOf(mapData); - // Call - PipingFailureMechanismView view = CreateView(failureMechanism, assessmentSection); + List mapDataList = mapData.Collection.ToList(); + Assert.AreEqual(7, mapDataList.Count); + MapDataTestHelper.AssertReferenceLineMapData(assessmentSection.ReferenceLine, mapDataList[referenceLineIndex]); + AssertSurfaceLinesMapData(failureMechanism.SurfaceLines, mapDataList[surfaceLinesIndex]); - IMapControl map = ((RiskeerMapControl) view.Controls[0]).MapControl; + IEnumerable sectionsCollection = ((MapDataCollection) mapDataList[sectionsCollectionIndex]).Collection; + MapDataTestHelper.AssertFailureMechanismSectionsMapData(failureMechanism.Sections, sectionsCollection.ElementAt(sectionsIndex)); + MapDataTestHelper.AssertFailureMechanismSectionsStartPointMapData(failureMechanism.Sections, sectionsCollection.ElementAt(sectionsStartPointIndex)); + MapDataTestHelper.AssertFailureMechanismSectionsEndPointMapData(failureMechanism.Sections, sectionsCollection.ElementAt(sectionsEndPointIndex)); - // Assert - MapDataCollection mapData = map.Data; - Assert.IsInstanceOf(mapData); - - List mapDataList = mapData.Collection.ToList(); - Assert.AreEqual(7, mapDataList.Count); - MapDataTestHelper.AssertReferenceLineMapData(assessmentSection.ReferenceLine, mapDataList[referenceLineIndex]); - AssertSurfaceLinesMapData(failureMechanism.SurfaceLines, mapDataList[surfaceLinesIndex]); - - IEnumerable sectionsCollection = ((MapDataCollection) mapDataList[sectionsCollectionIndex]).Collection; - MapDataTestHelper.AssertFailureMechanismSectionsMapData(failureMechanism.Sections, sectionsCollection.ElementAt(sectionsIndex)); - MapDataTestHelper.AssertFailureMechanismSectionsStartPointMapData(failureMechanism.Sections, sectionsCollection.ElementAt(sectionsStartPointIndex)); - MapDataTestHelper.AssertFailureMechanismSectionsEndPointMapData(failureMechanism.Sections, sectionsCollection.ElementAt(sectionsEndPointIndex)); - - MapDataTestHelper.AssertHydraulicBoundaryLocationsMapData(assessmentSection, mapDataList[hydraulicBoundaryLocationsIndex]); - AssertStochasticSoilModelsMapData(failureMechanism.StochasticSoilModels, mapDataList[stochasticSoilModelsIndex]); - AssertProbabilisticCalculationsMapData(failureMechanism.Calculations.OfType(), mapDataList[probabilisticCalculationsIndex]); - AssertSemiProbabilisticCalculationsMapData(failureMechanism.Calculations.OfType(), mapDataList[semiProbabilisticCalculationsIndex]); - } + MapDataTestHelper.AssertHydraulicBoundaryLocationsMapData(assessmentSection, mapDataList[hydraulicBoundaryLocationsIndex]); + AssertStochasticSoilModelsMapData(failureMechanism.StochasticSoilModels, mapDataList[stochasticSoilModelsIndex]); + AssertProbabilisticCalculationsMapData(failureMechanism.Calculations.OfType(), mapDataList[probabilisticCalculationsIndex]); + AssertSemiProbabilisticCalculationsMapData(failureMechanism.Calculations.OfType(), mapDataList[semiProbabilisticCalculationsIndex]); } [Test] Index: Riskeer/StabilityPointStructures/test/Riskeer.StabilityPointStructures.Forms.Test/Views/StabilityPointStructuresFailureMechanismViewTest.cs =================================================================== diff -u -r37079ed26ef3699cfc8d94f55f8b867ffb933663 -r2d1b590dd680ce0450549d8b293f86bc8849c1a2 --- Riskeer/StabilityPointStructures/test/Riskeer.StabilityPointStructures.Forms.Test/Views/StabilityPointStructuresFailureMechanismViewTest.cs (.../StabilityPointStructuresFailureMechanismViewTest.cs) (revision 37079ed26ef3699cfc8d94f55f8b867ffb933663) +++ Riskeer/StabilityPointStructures/test/Riskeer.StabilityPointStructures.Forms.Test/Views/StabilityPointStructuresFailureMechanismViewTest.cs (.../StabilityPointStructuresFailureMechanismViewTest.cs) (revision 2d1b590dd680ce0450549d8b293f86bc8849c1a2) @@ -26,17 +26,12 @@ using System.Windows.Forms; using Core.Common.Base; using Core.Common.Base.Geometry; -using Core.Common.TestUtil; using Core.Components.Gis.Data; using Core.Components.Gis.Features; using Core.Components.Gis.Forms; using Core.Components.Gis.Geometries; using NUnit.Framework; using Rhino.Mocks; -using Riskeer.AssemblyTool.Data; -using Riskeer.AssemblyTool.KernelWrapper.Calculators; -using Riskeer.AssemblyTool.KernelWrapper.TestUtil.Calculators; -using Riskeer.AssemblyTool.KernelWrapper.TestUtil.Calculators.Assembly; using Riskeer.Common.Data.AssessmentSection; using Riskeer.Common.Data.FailureMechanism; using Riskeer.Common.Data.Hydraulics; @@ -150,8 +145,6 @@ public void Constructor_WithAllData_DataUpdatedToCollectionOfFilledMapData() { // Setup - var random = new Random(39); - var calculationA = new StructuresCalculationScenario { InputParameters = @@ -220,40 +213,24 @@ new HydraulicBoundaryLocation(1, "test", 1.0, 2.0) }); - var expectedSimpleAssembly = new FailureMechanismSectionAssembly(random.NextDouble(), random.NextEnumValue()); - var expectedDetailedAssembly = new FailureMechanismSectionAssembly(random.NextDouble(), random.NextEnumValue()); - var expectedTailorMadeAssembly = new FailureMechanismSectionAssembly(random.NextDouble(), random.NextEnumValue()); - var expectedCombinedAssembly = new FailureMechanismSectionAssembly(random.NextDouble(), random.NextEnumValue()); + // Call + StabilityPointStructuresFailureMechanismView view = CreateView(failureMechanism, assessmentSection); - using (new AssemblyToolCalculatorFactoryConfig()) - { - var calculatorFactory = (TestAssemblyToolCalculatorFactory) AssemblyToolCalculatorFactory.Instance; - FailureMechanismSectionAssemblyCalculatorStub calculator = calculatorFactory.LastCreatedFailureMechanismSectionAssemblyCalculator; + IMapControl map = ((RiskeerMapControl) view.Controls[0]).MapControl; - calculator.SimpleAssessmentAssemblyOutput = expectedSimpleAssembly; - calculator.DetailedAssessmentAssemblyOutput = expectedDetailedAssembly; - calculator.TailorMadeAssessmentAssemblyOutput = expectedTailorMadeAssembly; - calculator.CombinedAssemblyOutput = expectedCombinedAssembly; + // Assert + MapDataCollection mapData = map.Data; + Assert.IsInstanceOf(mapData); - // Call - StabilityPointStructuresFailureMechanismView view = CreateView(failureMechanism, assessmentSection); + List mapDataList = mapData.Collection.ToList(); + Assert.AreEqual(5, mapDataList.Count); + MapDataTestHelper.AssertReferenceLineMapData(assessmentSection.ReferenceLine, mapDataList[referenceLineIndex]); - IMapControl map = ((RiskeerMapControl) view.Controls[0]).MapControl; - - // Assert - MapDataCollection mapData = map.Data; - Assert.IsInstanceOf(mapData); - - List mapDataList = mapData.Collection.ToList(); - Assert.AreEqual(5, mapDataList.Count); - MapDataTestHelper.AssertReferenceLineMapData(assessmentSection.ReferenceLine, mapDataList[referenceLineIndex]); - - MapDataTestHelper.AssertHydraulicBoundaryLocationsMapData(assessmentSection, mapDataList[hydraulicBoundaryLocationsIndex]); - MapDataTestHelper.AssertForeshoreProfilesMapData(failureMechanism.ForeshoreProfiles, mapDataList[foreshoreProfilesIndex]); - AssertCalculationsMapData( - failureMechanism.Calculations.Cast>(), - mapDataList[calculationsIndex]); - } + MapDataTestHelper.AssertHydraulicBoundaryLocationsMapData(assessmentSection, mapDataList[hydraulicBoundaryLocationsIndex]); + MapDataTestHelper.AssertForeshoreProfilesMapData(failureMechanism.ForeshoreProfiles, mapDataList[foreshoreProfilesIndex]); + AssertCalculationsMapData( + failureMechanism.Calculations.Cast>(), + mapDataList[calculationsIndex]); } [Test] Index: Riskeer/StabilityStoneCover/test/Riskeer.StabilityStoneCover.Forms.Test/Views/StabilityStoneCoverFailureMechanismViewTest.cs =================================================================== diff -u -r2d6d50224970b83ee9fc31549f495b4dc08ecfc2 -r2d1b590dd680ce0450549d8b293f86bc8849c1a2 --- Riskeer/StabilityStoneCover/test/Riskeer.StabilityStoneCover.Forms.Test/Views/StabilityStoneCoverFailureMechanismViewTest.cs (.../StabilityStoneCoverFailureMechanismViewTest.cs) (revision 2d6d50224970b83ee9fc31549f495b4dc08ecfc2) +++ Riskeer/StabilityStoneCover/test/Riskeer.StabilityStoneCover.Forms.Test/Views/StabilityStoneCoverFailureMechanismViewTest.cs (.../StabilityStoneCoverFailureMechanismViewTest.cs) (revision 2d1b590dd680ce0450549d8b293f86bc8849c1a2) @@ -26,17 +26,12 @@ using System.Windows.Forms; using Core.Common.Base; using Core.Common.Base.Geometry; -using Core.Common.TestUtil; using Core.Components.Gis.Data; using Core.Components.Gis.Features; using Core.Components.Gis.Forms; using Core.Components.Gis.Geometries; using NUnit.Framework; using Rhino.Mocks; -using Riskeer.AssemblyTool.Data; -using Riskeer.AssemblyTool.KernelWrapper.Calculators; -using Riskeer.AssemblyTool.KernelWrapper.TestUtil.Calculators; -using Riskeer.AssemblyTool.KernelWrapper.TestUtil.Calculators.Assembly; using Riskeer.Common.Data.AssessmentSection; using Riskeer.Common.Data.FailureMechanism; using Riskeer.Common.Data.Hydraulics; @@ -148,8 +143,6 @@ public void Constructor_WithAllData_DataUpdatedToCollectionOfFilledMapData() { // Setup - var random = new Random(39); - var calculationA = new StabilityStoneCoverWaveConditionsCalculation { InputParameters = @@ -218,38 +211,22 @@ new HydraulicBoundaryLocation(1, "test", 1.0, 2.0) }); - var expectedSimpleAssembly = new FailureMechanismSectionAssembly(random.NextDouble(), random.NextEnumValue()); - var expectedDetailedAssemblyCategory = random.NextEnumValue(); - var expectedTailorMadeAssemblyCategory = random.NextEnumValue(); - var expectedCombinedAssemblyCategory = random.NextEnumValue(); + // Call + StabilityStoneCoverFailureMechanismView view = CreateView(failureMechanism, assessmentSection); - using (new AssemblyToolCalculatorFactoryConfig()) - { - var calculatorFactory = (TestAssemblyToolCalculatorFactory) AssemblyToolCalculatorFactory.Instance; - FailureMechanismSectionAssemblyCalculatorStub calculator = calculatorFactory.LastCreatedFailureMechanismSectionAssemblyCalculator; + IMapControl map = ((RiskeerMapControl) view.Controls[0]).MapControl; - calculator.SimpleAssessmentAssemblyOutput = expectedSimpleAssembly; - calculator.DetailedAssessmentAssemblyGroupOutput = expectedDetailedAssemblyCategory; - calculator.TailorMadeAssemblyCategoryOutput = expectedTailorMadeAssemblyCategory; - calculator.CombinedAssemblyCategoryOutput = expectedCombinedAssemblyCategory; + // Assert + MapDataCollection mapData = map.Data; + Assert.IsInstanceOf(mapData); - // Call - StabilityStoneCoverFailureMechanismView view = CreateView(failureMechanism, assessmentSection); + List mapDataList = mapData.Collection.ToList(); + Assert.AreEqual(4, mapDataList.Count); + MapDataTestHelper.AssertReferenceLineMapData(assessmentSection.ReferenceLine, mapDataList[referenceLineIndex]); - IMapControl map = ((RiskeerMapControl) view.Controls[0]).MapControl; - - // Assert - MapDataCollection mapData = map.Data; - Assert.IsInstanceOf(mapData); - - List mapDataList = mapData.Collection.ToList(); - Assert.AreEqual(4, mapDataList.Count); - MapDataTestHelper.AssertReferenceLineMapData(assessmentSection.ReferenceLine, mapDataList[referenceLineIndex]); - - MapDataTestHelper.AssertHydraulicBoundaryLocationsMapData(assessmentSection, mapDataList[hydraulicBoundaryLocationsIndex]); - MapDataTestHelper.AssertForeshoreProfilesMapData(failureMechanism.ForeshoreProfiles, mapDataList[foreshoreProfilesIndex]); - AssertCalculationsMapData(failureMechanism.Calculations.Cast(), mapDataList[calculationsIndex]); - } + MapDataTestHelper.AssertHydraulicBoundaryLocationsMapData(assessmentSection, mapDataList[hydraulicBoundaryLocationsIndex]); + MapDataTestHelper.AssertForeshoreProfilesMapData(failureMechanism.ForeshoreProfiles, mapDataList[foreshoreProfilesIndex]); + AssertCalculationsMapData(failureMechanism.Calculations.Cast(), mapDataList[calculationsIndex]); } [Test] Index: Riskeer/WaveImpactAsphaltCover/test/Riskeer.WaveImpactAsphaltCover.Forms.Test/Views/WaveImpactAsphaltCoverFailureMechanismViewTest.cs =================================================================== diff -u -r7e8b7562d2dec62c1c5c0a205e1f7f4eca7243fc -r2d1b590dd680ce0450549d8b293f86bc8849c1a2 --- Riskeer/WaveImpactAsphaltCover/test/Riskeer.WaveImpactAsphaltCover.Forms.Test/Views/WaveImpactAsphaltCoverFailureMechanismViewTest.cs (.../WaveImpactAsphaltCoverFailureMechanismViewTest.cs) (revision 7e8b7562d2dec62c1c5c0a205e1f7f4eca7243fc) +++ Riskeer/WaveImpactAsphaltCover/test/Riskeer.WaveImpactAsphaltCover.Forms.Test/Views/WaveImpactAsphaltCoverFailureMechanismViewTest.cs (.../WaveImpactAsphaltCoverFailureMechanismViewTest.cs) (revision 2d1b590dd680ce0450549d8b293f86bc8849c1a2) @@ -26,17 +26,12 @@ using System.Windows.Forms; using Core.Common.Base; using Core.Common.Base.Geometry; -using Core.Common.TestUtil; using Core.Components.Gis.Data; using Core.Components.Gis.Features; using Core.Components.Gis.Forms; using Core.Components.Gis.Geometries; using NUnit.Framework; using Rhino.Mocks; -using Riskeer.AssemblyTool.Data; -using Riskeer.AssemblyTool.KernelWrapper.Calculators; -using Riskeer.AssemblyTool.KernelWrapper.TestUtil.Calculators; -using Riskeer.AssemblyTool.KernelWrapper.TestUtil.Calculators.Assembly; using Riskeer.Common.Data.AssessmentSection; using Riskeer.Common.Data.FailureMechanism; using Riskeer.Common.Data.Hydraulics; @@ -148,8 +143,6 @@ public void Constructor_WithAllData_DataUpdatedToCollectionOfFilledMapData() { // Setup - var random = new Random(39); - var calculationA = new WaveImpactAsphaltCoverWaveConditionsCalculation { InputParameters = @@ -218,38 +211,22 @@ new HydraulicBoundaryLocation(1, "test", 1.0, 2.0) }); - var expectedSimpleAssembly = new FailureMechanismSectionAssembly(random.NextDouble(), random.NextEnumValue()); - var expectedDetailedAssemblyCategory = random.NextEnumValue(); - var expectedTailorMadeAssemblyCategory = random.NextEnumValue(); - var expectedCombinedAssemblyCategory = random.NextEnumValue(); + // Call + WaveImpactAsphaltCoverFailureMechanismView view = CreateView(failureMechanism, assessmentSection); - using (new AssemblyToolCalculatorFactoryConfig()) - { - var calculatorFactory = (TestAssemblyToolCalculatorFactory) AssemblyToolCalculatorFactory.Instance; - FailureMechanismSectionAssemblyCalculatorStub calculator = calculatorFactory.LastCreatedFailureMechanismSectionAssemblyCalculator; + IMapControl map = ((RiskeerMapControl) view.Controls[0]).MapControl; - calculator.SimpleAssessmentAssemblyOutput = expectedSimpleAssembly; - calculator.DetailedAssessmentAssemblyGroupOutput = expectedDetailedAssemblyCategory; - calculator.TailorMadeAssemblyCategoryOutput = expectedTailorMadeAssemblyCategory; - calculator.CombinedAssemblyCategoryOutput = expectedCombinedAssemblyCategory; + // Assert + MapDataCollection mapData = map.Data; + Assert.IsInstanceOf(mapData); - // Call - WaveImpactAsphaltCoverFailureMechanismView view = CreateView(failureMechanism, assessmentSection); + List mapDataList = mapData.Collection.ToList(); + Assert.AreEqual(4, mapDataList.Count); + MapDataTestHelper.AssertReferenceLineMapData(assessmentSection.ReferenceLine, mapDataList[referenceLineIndex]); - IMapControl map = ((RiskeerMapControl) view.Controls[0]).MapControl; - - // Assert - MapDataCollection mapData = map.Data; - Assert.IsInstanceOf(mapData); - - List mapDataList = mapData.Collection.ToList(); - Assert.AreEqual(4, mapDataList.Count); - MapDataTestHelper.AssertReferenceLineMapData(assessmentSection.ReferenceLine, mapDataList[referenceLineIndex]); - - MapDataTestHelper.AssertHydraulicBoundaryLocationsMapData(assessmentSection, mapDataList[hydraulicBoundaryLocationsIndex]); - MapDataTestHelper.AssertForeshoreProfilesMapData(failureMechanism.ForeshoreProfiles, mapDataList[foreshoreProfilesIndex]); - AssertCalculationsMapData(failureMechanism.Calculations.Cast(), mapDataList[calculationsIndex]); - } + MapDataTestHelper.AssertHydraulicBoundaryLocationsMapData(assessmentSection, mapDataList[hydraulicBoundaryLocationsIndex]); + MapDataTestHelper.AssertForeshoreProfilesMapData(failureMechanism.ForeshoreProfiles, mapDataList[foreshoreProfilesIndex]); + AssertCalculationsMapData(failureMechanism.Calculations.Cast(), mapDataList[calculationsIndex]); } [Test]