Index: Application/Ringtoets/src/Application.Ringtoets.Storage/Create/GrassCoverSlipOffInwards/GrassCoverSlipOffInwardsFailureMechanismSectionResultCreateExtensions.cs =================================================================== diff -u -r3fb0df0ed6e64657154700ee7706e035d5bf99f5 -r590e1aeba4a1e5a622c8e8d89270167907920b43 --- Application/Ringtoets/src/Application.Ringtoets.Storage/Create/GrassCoverSlipOffInwards/GrassCoverSlipOffInwardsFailureMechanismSectionResultCreateExtensions.cs (.../GrassCoverSlipOffInwardsFailureMechanismSectionResultCreateExtensions.cs) (revision 3fb0df0ed6e64657154700ee7706e035d5bf99f5) +++ Application/Ringtoets/src/Application.Ringtoets.Storage/Create/GrassCoverSlipOffInwards/GrassCoverSlipOffInwardsFailureMechanismSectionResultCreateExtensions.cs (.../GrassCoverSlipOffInwardsFailureMechanismSectionResultCreateExtensions.cs) (revision 590e1aeba4a1e5a622c8e8d89270167907920b43) @@ -40,9 +40,7 @@ { var sectionResultEntity = new GrassCoverSlipOffInwardsSectionResultEntity { - LayerOne = Convert.ToByte(result.AssessmentLayerOne), - LayerTwoA = Convert.ToByte(result.AssessmentLayerTwoA), - LayerThree = result.AssessmentLayerThree.ToNaNAsNull() + LayerOne = Convert.ToByte(result.AssessmentLayerOne) }; return sectionResultEntity; Index: Application/Ringtoets/src/Application.Ringtoets.Storage/Read/GrassCoverSlipOffInwardsSectionResultEntityReadExtensions.cs =================================================================== diff -u -r3fb0df0ed6e64657154700ee7706e035d5bf99f5 -r590e1aeba4a1e5a622c8e8d89270167907920b43 --- Application/Ringtoets/src/Application.Ringtoets.Storage/Read/GrassCoverSlipOffInwardsSectionResultEntityReadExtensions.cs (.../GrassCoverSlipOffInwardsSectionResultEntityReadExtensions.cs) (revision 3fb0df0ed6e64657154700ee7706e035d5bf99f5) +++ Application/Ringtoets/src/Application.Ringtoets.Storage/Read/GrassCoverSlipOffInwardsSectionResultEntityReadExtensions.cs (.../GrassCoverSlipOffInwardsSectionResultEntityReadExtensions.cs) (revision 590e1aeba4a1e5a622c8e8d89270167907920b43) @@ -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; @@ -49,8 +48,6 @@ } sectionResult.AssessmentLayerOne = (AssessmentLayerOneState) entity.LayerOne; - sectionResult.AssessmentLayerTwoA = (AssessmentLayerTwoAResult) entity.LayerTwoA; - sectionResult.AssessmentLayerThree = (RoundedDouble) entity.LayerThree.ToNullAsNaN(); } } } \ No newline at end of file Index: Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/GrassCoverSlipOffInwards/GrassCoverSlipOffInwardsFailureMechanismSectionResultCreateExtensionsTest.cs =================================================================== diff -u -rb8df616ca911988b921b933bead5f1ef6862d076 -r590e1aeba4a1e5a622c8e8d89270167907920b43 --- Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/GrassCoverSlipOffInwards/GrassCoverSlipOffInwardsFailureMechanismSectionResultCreateExtensionsTest.cs (.../GrassCoverSlipOffInwardsFailureMechanismSectionResultCreateExtensionsTest.cs) (revision b8df616ca911988b921b933bead5f1ef6862d076) +++ Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/GrassCoverSlipOffInwards/GrassCoverSlipOffInwardsFailureMechanismSectionResultCreateExtensionsTest.cs (.../GrassCoverSlipOffInwardsFailureMechanismSectionResultCreateExtensionsTest.cs) (revision 590e1aeba4a1e5a622c8e8d89270167907920b43) @@ -23,11 +23,9 @@ using Application.Ringtoets.Storage.Create.GrassCoverSlipOffInwards; 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.GrassCoverSlipOffInwards @@ -43,35 +41,14 @@ var sectionResult = new GrassCoverSlipOffInwardsFailureMechanismSectionResult(new TestFailureMechanismSection()) { - AssessmentLayerOne = random.NextEnumValue(), - AssessmentLayerTwoA = random.NextEnumValue(), - AssessmentLayerThree = random.NextRoundedDouble() + AssessmentLayerOne = random.NextEnumValue() }; // Call GrassCoverSlipOffInwardsSectionResultEntity result = sectionResult.Create(); // Assert Assert.AreEqual(Convert.ToByte(sectionResult.AssessmentLayerOne), result.LayerOne); - Assert.AreEqual(Convert.ToByte(sectionResult.AssessmentLayerTwoA), result.LayerTwoA); - Assert.AreEqual(sectionResult.AssessmentLayerThree, result.LayerThree, - sectionResult.AssessmentLayerThree.GetAccuracy()); } - - [Test] - public void Create_WithNaNLevel3Result_ReturnsEntityWithExpectedResults() - { - // Setup - var sectionResult = new GrassCoverSlipOffInwardsFailureMechanismSectionResult(new TestFailureMechanismSection()) - { - AssessmentLayerThree = RoundedDouble.NaN - }; - - // Call - GrassCoverSlipOffInwardsSectionResultEntity 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 -r4503f687155622bb1b19155d27f8e3f9a5842fb0 -r590e1aeba4a1e5a622c8e8d89270167907920b43 --- Application/Ringtoets/test/Application.Ringtoets.Storage.Test/IntegrationTests/StorageSqLiteIntegrationTest.cs (.../StorageSqLiteIntegrationTest.cs) (revision 4503f687155622bb1b19155d27f8e3f9a5842fb0) +++ Application/Ringtoets/test/Application.Ringtoets.Storage.Test/IntegrationTests/StorageSqLiteIntegrationTest.cs (.../StorageSqLiteIntegrationTest.cs) (revision 590e1aeba4a1e5a622c8e8d89270167907920b43) @@ -408,12 +408,7 @@ { AssertCollectionAndItems(expectedSectionResults, actualSectionResults, - (expectedItem, actualItem) => - { - Assert.AreEqual(expectedItem.AssessmentLayerOne, actualItem.AssessmentLayerOne); - Assert.AreEqual(expectedItem.AssessmentLayerTwoA, actualItem.AssessmentLayerTwoA); - Assert.AreEqual(expectedItem.AssessmentLayerThree, actualItem.AssessmentLayerThree); - }); + (expectedItem, actualItem) => { Assert.AreEqual(expectedItem.AssessmentLayerOne, actualItem.AssessmentLayerOne); }); } private static void AssertFailureMechanismSectionResults( @@ -1010,10 +1005,7 @@ { AssertCollectionAndItems(expectedSectionResults, actualSectionResults, - (expectedItem, actualItem) => - { - Assert.AreEqual(expectedItem.AssessmentLayerOne, actualItem.AssessmentLayerOne); - }); + (expectedItem, actualItem) => { Assert.AreEqual(expectedItem.AssessmentLayerOne, actualItem.AssessmentLayerOne); }); } private static void AssertDuneLocations(IEnumerable expectedDuneLocations, Index: Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Read/GrassCoverSlipOffInwardsSectionResultEntityReadExtensionsTest.cs =================================================================== diff -u -rb8df616ca911988b921b933bead5f1ef6862d076 -r590e1aeba4a1e5a622c8e8d89270167907920b43 --- Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Read/GrassCoverSlipOffInwardsSectionResultEntityReadExtensionsTest.cs (.../GrassCoverSlipOffInwardsSectionResultEntityReadExtensionsTest.cs) (revision b8df616ca911988b921b933bead5f1ef6862d076) +++ Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Read/GrassCoverSlipOffInwardsSectionResultEntityReadExtensionsTest.cs (.../GrassCoverSlipOffInwardsSectionResultEntityReadExtensionsTest.cs) (revision 590e1aeba4a1e5a622c8e8d89270167907920b43) @@ -74,38 +74,6 @@ // Assert Assert.AreEqual(layerOne, sectionResult.AssessmentLayerOne); - Assert.AreEqual(layerTwoA, sectionResult.AssessmentLayerTwoA); - Assert.AreEqual(layerThree, sectionResult.AssessmentLayerThree, 1e-6); } - - [Test] - public void Read_EntityWithNullValues_SectionResultWithNaNValues() - { - // Setup - var random = new Random(21); - var layerOne = random.NextEnumValue(); - var layerTwoA = random.NextEnumValue(); - - var collector = new ReadConversionCollector(); - - var failureMechanismSectionEntity = new FailureMechanismSectionEntity(); - collector.Read(failureMechanismSectionEntity, new TestFailureMechanismSection()); - var entity = new GrassCoverSlipOffInwardsSectionResultEntity - { - LayerThree = null, - LayerTwoA = Convert.ToByte(layerTwoA), - LayerOne = Convert.ToByte(layerOne), - FailureMechanismSectionEntity = failureMechanismSectionEntity - }; - var sectionResult = new GrassCoverSlipOffInwardsFailureMechanismSectionResult(new TestFailureMechanismSection()); - - // Call - entity.Read(sectionResult); - - // Assert - Assert.AreEqual(layerOne, sectionResult.AssessmentLayerOne); - Assert.AreEqual(layerTwoA, sectionResult.AssessmentLayerTwoA); - Assert.IsNaN(sectionResult.AssessmentLayerThree); - } } } \ No newline at end of file Index: Application/Ringtoets/test/Application.Ringtoets.Storage.TestUtil/RingtoetsProjectTestHelper.cs =================================================================== diff -u -r86f580b7c6ed931520be4a4001278ca5aa66adff -r590e1aeba4a1e5a622c8e8d89270167907920b43 --- Application/Ringtoets/test/Application.Ringtoets.Storage.TestUtil/RingtoetsProjectTestHelper.cs (.../RingtoetsProjectTestHelper.cs) (revision 86f580b7c6ed931520be4a4001278ca5aa66adff) +++ Application/Ringtoets/test/Application.Ringtoets.Storage.TestUtil/RingtoetsProjectTestHelper.cs (.../RingtoetsProjectTestHelper.cs) (revision 590e1aeba4a1e5a622c8e8d89270167907920b43) @@ -237,12 +237,9 @@ private static void SetSectionResults(IEnumerable sectionResults) { - var random = new Random(21); foreach (GrassCoverSlipOffInwardsFailureMechanismSectionResult sectionResult in sectionResults) { sectionResult.AssessmentLayerOne = GetAssessmentLayerOneState(); - sectionResult.AssessmentLayerTwoA = GetAssessmentLayerTwoAResult(); - sectionResult.AssessmentLayerThree = (RoundedDouble) random.NextDouble(); } } Index: Ringtoets/Integration/src/Ringtoets.Integration.Data/StandAlone/SectionResults/GrassCoverSlipOffInwardsFailureMechanismSectionResult.cs =================================================================== diff -u -r19311fc87ea75a0407d8cdc617cc90b8c160429c -r590e1aeba4a1e5a622c8e8d89270167907920b43 --- Ringtoets/Integration/src/Ringtoets.Integration.Data/StandAlone/SectionResults/GrassCoverSlipOffInwardsFailureMechanismSectionResult.cs (.../GrassCoverSlipOffInwardsFailureMechanismSectionResult.cs) (revision 19311fc87ea75a0407d8cdc617cc90b8c160429c) +++ Ringtoets/Integration/src/Ringtoets.Integration.Data/StandAlone/SectionResults/GrassCoverSlipOffInwardsFailureMechanismSectionResult.cs (.../GrassCoverSlipOffInwardsFailureMechanismSectionResult.cs) (revision 590e1aeba4a1e5a622c8e8d89270167907920b43) @@ -20,7 +20,7 @@ // All rights reserved. using System; -using Core.Common.Base.Data; +using Ringtoets.AssemblyTool.Data; using Ringtoets.Common.Data.FailureMechanism; using Ringtoets.Common.Primitives; @@ -41,8 +41,9 @@ public GrassCoverSlipOffInwardsFailureMechanismSectionResult(FailureMechanismSection section) : base(section) { SimpleAssessmentResult = SimpleAssessmentResultType.None; - AssessmentLayerTwoA = AssessmentLayerTwoAResult.NotCalculated; - AssessmentLayerThree = RoundedDouble.NaN; + DetailedAssessmentResult = DetailedAssessmentResultType.None; + TailorMadeAssessmentResult = TailorMadeAssessmentResultType.None; + ManualAssemblyCategoryGroup = FailureMechanismSectionAssemblyCategoryGroup.None; } /// @@ -51,14 +52,23 @@ public SimpleAssessmentResultType SimpleAssessmentResult { get; set; } /// - /// Gets or sets the value of the detailed assessment of safety per failure mechanism section, for which - /// the result is a value of . + /// Gets or sets the detailed assessment result. /// - public AssessmentLayerTwoAResult AssessmentLayerTwoA { get; set; } + public DetailedAssessmentResultType DetailedAssessmentResult { 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/GrassCoverSlipOffInwardsSectionResultRow.cs =================================================================== diff -u -r833e75c2d3d73d3b7c63ab12d44edaa3cbb09bf1 -r590e1aeba4a1e5a622c8e8d89270167907920b43 --- Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/SectionResultRows/GrassCoverSlipOffInwardsSectionResultRow.cs (.../GrassCoverSlipOffInwardsSectionResultRow.cs) (revision 833e75c2d3d73d3b7c63ab12d44edaa3cbb09bf1) +++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/SectionResultRows/GrassCoverSlipOffInwardsSectionResultRow.cs (.../GrassCoverSlipOffInwardsSectionResultRow.cs) (revision 590e1aeba4a1e5a622c8e8d89270167907920b43) @@ -59,37 +59,6 @@ } } - /// - /// Gets the assessment layer two a of the . - /// - public AssessmentLayerTwoAResult AssessmentLayerTwoA - { - get - { - return SectionResult.AssessmentLayerTwoA; - } - set - { - SectionResult.AssessmentLayerTwoA = value; - } - } - - /// - /// 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/GrassCoverSlipOffInwardsResultView.cs =================================================================== diff -u -r5785cc13c0454eaabed7ede4dad8e885db7efd50 -r590e1aeba4a1e5a622c8e8d89270167907920b43 --- Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/SectionResultViews/GrassCoverSlipOffInwardsResultView.cs (.../GrassCoverSlipOffInwardsResultView.cs) (revision 5785cc13c0454eaabed7ede4dad8e885db7efd50) +++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/SectionResultViews/GrassCoverSlipOffInwardsResultView.cs (.../GrassCoverSlipOffInwardsResultView.cs) (revision 590e1aeba4a1e5a622c8e8d89270167907920b43) @@ -24,7 +24,6 @@ using System.Windows.Forms; using Core.Common.Base; using Core.Common.Util; -using Ringtoets.Common.Data.FailureMechanism; using Ringtoets.Common.Forms.Helpers; using Ringtoets.Common.Forms.Views; using Ringtoets.Common.Primitives; @@ -81,22 +80,6 @@ simpleAssessmentDataSource, nameof(EnumDisplayWrapper.Value), nameof(EnumDisplayWrapper.DisplayName)); - - EnumDisplayWrapper[] twoAResultDataSource = - Enum.GetValues(typeof(AssessmentLayerTwoAResult)) - .OfType() - .Select(el => new EnumDisplayWrapper(el)) - .ToArray(); - - DataGridViewControl.AddComboBoxColumn( - nameof(GrassCoverSlipOffInwardsSectionResultRow.AssessmentLayerTwoA), - RingtoetsCommonFormsResources.FailureMechanismResultView_DetailedAssessmentResult_DisplayName, - twoAResultDataSource, - nameof(EnumDisplayWrapper.Value), - nameof(EnumDisplayWrapper.DisplayName)); - DataGridViewControl.AddTextBoxColumn( - nameof(GrassCoverSlipOffInwardsSectionResultRow.AssessmentLayerThree), - RingtoetsCommonFormsResources.FailureMechanismResultView_TailorMadeAssessmentResult_DisplayName); } protected override void BindEvents() Index: Ringtoets/Integration/test/Ringtoets.Integration.Data.Test/StandAlone/SectionResults/GrassCoverSlipOffInwardsFailureMechanismSectionResultTest.cs =================================================================== diff -u -r999ba524ca29111b9474209a11b7aeabf233409f -r590e1aeba4a1e5a622c8e8d89270167907920b43 --- Ringtoets/Integration/test/Ringtoets.Integration.Data.Test/StandAlone/SectionResults/GrassCoverSlipOffInwardsFailureMechanismSectionResultTest.cs (.../GrassCoverSlipOffInwardsFailureMechanismSectionResultTest.cs) (revision 999ba524ca29111b9474209a11b7aeabf233409f) +++ Ringtoets/Integration/test/Ringtoets.Integration.Data.Test/StandAlone/SectionResults/GrassCoverSlipOffInwardsFailureMechanismSectionResultTest.cs (.../GrassCoverSlipOffInwardsFailureMechanismSectionResultTest.cs) (revision 590e1aeba4a1e5a622c8e8d89270167907920b43) @@ -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,29 +44,10 @@ Assert.IsInstanceOf(result); Assert.AreSame(section, result.Section); Assert.AreEqual(SimpleAssessmentResultType.None, result.SimpleAssessmentResult); - Assert.AreEqual(AssessmentLayerTwoAResult.NotCalculated, result.AssessmentLayerTwoA); - Assert.IsNaN(result.AssessmentLayerThree); + Assert.AreEqual(DetailedAssessmentResultType.None, result.DetailedAssessmentResult); + 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 GrassCoverSlipOffInwardsFailureMechanismSectionResult(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/GrassCoverSlipOffInwardsSectionResultRowTest.cs =================================================================== diff -u -r833e75c2d3d73d3b7c63ab12d44edaa3cbb09bf1 -r590e1aeba4a1e5a622c8e8d89270167907920b43 --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/SectionResultRows/GrassCoverSlipOffInwardsSectionResultRowTest.cs (.../GrassCoverSlipOffInwardsSectionResultRowTest.cs) (revision 833e75c2d3d73d3b7c63ab12d44edaa3cbb09bf1) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/SectionResultRows/GrassCoverSlipOffInwardsSectionResultRowTest.cs (.../GrassCoverSlipOffInwardsSectionResultRowTest.cs) (revision 590e1aeba4a1e5a622c8e8d89270167907920b43) @@ -52,11 +52,6 @@ Assert.IsInstanceOf>(row); Assert.AreEqual(result.SimpleAssessmentResult, row.SimpleAssessmentResult); - Assert.AreEqual(result.AssessmentLayerTwoA, row.AssessmentLayerTwoA); - Assert.AreEqual(result.AssessmentLayerThree, row.AssessmentLayerThree); - - TestHelper.AssertTypeConverter( - nameof(GrassCoverSlipOffInwardsSectionResultRow.AssessmentLayerThree)); } [Test] @@ -84,38 +79,5 @@ Assert.AreEqual(newValue, result.SimpleAssessmentResult); mocks.VerifyAll(); } - - [Test] - public void AssessmentLayerTwoA_AlwaysOnChange_ResultPropertyChanged() - { - // Setup - const AssessmentLayerTwoAResult newValue = AssessmentLayerTwoAResult.Successful; - FailureMechanismSection section = FailureMechanismSectionTestFactory.CreateFailureMechanismSection(); - var result = new GrassCoverSlipOffInwardsFailureMechanismSectionResult(section); - var row = new GrassCoverSlipOffInwardsSectionResultRow(result); - - // Call - row.AssessmentLayerTwoA = newValue; - - // Assert - Assert.AreEqual(newValue, result.AssessmentLayerTwoA); - } - - [Test] - public void AssessmentLayerThree_AlwaysOnChange_ResultPropertyChanged() - { - // Setup - var random = new Random(21); - double newValue = random.NextDouble(); - FailureMechanismSection section = FailureMechanismSectionTestFactory.CreateFailureMechanismSection(); - var result = new GrassCoverSlipOffInwardsFailureMechanismSectionResult(section); - var row = new GrassCoverSlipOffInwardsSectionResultRow(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/GrassCoverSlipOffInwardsResultViewTest.cs =================================================================== diff -u -rade3657cb21871c58056daedc9deaf1da8594ec3 -r590e1aeba4a1e5a622c8e8d89270167907920b43 --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/SectionResultViews/GrassCoverSlipOffInwardsResultViewTest.cs (.../GrassCoverSlipOffInwardsResultViewTest.cs) (revision ade3657cb21871c58056daedc9deaf1da8594ec3) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/SectionResultViews/GrassCoverSlipOffInwardsResultViewTest.cs (.../GrassCoverSlipOffInwardsResultViewTest.cs) (revision 590e1aeba4a1e5a622c8e8d89270167907920b43) @@ -19,17 +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 Rhino.Mocks; -using Ringtoets.Common.Data.FailureMechanism; -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; @@ -61,175 +52,5 @@ Assert.AreSame(failureMechanism, view.FailureMechanism); } } - - [Test] - public void GivenFormWithFailureMechanismResultView_WhenShown_ThenExpectedColumnsAreVisible() - { - // Given - var failureMechanism = new GrassCoverSlipOffInwardsFailureMechanism(); - using (var form = new Form()) - using (var view = new GrassCoverSlipOffInwardsResultView(failureMechanism.SectionResults, failureMechanism)) - { - form.Controls.Add(view); - - // When - form.Show(); - - // Then - var dataGridView = (DataGridView) new ControlTester("dataGridView").TheObject; - - Assert.AreEqual(4, dataGridView.ColumnCount); - - Assert.IsInstanceOf(dataGridView.Columns[simpleAssessmentIndex]); - Assert.IsInstanceOf(dataGridView.Columns[assessmentLayerTwoAIndex]); - Assert.IsInstanceOf(dataGridView.Columns[assessmentLayerThreeIndex]); - - Assert.AreEqual("Eenvoudige toets", dataGridView.Columns[simpleAssessmentIndex].HeaderText); - Assert.AreEqual("Gedetailleerde toets per vak", dataGridView.Columns[assessmentLayerTwoAIndex].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 GrassCoverSlipOffInwardsFailureMechanismSectionResult( - FailureMechanismSectionTestFactory.CreateFailureMechanismSection("Section 1")) - { - SimpleAssessmentResult = SimpleAssessmentResultType.None, - AssessmentLayerTwoA = AssessmentLayerTwoAResult.Failed, - AssessmentLayerThree = random.NextRoundedDouble() - }; - var result2 = new GrassCoverSlipOffInwardsFailureMechanismSectionResult( - FailureMechanismSectionTestFactory.CreateFailureMechanismSection("Section 2")) - { - SimpleAssessmentResult = SimpleAssessmentResultType.NotApplicable, - AssessmentLayerTwoA = AssessmentLayerTwoAResult.Successful, - AssessmentLayerThree = random.NextRoundedDouble() - }; - var result3 = new GrassCoverSlipOffInwardsFailureMechanismSectionResult( - FailureMechanismSectionTestFactory.CreateFailureMechanismSection("Section 3")) - { - SimpleAssessmentResult = SimpleAssessmentResultType.ProbabilityNegligible, - AssessmentLayerTwoA = AssessmentLayerTwoAResult.Successful, - AssessmentLayerThree = random.NextRoundedDouble() - }; - var result4 = new GrassCoverSlipOffInwardsFailureMechanismSectionResult( - FailureMechanismSectionTestFactory.CreateFailureMechanismSection("Section 4")) - { - SimpleAssessmentResult = SimpleAssessmentResultType.AssessFurther, - AssessmentLayerTwoA = AssessmentLayerTwoAResult.Successful, - AssessmentLayerThree = random.NextRoundedDouble() - }; - var sectionResults = new ObservableList - { - result1, - result2, - result3, - result4 - }; - - // Call - using (var form = new Form()) - using (var view = new GrassCoverSlipOffInwardsResultView(sectionResults, new GrassCoverSlipOffInwardsFailureMechanism())) - { - 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(4, cells.Count); - Assert.AreEqual("Section 1", cells[nameColumnIndex].FormattedValue); - Assert.AreEqual(result1.SimpleAssessmentResult, cells[simpleAssessmentIndex].Value); - Assert.AreEqual(result1.AssessmentLayerTwoA, cells[assessmentLayerTwoAIndex].Value); - Assert.AreEqual(result1.AssessmentLayerThree.ToString(), cells[assessmentLayerThreeIndex].FormattedValue); - - DataGridViewTestHelper.AssertCellIsEnabled(cells[assessmentLayerTwoAIndex]); - DataGridViewTestHelper.AssertCellIsEnabled(cells[assessmentLayerThreeIndex]); - - cells = rows[1].Cells; - Assert.AreEqual(4, cells.Count); - Assert.AreEqual("Section 2", cells[nameColumnIndex].FormattedValue); - Assert.AreEqual(result2.SimpleAssessmentResult, cells[simpleAssessmentIndex].Value); - Assert.AreEqual(result2.AssessmentLayerTwoA, cells[assessmentLayerTwoAIndex].Value); - Assert.AreEqual(result2.AssessmentLayerThree.ToString(), cells[assessmentLayerThreeIndex].FormattedValue); - - DataGridViewTestHelper.AssertCellIsDisabled(cells[assessmentLayerTwoAIndex]); - DataGridViewTestHelper.AssertCellIsDisabled(cells[assessmentLayerThreeIndex]); - - cells = rows[2].Cells; - Assert.AreEqual(4, cells.Count); - Assert.AreEqual("Section 3", cells[nameColumnIndex].FormattedValue); - Assert.AreEqual(result3.SimpleAssessmentResult, cells[simpleAssessmentIndex].Value); - Assert.AreEqual(result3.AssessmentLayerTwoA, cells[assessmentLayerTwoAIndex].Value); - Assert.AreEqual(result3.AssessmentLayerThree.ToString(), cells[assessmentLayerThreeIndex].FormattedValue); - - DataGridViewTestHelper.AssertCellIsDisabled(cells[assessmentLayerTwoAIndex]); - DataGridViewTestHelper.AssertCellIsDisabled(cells[assessmentLayerThreeIndex]); - - cells = rows[3].Cells; - Assert.AreEqual(4, cells.Count); - Assert.AreEqual("Section 4", cells[nameColumnIndex].FormattedValue); - Assert.AreEqual(result4.SimpleAssessmentResult, cells[simpleAssessmentIndex].Value); - Assert.AreEqual(result4.AssessmentLayerTwoA, cells[assessmentLayerTwoAIndex].Value); - Assert.AreEqual(result4.AssessmentLayerThree.ToString(), cells[assessmentLayerThreeIndex].FormattedValue); - - DataGridViewTestHelper.AssertCellIsEnabled(cells[assessmentLayerTwoAIndex]); - 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 GrassCoverSlipOffInwardsFailureMechanismSectionResult( - FailureMechanismSectionTestFactory.CreateFailureMechanismSection()) - { - SimpleAssessmentResult = simpleAssessmentResult, - AssessmentLayerTwoA = AssessmentLayerTwoAResult.Failed, - AssessmentLayerThree = random.NextRoundedDouble() - }; - var sectionResults = new ObservableList - { - result - }; - - using (var form = new Form()) - using (var view = new GrassCoverSlipOffInwardsResultView(sectionResults, new GrassCoverSlipOffInwardsFailureMechanism())) - { - 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(4, cells.Count); - - DataGridViewTestHelper.AssertCellIsDisabled(cells[assessmentLayerTwoAIndex]); - DataGridViewTestHelper.AssertCellIsDisabled(cells[assessmentLayerThreeIndex]); - } - } } } \ No newline at end of file