Index: Application/Ringtoets/src/Application.Ringtoets.Storage/Create/TechnicalInnovation/TechnicalInnovationFailureMechanismSectionResultCreateExtensions.cs =================================================================== diff -u -r3fb0df0ed6e64657154700ee7706e035d5bf99f5 -r341edbfd5905c218dcbaacdc77b68ca67e5424cf --- Application/Ringtoets/src/Application.Ringtoets.Storage/Create/TechnicalInnovation/TechnicalInnovationFailureMechanismSectionResultCreateExtensions.cs (.../TechnicalInnovationFailureMechanismSectionResultCreateExtensions.cs) (revision 3fb0df0ed6e64657154700ee7706e035d5bf99f5) +++ Application/Ringtoets/src/Application.Ringtoets.Storage/Create/TechnicalInnovation/TechnicalInnovationFailureMechanismSectionResultCreateExtensions.cs (.../TechnicalInnovationFailureMechanismSectionResultCreateExtensions.cs) (revision 341edbfd5905c218dcbaacdc77b68ca67e5424cf) @@ -40,8 +40,7 @@ { var sectionResultEntity = new TechnicalInnovationSectionResultEntity { - LayerOne = Convert.ToByte(result.AssessmentLayerOne), - LayerThree = result.AssessmentLayerThree.ToNaNAsNull() + LayerOne = Convert.ToByte(result.AssessmentLayerOne) }; return sectionResultEntity; Index: Application/Ringtoets/src/Application.Ringtoets.Storage/Read/TechnicalInnovationSectionResultEntityReadExtensions.cs =================================================================== diff -u -r3fb0df0ed6e64657154700ee7706e035d5bf99f5 -r341edbfd5905c218dcbaacdc77b68ca67e5424cf --- Application/Ringtoets/src/Application.Ringtoets.Storage/Read/TechnicalInnovationSectionResultEntityReadExtensions.cs (.../TechnicalInnovationSectionResultEntityReadExtensions.cs) (revision 3fb0df0ed6e64657154700ee7706e035d5bf99f5) +++ Application/Ringtoets/src/Application.Ringtoets.Storage/Read/TechnicalInnovationSectionResultEntityReadExtensions.cs (.../TechnicalInnovationSectionResultEntityReadExtensions.cs) (revision 341edbfd5905c218dcbaacdc77b68ca67e5424cf) @@ -21,7 +21,6 @@ using System; using Application.Ringtoets.Storage.DbContext; -using Core.Common.Base.Data; using Ringtoets.Common.Data.FailureMechanism; using Ringtoets.Integration.Data.StandAlone.SectionResults; @@ -47,8 +46,8 @@ { throw new ArgumentNullException(nameof(sectionResult)); } + sectionResult.AssessmentLayerOne = (AssessmentLayerOneState) entity.LayerOne; - sectionResult.AssessmentLayerThree = (RoundedDouble) entity.LayerThree.ToNullAsNaN(); } } } \ No newline at end of file Index: Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/TechnicalInnovation/TechnicalInnovationFailureMechanismSectionResultCreateExtensionsTest.cs =================================================================== diff -u -rb8df616ca911988b921b933bead5f1ef6862d076 -r341edbfd5905c218dcbaacdc77b68ca67e5424cf --- Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/TechnicalInnovation/TechnicalInnovationFailureMechanismSectionResultCreateExtensionsTest.cs (.../TechnicalInnovationFailureMechanismSectionResultCreateExtensionsTest.cs) (revision b8df616ca911988b921b933bead5f1ef6862d076) +++ Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/TechnicalInnovation/TechnicalInnovationFailureMechanismSectionResultCreateExtensionsTest.cs (.../TechnicalInnovationFailureMechanismSectionResultCreateExtensionsTest.cs) (revision 341edbfd5905c218dcbaacdc77b68ca67e5424cf) @@ -23,11 +23,9 @@ using Application.Ringtoets.Storage.Create.TechnicalInnovation; using Application.Ringtoets.Storage.DbContext; using Application.Ringtoets.Storage.TestUtil; -using Core.Common.Base.Data; using Core.Common.TestUtil; using NUnit.Framework; using Ringtoets.Common.Data.FailureMechanism; -using Ringtoets.Common.Data.TestUtil; using Ringtoets.Integration.Data.StandAlone.SectionResults; namespace Application.Ringtoets.Storage.Test.Create.TechnicalInnovation @@ -43,33 +41,14 @@ var sectionResult = new TechnicalInnovationFailureMechanismSectionResult(new TestFailureMechanismSection()) { - AssessmentLayerOne = random.NextEnumValue(), - AssessmentLayerThree = random.NextRoundedDouble() + AssessmentLayerOne = random.NextEnumValue() }; // Call TechnicalInnovationSectionResultEntity result = sectionResult.Create(); // Assert Assert.AreEqual(Convert.ToByte(sectionResult.AssessmentLayerOne), result.LayerOne); - Assert.AreEqual(sectionResult.AssessmentLayerThree, result.LayerThree, - sectionResult.AssessmentLayerThree.GetAccuracy()); } - - [Test] - public void Create_WithNaNLevel3Result_ReturnsEntityWithExpectedResults() - { - // Setup - var sectionResult = new TechnicalInnovationFailureMechanismSectionResult(new TestFailureMechanismSection()) - { - AssessmentLayerThree = RoundedDouble.NaN - }; - - // Call - TechnicalInnovationSectionResultEntity result = sectionResult.Create(); - - // Assert - Assert.IsNull(result.LayerThree); - } } } \ No newline at end of file Index: Application/Ringtoets/test/Application.Ringtoets.Storage.Test/IntegrationTests/StorageSqLiteIntegrationTest.cs =================================================================== diff -u -r25f59fa52f81f0e5d8e1935f00abd21f2207bb7d -r341edbfd5905c218dcbaacdc77b68ca67e5424cf --- Application/Ringtoets/test/Application.Ringtoets.Storage.Test/IntegrationTests/StorageSqLiteIntegrationTest.cs (.../StorageSqLiteIntegrationTest.cs) (revision 25f59fa52f81f0e5d8e1935f00abd21f2207bb7d) +++ Application/Ringtoets/test/Application.Ringtoets.Storage.Test/IntegrationTests/StorageSqLiteIntegrationTest.cs (.../StorageSqLiteIntegrationTest.cs) (revision 341edbfd5905c218dcbaacdc77b68ca67e5424cf) @@ -378,11 +378,7 @@ { AssertCollectionAndItems(expectedSectionResults, actualSectionResults, - (expectedItem, actualItem) => - { - Assert.AreEqual(expectedItem.AssessmentLayerOne, actualItem.AssessmentLayerOne); - Assert.AreEqual(expectedItem.AssessmentLayerThree, actualItem.AssessmentLayerThree); - }); + (expectedItem, actualItem) => { Assert.AreEqual(expectedItem.AssessmentLayerOne, actualItem.AssessmentLayerOne); }); } private static void AssertFailureMechanismSectionResults( @@ -391,10 +387,7 @@ { AssertCollectionAndItems(expectedSectionResults, actualSectionResults, - (expectedItem, actualItem) => - { - Assert.AreEqual(expectedItem.AssessmentLayerOne, actualItem.AssessmentLayerOne); - }); + (expectedItem, actualItem) => { Assert.AreEqual(expectedItem.AssessmentLayerOne, actualItem.AssessmentLayerOne); }); } private static void AssertFailureMechanismSectionResults( Index: Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Read/TechnicalInnovationSectionResultEntityReadExtensionsTest.cs =================================================================== diff -u -rb8df616ca911988b921b933bead5f1ef6862d076 -r341edbfd5905c218dcbaacdc77b68ca67e5424cf --- Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Read/TechnicalInnovationSectionResultEntityReadExtensionsTest.cs (.../TechnicalInnovationSectionResultEntityReadExtensionsTest.cs) (revision b8df616ca911988b921b933bead5f1ef6862d076) +++ Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Read/TechnicalInnovationSectionResultEntityReadExtensionsTest.cs (.../TechnicalInnovationSectionResultEntityReadExtensionsTest.cs) (revision 341edbfd5905c218dcbaacdc77b68ca67e5424cf) @@ -73,35 +73,6 @@ // Assert Assert.IsNotNull(sectionResult); Assert.AreEqual(layerOne, sectionResult.AssessmentLayerOne); - Assert.AreEqual(layerThree, sectionResult.AssessmentLayerThree, 1e-6); } - - [Test] - public void Read_EntityWithNullValues_SectionResultWithNaNValues() - { - // Setup - var random = new Random(21); - var layerOne = random.NextEnumValue(); - - var collector = new ReadConversionCollector(); - - var failureMechanismSectionEntity = new FailureMechanismSectionEntity(); - collector.Read(failureMechanismSectionEntity, new TestFailureMechanismSection()); - var entity = new TechnicalInnovationSectionResultEntity - { - LayerThree = null, - LayerOne = Convert.ToByte(layerOne), - FailureMechanismSectionEntity = failureMechanismSectionEntity - }; - var sectionResult = new TechnicalInnovationFailureMechanismSectionResult(new TestFailureMechanismSection()); - - // Call - entity.Read(sectionResult); - - // Assert - Assert.IsNotNull(sectionResult); - Assert.AreEqual(layerOne, sectionResult.AssessmentLayerOne); - Assert.IsNaN(sectionResult.AssessmentLayerThree); - } } } \ No newline at end of file Index: Application/Ringtoets/test/Application.Ringtoets.Storage.TestUtil/RingtoetsProjectTestHelper.cs =================================================================== diff -u -r25f59fa52f81f0e5d8e1935f00abd21f2207bb7d -r341edbfd5905c218dcbaacdc77b68ca67e5424cf --- Application/Ringtoets/test/Application.Ringtoets.Storage.TestUtil/RingtoetsProjectTestHelper.cs (.../RingtoetsProjectTestHelper.cs) (revision 25f59fa52f81f0e5d8e1935f00abd21f2207bb7d) +++ Application/Ringtoets/test/Application.Ringtoets.Storage.TestUtil/RingtoetsProjectTestHelper.cs (.../RingtoetsProjectTestHelper.cs) (revision 341edbfd5905c218dcbaacdc77b68ca67e5424cf) @@ -204,11 +204,9 @@ private static void SetSectionResults(IEnumerable sectionResults) { - var random = new Random(21); foreach (TechnicalInnovationFailureMechanismSectionResult sectionResult in sectionResults) { sectionResult.AssessmentLayerOne = GetAssessmentLayerOneState(); - sectionResult.AssessmentLayerThree = (RoundedDouble) random.NextDouble(); } } @@ -226,8 +224,8 @@ foreach (MacroStabilityOutwardsFailureMechanismSectionResult sectionResult in sectionResults) { sectionResult.AssessmentLayerOne = GetAssessmentLayerOneState(); - sectionResult.DetailedAssessmentProbability = (RoundedDouble) random.NextDouble(); - sectionResult.TailorMadeAssessmentProbability = (RoundedDouble) random.NextDouble(); + sectionResult.DetailedAssessmentProbability = random.NextDouble(); + sectionResult.TailorMadeAssessmentProbability = random.NextDouble(); } } @@ -527,27 +525,27 @@ BreakWater = { Type = BreakWaterType.Dam, - Height = (RoundedDouble) random.NextDouble() + Height = random.NextRoundedDouble() }, DrainCoefficient = { - Mean = (RoundedDouble) random.NextDouble() + Mean = random.NextRoundedDouble() }, - FactorStormDurationOpenStructure = (RoundedDouble) random.NextDouble(), + FactorStormDurationOpenStructure = random.NextRoundedDouble(), FailureProbabilityStructureWithErosion = random.NextDouble(), ForeshoreProfile = foreshoreProfile, HydraulicBoundaryLocation = hydroLocation, LoadSchematizationType = LoadSchematizationType.Quadratic, ModelFactorSuperCriticalFlow = { - Mean = (RoundedDouble) random.NextDouble() + Mean = random.NextRoundedDouble() }, - VolumicWeightWater = (RoundedDouble) random.NextDouble(), + VolumicWeightWater = random.NextRoundedDouble(), UseForeshore = random.NextBoolean(), UseBreakWater = random.NextBoolean(), StormDuration = { - Mean = (RoundedDouble) random.NextDouble() + Mean = random.NextRoundedDouble() }, Structure = stabilityPointStructure, ShouldIllustrationPointsBeCalculated = false @@ -566,27 +564,27 @@ BreakWater = { Type = BreakWaterType.Dam, - Height = (RoundedDouble) random.NextDouble() + Height = random.NextRoundedDouble() }, DrainCoefficient = { - Mean = (RoundedDouble) random.NextDouble() + Mean = random.NextRoundedDouble() }, - FactorStormDurationOpenStructure = (RoundedDouble) random.NextDouble(), + FactorStormDurationOpenStructure = random.NextRoundedDouble(), FailureProbabilityStructureWithErosion = random.NextDouble(), ForeshoreProfile = foreshoreProfile, HydraulicBoundaryLocation = hydroLocation, LoadSchematizationType = LoadSchematizationType.Quadratic, ModelFactorSuperCriticalFlow = { - Mean = (RoundedDouble) random.NextDouble() + Mean = random.NextRoundedDouble() }, - VolumicWeightWater = (RoundedDouble) random.NextDouble(), + VolumicWeightWater = random.NextRoundedDouble(), UseForeshore = random.NextBoolean(), UseBreakWater = random.NextBoolean(), StormDuration = { - Mean = (RoundedDouble) random.NextDouble() + Mean = random.NextRoundedDouble() }, Structure = stabilityPointStructure, ShouldIllustrationPointsBeCalculated = true Index: Ringtoets/Integration/src/Ringtoets.Integration.Data/StandAlone/SectionResults/TechnicalInnovationFailureMechanismSectionResult.cs =================================================================== diff -u -rd3404f1930061f9fbf321c7ddb7f8a9e6fff4bc1 -r341edbfd5905c218dcbaacdc77b68ca67e5424cf --- Ringtoets/Integration/src/Ringtoets.Integration.Data/StandAlone/SectionResults/TechnicalInnovationFailureMechanismSectionResult.cs (.../TechnicalInnovationFailureMechanismSectionResult.cs) (revision d3404f1930061f9fbf321c7ddb7f8a9e6fff4bc1) +++ Ringtoets/Integration/src/Ringtoets.Integration.Data/StandAlone/SectionResults/TechnicalInnovationFailureMechanismSectionResult.cs (.../TechnicalInnovationFailureMechanismSectionResult.cs) (revision 341edbfd5905c218dcbaacdc77b68ca67e5424cf) @@ -19,7 +19,7 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. -using Core.Common.Base.Data; +using Ringtoets.AssemblyTool.Data; using Ringtoets.Common.Data.FailureMechanism; using Ringtoets.Common.Primitives; @@ -35,10 +35,12 @@ /// /// Creates a new instance of . /// - public TechnicalInnovationFailureMechanismSectionResult(FailureMechanismSection section) : base(section) + public TechnicalInnovationFailureMechanismSectionResult(FailureMechanismSection section) + : base(section) { SimpleAssessmentResult = SimpleAssessmentResultType.None; - AssessmentLayerThree = RoundedDouble.NaN; + TailorMadeAssessmentResult = TailorMadeAssessmentResultType.None; + ManualAssemblyCategoryGroup = FailureMechanismSectionAssemblyCategoryGroup.None; } /// @@ -47,8 +49,18 @@ public SimpleAssessmentResultType SimpleAssessmentResult { get; set; } /// - /// Gets or sets the value of the tailored assessment of safety. + /// Gets or sets the tailor made assessment result. /// - public RoundedDouble AssessmentLayerThree { get; set; } + public TailorMadeAssessmentResultType TailorMadeAssessmentResult { get; set; } + + /// + /// Gets or sets the indicator whether the combined assembly should be overwritten by . + /// + public bool UseManualAssemblyCategoryGroup { get; set; } + + /// + /// Gets or sets the manually selected assembly category group. + /// + public FailureMechanismSectionAssemblyCategoryGroup ManualAssemblyCategoryGroup { get; set; } } } \ No newline at end of file Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/SectionResultRows/TechnicalInnovationSectionResultRow.cs =================================================================== diff -u -r833e75c2d3d73d3b7c63ab12d44edaa3cbb09bf1 -r341edbfd5905c218dcbaacdc77b68ca67e5424cf --- Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/SectionResultRows/TechnicalInnovationSectionResultRow.cs (.../TechnicalInnovationSectionResultRow.cs) (revision 833e75c2d3d73d3b7c63ab12d44edaa3cbb09bf1) +++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/SectionResultRows/TechnicalInnovationSectionResultRow.cs (.../TechnicalInnovationSectionResultRow.cs) (revision 341edbfd5905c218dcbaacdc77b68ca67e5424cf) @@ -20,9 +20,6 @@ // All rights reserved. using System; -using System.ComponentModel; -using Core.Common.Base.Data; -using Ringtoets.Common.Forms.TypeConverters; using Ringtoets.Common.Forms.Views; using Ringtoets.Common.Primitives; using Ringtoets.Integration.Data.StandAlone.SectionResults; @@ -58,22 +55,6 @@ } } - /// - /// Gets or sets the value of the tailored assessment of safety. - /// - [TypeConverter(typeof(NoValueRoundedDoubleConverter))] - public RoundedDouble AssessmentLayerThree - { - get - { - return SectionResult.AssessmentLayerThree; - } - set - { - SectionResult.AssessmentLayerThree = value.ToPrecision(SectionResult.AssessmentLayerThree.NumberOfDecimalPlaces); - } - } - public override void Update() {} } } \ No newline at end of file Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/SectionResultViews/TechnicalInnovationResultView.cs =================================================================== diff -u -r5785cc13c0454eaabed7ede4dad8e885db7efd50 -r341edbfd5905c218dcbaacdc77b68ca67e5424cf --- Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/SectionResultViews/TechnicalInnovationResultView.cs (.../TechnicalInnovationResultView.cs) (revision 5785cc13c0454eaabed7ede4dad8e885db7efd50) +++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/SectionResultViews/TechnicalInnovationResultView.cs (.../TechnicalInnovationResultView.cs) (revision 341edbfd5905c218dcbaacdc77b68ca67e5424cf) @@ -79,10 +79,6 @@ simpleAssessmentDataSource, nameof(EnumDisplayWrapper.Value), nameof(EnumDisplayWrapper.DisplayName)); - - DataGridViewControl.AddTextBoxColumn( - nameof(TechnicalInnovationSectionResultRow.AssessmentLayerThree), - RingtoetsCommonFormsResources.FailureMechanismResultView_TailorMadeAssessmentResult_DisplayName); } protected override void BindEvents() Index: Ringtoets/Integration/test/Ringtoets.Integration.Data.Test/StandAlone/SectionResults/TechnicalInnovationFailureMechanismSectionResultTest.cs =================================================================== diff -u -r999ba524ca29111b9474209a11b7aeabf233409f -r341edbfd5905c218dcbaacdc77b68ca67e5424cf --- Ringtoets/Integration/test/Ringtoets.Integration.Data.Test/StandAlone/SectionResults/TechnicalInnovationFailureMechanismSectionResultTest.cs (.../TechnicalInnovationFailureMechanismSectionResultTest.cs) (revision 999ba524ca29111b9474209a11b7aeabf233409f) +++ Ringtoets/Integration/test/Ringtoets.Integration.Data.Test/StandAlone/SectionResults/TechnicalInnovationFailureMechanismSectionResultTest.cs (.../TechnicalInnovationFailureMechanismSectionResultTest.cs) (revision 341edbfd5905c218dcbaacdc77b68ca67e5424cf) @@ -19,8 +19,8 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. -using Core.Common.Base.Data; using NUnit.Framework; +using Ringtoets.AssemblyTool.Data; using Ringtoets.Common.Data.FailureMechanism; using Ringtoets.Common.Data.TestUtil; using Ringtoets.Common.Primitives; @@ -44,27 +44,9 @@ Assert.IsInstanceOf(result); Assert.AreSame(section, result.Section); Assert.AreEqual(SimpleAssessmentResultType.None, result.SimpleAssessmentResult); - Assert.IsNaN(result.AssessmentLayerThree); + Assert.AreEqual(TailorMadeAssessmentResultType.None, result.TailorMadeAssessmentResult); + Assert.IsFalse(result.UseManualAssemblyCategoryGroup); + Assert.AreEqual(FailureMechanismSectionAssemblyCategoryGroup.None, result.ManualAssemblyCategoryGroup); } - - [Test] - [TestCase(double.NaN)] - [TestCase(double.PositiveInfinity)] - [TestCase(double.NegativeInfinity)] - [TestCase(5)] - [TestCase(0.5)] - public void AssessmentLayerThree_SetNewValue_ReturnsNewValue(double newValue) - { - // Setup - FailureMechanismSection section = FailureMechanismSectionTestFactory.CreateFailureMechanismSection(); - var failureMechanismSectionResult = new TechnicalInnovationFailureMechanismSectionResult(section); - - // Call - failureMechanismSectionResult.AssessmentLayerThree = (RoundedDouble) newValue; - - // Assert - Assert.AreEqual(newValue, failureMechanismSectionResult.AssessmentLayerThree, - failureMechanismSectionResult.AssessmentLayerThree.GetAccuracy()); - } } } \ No newline at end of file Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/SectionResultRows/TechnicalInnovationSectionResultRowTest.cs =================================================================== diff -u -r833e75c2d3d73d3b7c63ab12d44edaa3cbb09bf1 -r341edbfd5905c218dcbaacdc77b68ca67e5424cf --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/SectionResultRows/TechnicalInnovationSectionResultRowTest.cs (.../TechnicalInnovationSectionResultRowTest.cs) (revision 833e75c2d3d73d3b7c63ab12d44edaa3cbb09bf1) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/SectionResultRows/TechnicalInnovationSectionResultRowTest.cs (.../TechnicalInnovationSectionResultRowTest.cs) (revision 341edbfd5905c218dcbaacdc77b68ca67e5424cf) @@ -51,10 +51,6 @@ // Assert Assert.IsInstanceOf>(row); Assert.AreEqual(result.SimpleAssessmentResult, row.SimpleAssessmentResult); - Assert.AreEqual(result.AssessmentLayerThree, row.AssessmentLayerThree); - - TestHelper.AssertTypeConverter( - nameof(TechnicalInnovationSectionResultRow.AssessmentLayerThree)); } [Test] @@ -82,22 +78,5 @@ Assert.AreEqual(newValue, result.SimpleAssessmentResult); mocks.VerifyAll(); } - - [Test] - public void AssessmentLayerThree_AlwaysOnChange_ResultPropertyChanged() - { - // Setup - var random = new Random(21); - double newValue = random.NextDouble(); - FailureMechanismSection section = FailureMechanismSectionTestFactory.CreateFailureMechanismSection(); - var result = new TechnicalInnovationFailureMechanismSectionResult(section); - var row = new TechnicalInnovationSectionResultRow(result); - - // Call - row.AssessmentLayerThree = (RoundedDouble) newValue; - - // Assert - Assert.AreEqual(newValue, result.AssessmentLayerThree, row.AssessmentLayerThree.GetAccuracy()); - } } } \ No newline at end of file Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/SectionResultViews/TechnicalInnovationResultViewTest.cs =================================================================== diff -u -r44420c717ac32101ba0da4739d259c622f47976e -r341edbfd5905c218dcbaacdc77b68ca67e5424cf --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/SectionResultViews/TechnicalInnovationResultViewTest.cs (.../TechnicalInnovationResultViewTest.cs) (revision 44420c717ac32101ba0da4739d259c622f47976e) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/SectionResultViews/TechnicalInnovationResultViewTest.cs (.../TechnicalInnovationResultViewTest.cs) (revision 341edbfd5905c218dcbaacdc77b68ca67e5424cf) @@ -19,15 +19,8 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. -using System; -using System.Windows.Forms; -using Core.Common.Base; -using Core.Common.TestUtil; -using NUnit.Extensions.Forms; using NUnit.Framework; -using Ringtoets.Common.Data.TestUtil; using Ringtoets.Common.Forms.Views; -using Ringtoets.Common.Primitives; using Ringtoets.Integration.Data.StandAlone; using Ringtoets.Integration.Data.StandAlone.SectionResults; using Ringtoets.Integration.Forms.Views.SectionResultRows; @@ -38,10 +31,6 @@ [TestFixture] public class TechnicalInnovationResultViewTest { - private const int nameColumnIndex = 0; - private const int simpleAssessmentIndex = 1; - private const int assessmentLayerThreeIndex = 2; - [Test] public void Constructor_ExpectedValues() { @@ -58,159 +47,5 @@ Assert.AreSame(failureMechanism, view.FailureMechanism); } } - - [Test] - public void GivenFormWithFailureMechanismResultView_WhenShown_ThenExpectedColumnsAreVisible() - { - // Given - using (var form = new Form()) - using (var view = new TechnicalInnovationResultView(new ObservableList(), - new TechnicalInnovationFailureMechanism())) - { - form.Controls.Add(view); - - // When - form.Show(); - - // Then - var dataGridView = (DataGridView) new ControlTester("dataGridView").TheObject; - - Assert.AreEqual(3, dataGridView.ColumnCount); - - Assert.IsInstanceOf(dataGridView.Columns[simpleAssessmentIndex]); - Assert.IsInstanceOf(dataGridView.Columns[assessmentLayerThreeIndex]); - - Assert.AreEqual("Eenvoudige toets", dataGridView.Columns[simpleAssessmentIndex].HeaderText); - Assert.AreEqual("Toets op maat", dataGridView.Columns[assessmentLayerThreeIndex].HeaderText); - - Assert.AreEqual(DataGridViewAutoSizeColumnsMode.AllCells, dataGridView.AutoSizeColumnsMode); - Assert.AreEqual(DataGridViewContentAlignment.MiddleCenter, dataGridView.ColumnHeadersDefaultCellStyle.Alignment); - } - } - - [Test] - public void FailureMechanismResultView_WithFailureMechanismSectionResultAssigned_SectionsAddedAsRows() - { - // Setup - var random = new Random(21); - var result1 = new TechnicalInnovationFailureMechanismSectionResult( - FailureMechanismSectionTestFactory.CreateFailureMechanismSection("Section 1")) - { - SimpleAssessmentResult = SimpleAssessmentResultType.None, - AssessmentLayerThree = random.NextRoundedDouble() - }; - var result2 = new TechnicalInnovationFailureMechanismSectionResult( - FailureMechanismSectionTestFactory.CreateFailureMechanismSection("Section 2")) - { - SimpleAssessmentResult = SimpleAssessmentResultType.NotApplicable, - AssessmentLayerThree = random.NextRoundedDouble() - }; - var result3 = new TechnicalInnovationFailureMechanismSectionResult( - FailureMechanismSectionTestFactory.CreateFailureMechanismSection("Section 3")) - { - SimpleAssessmentResult = SimpleAssessmentResultType.ProbabilityNegligible, - AssessmentLayerThree = random.NextRoundedDouble() - }; - var result4 = new TechnicalInnovationFailureMechanismSectionResult( - FailureMechanismSectionTestFactory.CreateFailureMechanismSection("Section 4")) - { - SimpleAssessmentResult = SimpleAssessmentResultType.AssessFurther, - AssessmentLayerThree = random.NextRoundedDouble() - }; - var sectionResults = new ObservableList - { - result1, - result2, - result3, - result4 - }; - - // Call - using (var form = new Form()) - using (var view = new TechnicalInnovationResultView(sectionResults, new TechnicalInnovationFailureMechanism())) - { - form.Controls.Add(view); - form.Show(); - - // Assert - var dataGridView = (DataGridView) new ControlTester("dataGridView").TheObject; - - DataGridViewRowCollection rows = dataGridView.Rows; - Assert.AreEqual(4, rows.Count); - - DataGridViewCellCollection cells = rows[0].Cells; - Assert.AreEqual(3, cells.Count); - Assert.AreEqual("Section 1", cells[nameColumnIndex].FormattedValue); - Assert.AreEqual(result1.SimpleAssessmentResult, cells[simpleAssessmentIndex].Value); - Assert.AreEqual(result1.AssessmentLayerThree.ToString(), cells[assessmentLayerThreeIndex].FormattedValue); - - DataGridViewTestHelper.AssertCellIsEnabled(cells[assessmentLayerThreeIndex]); - - cells = rows[1].Cells; - Assert.AreEqual(3, cells.Count); - Assert.AreEqual("Section 2", cells[nameColumnIndex].FormattedValue); - Assert.AreEqual(result2.SimpleAssessmentResult, cells[simpleAssessmentIndex].Value); - Assert.AreEqual(result2.AssessmentLayerThree.ToString(), cells[assessmentLayerThreeIndex].FormattedValue); - - DataGridViewTestHelper.AssertCellIsDisabled(cells[assessmentLayerThreeIndex]); - - cells = rows[2].Cells; - Assert.AreEqual(3, cells.Count); - Assert.AreEqual("Section 3", cells[nameColumnIndex].FormattedValue); - Assert.AreEqual(result3.SimpleAssessmentResult, cells[simpleAssessmentIndex].Value); - Assert.AreEqual(result3.AssessmentLayerThree.ToString(), cells[assessmentLayerThreeIndex].FormattedValue); - - DataGridViewTestHelper.AssertCellIsDisabled(cells[assessmentLayerThreeIndex]); - - cells = rows[3].Cells; - Assert.AreEqual(3, cells.Count); - Assert.AreEqual("Section 4", cells[nameColumnIndex].FormattedValue); - Assert.AreEqual(result4.SimpleAssessmentResult, cells[simpleAssessmentIndex].Value); - Assert.AreEqual(result4.AssessmentLayerThree.ToString(), cells[assessmentLayerThreeIndex].FormattedValue); - - DataGridViewTestHelper.AssertCellIsEnabled(cells[assessmentLayerThreeIndex]); - } - } - - [Test] - [TestCase(SimpleAssessmentResultType.None)] - [TestCase(SimpleAssessmentResultType.AssessFurther)] - public void GivenFormWithFailureMechanismResultView_WhenSectionPassesSimpleAssessmentAndListenersNotified_ThenRowsForSectionDisabled( - SimpleAssessmentResultType simpleAssessmentResult) - { - // Given - var random = new Random(21); - var result = new TechnicalInnovationFailureMechanismSectionResult( - FailureMechanismSectionTestFactory.CreateFailureMechanismSection()) - { - SimpleAssessmentResult = simpleAssessmentResult, - AssessmentLayerThree = random.NextRoundedDouble() - }; - var sectionResults = new ObservableList - { - result - }; - - using (var form = new Form()) - using (var view = new TechnicalInnovationResultView(sectionResults, new TechnicalInnovationFailureMechanism())) - { - form.Controls.Add(view); - form.Show(); - - // When - result.SimpleAssessmentResult = SimpleAssessmentResultType.ProbabilityNegligible; - result.NotifyObservers(); - - // Then - var dataGridView = (DataGridView) new ControlTester("dataGridView").TheObject; - DataGridViewRowCollection rows = dataGridView.Rows; - Assert.AreEqual(1, rows.Count); - - DataGridViewCellCollection cells = rows[0].Cells; - Assert.AreEqual(3, cells.Count); - - DataGridViewTestHelper.AssertCellIsDisabled(cells[assessmentLayerThreeIndex]); - } - } } } \ No newline at end of file