Index: Application/Ringtoets/src/Application.Ringtoets.Storage/Create/StrengthStabilityLengthwise/StrengthStabilityLengthwiseConstructionFailureMechanismSectionResultCreateExtensions.cs =================================================================== diff -u -r3fb0df0ed6e64657154700ee7706e035d5bf99f5 -r802d3cd39b925ac9873ea277588ecd1933e374f6 --- Application/Ringtoets/src/Application.Ringtoets.Storage/Create/StrengthStabilityLengthwise/StrengthStabilityLengthwiseConstructionFailureMechanismSectionResultCreateExtensions.cs (.../StrengthStabilityLengthwiseConstructionFailureMechanismSectionResultCreateExtensions.cs) (revision 3fb0df0ed6e64657154700ee7706e035d5bf99f5) +++ Application/Ringtoets/src/Application.Ringtoets.Storage/Create/StrengthStabilityLengthwise/StrengthStabilityLengthwiseConstructionFailureMechanismSectionResultCreateExtensions.cs (.../StrengthStabilityLengthwiseConstructionFailureMechanismSectionResultCreateExtensions.cs) (revision 802d3cd39b925ac9873ea277588ecd1933e374f6) @@ -40,8 +40,7 @@ { var sectionResultEntity = new StrengthStabilityLengthwiseConstructionSectionResultEntity { - LayerOne = Convert.ToByte(result.AssessmentLayerOne), - LayerThree = result.AssessmentLayerThree.ToNaNAsNull() + LayerOne = Convert.ToByte(result.AssessmentLayerOne) }; return sectionResultEntity; Index: Application/Ringtoets/src/Application.Ringtoets.Storage/Read/StrengthStabilityLengthwiseConstructionSectionResultEntityReadExtensions.cs =================================================================== diff -u -r3fb0df0ed6e64657154700ee7706e035d5bf99f5 -r802d3cd39b925ac9873ea277588ecd1933e374f6 --- Application/Ringtoets/src/Application.Ringtoets.Storage/Read/StrengthStabilityLengthwiseConstructionSectionResultEntityReadExtensions.cs (.../StrengthStabilityLengthwiseConstructionSectionResultEntityReadExtensions.cs) (revision 3fb0df0ed6e64657154700ee7706e035d5bf99f5) +++ Application/Ringtoets/src/Application.Ringtoets.Storage/Read/StrengthStabilityLengthwiseConstructionSectionResultEntityReadExtensions.cs (.../StrengthStabilityLengthwiseConstructionSectionResultEntityReadExtensions.cs) (revision 802d3cd39b925ac9873ea277588ecd1933e374f6) @@ -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/StrengthStabilityLengthwise/StrengthStabilityLengthwiseConstructionFailureMechanismSectionResultCreateExtensionsTest.cs =================================================================== diff -u -rb8df616ca911988b921b933bead5f1ef6862d076 -r802d3cd39b925ac9873ea277588ecd1933e374f6 --- Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/StrengthStabilityLengthwise/StrengthStabilityLengthwiseConstructionFailureMechanismSectionResultCreateExtensionsTest.cs (.../StrengthStabilityLengthwiseConstructionFailureMechanismSectionResultCreateExtensionsTest.cs) (revision b8df616ca911988b921b933bead5f1ef6862d076) +++ Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/StrengthStabilityLengthwise/StrengthStabilityLengthwiseConstructionFailureMechanismSectionResultCreateExtensionsTest.cs (.../StrengthStabilityLengthwiseConstructionFailureMechanismSectionResultCreateExtensionsTest.cs) (revision 802d3cd39b925ac9873ea277588ecd1933e374f6) @@ -23,11 +23,9 @@ using Application.Ringtoets.Storage.Create.StrengthStabilityLengthwise; 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.StrengthStabilityLengthwise @@ -43,33 +41,14 @@ var sectionResult = new StrengthStabilityLengthwiseConstructionFailureMechanismSectionResult(new TestFailureMechanismSection()) { - AssessmentLayerOne = random.NextEnumValue(), - AssessmentLayerThree = random.NextRoundedDouble() + AssessmentLayerOne = random.NextEnumValue() }; // Call StrengthStabilityLengthwiseConstructionSectionResultEntity 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 StrengthStabilityLengthwiseConstructionFailureMechanismSectionResult(new TestFailureMechanismSection()) - { - AssessmentLayerThree = RoundedDouble.NaN - }; - - // Call - StrengthStabilityLengthwiseConstructionSectionResultEntity 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 -r80e09f002643af4dbacc7e99574ce0c784c7e873 -r802d3cd39b925ac9873ea277588ecd1933e374f6 --- Application/Ringtoets/test/Application.Ringtoets.Storage.Test/IntegrationTests/StorageSqLiteIntegrationTest.cs (.../StorageSqLiteIntegrationTest.cs) (revision 80e09f002643af4dbacc7e99574ce0c784c7e873) +++ Application/Ringtoets/test/Application.Ringtoets.Storage.Test/IntegrationTests/StorageSqLiteIntegrationTest.cs (.../StorageSqLiteIntegrationTest.cs) (revision 802d3cd39b925ac9873ea277588ecd1933e374f6) @@ -369,11 +369,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( @@ -417,10 +413,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/StrengthStabilityLengthwiseConstructionSectionResultEntityReadExtensionsTest.cs =================================================================== diff -u -rb8df616ca911988b921b933bead5f1ef6862d076 -r802d3cd39b925ac9873ea277588ecd1933e374f6 --- Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Read/StrengthStabilityLengthwiseConstructionSectionResultEntityReadExtensionsTest.cs (.../StrengthStabilityLengthwiseConstructionSectionResultEntityReadExtensionsTest.cs) (revision b8df616ca911988b921b933bead5f1ef6862d076) +++ Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Read/StrengthStabilityLengthwiseConstructionSectionResultEntityReadExtensionsTest.cs (.../StrengthStabilityLengthwiseConstructionSectionResultEntityReadExtensionsTest.cs) (revision 802d3cd39b925ac9873ea277588ecd1933e374f6) @@ -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 StrengthStabilityLengthwiseConstructionSectionResultEntity - { - LayerThree = null, - LayerOne = Convert.ToByte(layerOne), - FailureMechanismSectionEntity = failureMechanismSectionEntity - }; - var sectionResult = new StrengthStabilityLengthwiseConstructionFailureMechanismSectionResult(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 -r80e09f002643af4dbacc7e99574ce0c784c7e873 -r802d3cd39b925ac9873ea277588ecd1933e374f6 --- Application/Ringtoets/test/Application.Ringtoets.Storage.TestUtil/RingtoetsProjectTestHelper.cs (.../RingtoetsProjectTestHelper.cs) (revision 80e09f002643af4dbacc7e99574ce0c784c7e873) +++ Application/Ringtoets/test/Application.Ringtoets.Storage.TestUtil/RingtoetsProjectTestHelper.cs (.../RingtoetsProjectTestHelper.cs) (revision 802d3cd39b925ac9873ea277588ecd1933e374f6) @@ -196,11 +196,9 @@ private static void SetSectionResults(IEnumerable sectionResults) { - var random = new Random(21); foreach (StrengthStabilityLengthwiseConstructionFailureMechanismSectionResult sectionResult in sectionResults) { sectionResult.AssessmentLayerOne = GetAssessmentLayerOneState(); - sectionResult.AssessmentLayerThree = (RoundedDouble) random.NextDouble(); } } Index: Ringtoets/Integration/src/Ringtoets.Integration.Data/StandAlone/SectionResults/StrengthStabilityLengthwiseConstructionFailureMechanismSectionResult.cs =================================================================== diff -u -rd3404f1930061f9fbf321c7ddb7f8a9e6fff4bc1 -r802d3cd39b925ac9873ea277588ecd1933e374f6 --- Ringtoets/Integration/src/Ringtoets.Integration.Data/StandAlone/SectionResults/StrengthStabilityLengthwiseConstructionFailureMechanismSectionResult.cs (.../StrengthStabilityLengthwiseConstructionFailureMechanismSectionResult.cs) (revision d3404f1930061f9fbf321c7ddb7f8a9e6fff4bc1) +++ Ringtoets/Integration/src/Ringtoets.Integration.Data/StandAlone/SectionResults/StrengthStabilityLengthwiseConstructionFailureMechanismSectionResult.cs (.../StrengthStabilityLengthwiseConstructionFailureMechanismSectionResult.cs) (revision 802d3cd39b925ac9873ea277588ecd1933e374f6) @@ -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; @@ -38,7 +38,8 @@ public StrengthStabilityLengthwiseConstructionFailureMechanismSectionResult(FailureMechanismSection section) : base(section) { SimpleAssessmentResult = SimpleAssessmentResultType.None; - AssessmentLayerThree = RoundedDouble.NaN; + TailorMadeAssessmentResult = TailorMadeAssessmentResultType.None; + ManualAssemblyCategoryGroup = FailureMechanismSectionAssemblyCategoryGroup.None; } /// @@ -47,8 +48,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/StrengthStabilityLengthwiseConstructionSectionResultRow.cs =================================================================== diff -u -r833e75c2d3d73d3b7c63ab12d44edaa3cbb09bf1 -r802d3cd39b925ac9873ea277588ecd1933e374f6 --- Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/SectionResultRows/StrengthStabilityLengthwiseConstructionSectionResultRow.cs (.../StrengthStabilityLengthwiseConstructionSectionResultRow.cs) (revision 833e75c2d3d73d3b7c63ab12d44edaa3cbb09bf1) +++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/SectionResultRows/StrengthStabilityLengthwiseConstructionSectionResultRow.cs (.../StrengthStabilityLengthwiseConstructionSectionResultRow.cs) (revision 802d3cd39b925ac9873ea277588ecd1933e374f6) @@ -60,22 +60,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/StrengthStabilityLengthwiseConstructionResultView.cs =================================================================== diff -u -r5785cc13c0454eaabed7ede4dad8e885db7efd50 -r802d3cd39b925ac9873ea277588ecd1933e374f6 --- Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/SectionResultViews/StrengthStabilityLengthwiseConstructionResultView.cs (.../StrengthStabilityLengthwiseConstructionResultView.cs) (revision 5785cc13c0454eaabed7ede4dad8e885db7efd50) +++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/SectionResultViews/StrengthStabilityLengthwiseConstructionResultView.cs (.../StrengthStabilityLengthwiseConstructionResultView.cs) (revision 802d3cd39b925ac9873ea277588ecd1933e374f6) @@ -80,10 +80,6 @@ simpleAssessmentDataSource, nameof(EnumDisplayWrapper.Value), nameof(EnumDisplayWrapper.DisplayName)); - - DataGridViewControl.AddTextBoxColumn( - nameof(StrengthStabilityLengthwiseConstructionSectionResultRow.AssessmentLayerThree), - RingtoetsCommonFormsResources.FailureMechanismResultView_TailorMadeAssessmentResult_DisplayName); } protected override void BindEvents() Index: Ringtoets/Integration/test/Ringtoets.Integration.Data.Test/StandAlone/SectionResults/StrengthStabilityLengthwiseConstructionFailureMechanismSectionResultTest.cs =================================================================== diff -u -r999ba524ca29111b9474209a11b7aeabf233409f -r802d3cd39b925ac9873ea277588ecd1933e374f6 --- Ringtoets/Integration/test/Ringtoets.Integration.Data.Test/StandAlone/SectionResults/StrengthStabilityLengthwiseConstructionFailureMechanismSectionResultTest.cs (.../StrengthStabilityLengthwiseConstructionFailureMechanismSectionResultTest.cs) (revision 999ba524ca29111b9474209a11b7aeabf233409f) +++ Ringtoets/Integration/test/Ringtoets.Integration.Data.Test/StandAlone/SectionResults/StrengthStabilityLengthwiseConstructionFailureMechanismSectionResultTest.cs (.../StrengthStabilityLengthwiseConstructionFailureMechanismSectionResultTest.cs) (revision 802d3cd39b925ac9873ea277588ecd1933e374f6) @@ -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 StrengthStabilityLengthwiseConstructionFailureMechanismSectionResult(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/StrengthStabilityLengthwiseConstructionSectionResultRowTest.cs =================================================================== diff -u -r833e75c2d3d73d3b7c63ab12d44edaa3cbb09bf1 -r802d3cd39b925ac9873ea277588ecd1933e374f6 --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/SectionResultRows/StrengthStabilityLengthwiseConstructionSectionResultRowTest.cs (.../StrengthStabilityLengthwiseConstructionSectionResultRowTest.cs) (revision 833e75c2d3d73d3b7c63ab12d44edaa3cbb09bf1) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/SectionResultRows/StrengthStabilityLengthwiseConstructionSectionResultRowTest.cs (.../StrengthStabilityLengthwiseConstructionSectionResultRowTest.cs) (revision 802d3cd39b925ac9873ea277588ecd1933e374f6) @@ -19,17 +19,10 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. -using System; -using Core.Common.Base; -using Core.Common.Base.Data; -using Core.Common.TestUtil; using NUnit.Framework; -using Rhino.Mocks; using Ringtoets.Common.Data.FailureMechanism; using Ringtoets.Common.Data.TestUtil; -using Ringtoets.Common.Forms.TypeConverters; using Ringtoets.Common.Forms.Views; -using Ringtoets.Common.Primitives; using Ringtoets.Integration.Data.StandAlone.SectionResults; using Ringtoets.Integration.Forms.Views.SectionResultRows; @@ -51,53 +44,6 @@ // Assert Assert.IsInstanceOf>(row); Assert.AreEqual(result.SimpleAssessmentResult, row.SimpleAssessmentResult); - Assert.AreEqual(result.AssessmentLayerThree, row.AssessmentLayerThree); - - TestHelper.AssertTypeConverter( - nameof(StrengthStabilityLengthwiseConstructionSectionResultRow.AssessmentLayerThree)); } - - [Test] - public void SimpleAssessmentResult_SetNewValue_NotifyObserversAndPropertyChanged() - { - // Setup - var mocks = new MockRepository(); - var observer = mocks.StrictMock(); - observer.Expect(o => o.UpdateObserver()); - mocks.ReplayAll(); - - var random = new Random(39); - var newValue = random.NextEnumValue(); - - FailureMechanismSection section = FailureMechanismSectionTestFactory.CreateFailureMechanismSection(); - var result = new StrengthStabilityLengthwiseConstructionFailureMechanismSectionResult(section); - result.Attach(observer); - - var row = new StrengthStabilityLengthwiseConstructionSectionResultRow(result); - - // Call - row.SimpleAssessmentResult = newValue; - - // Assert - 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 StrengthStabilityLengthwiseConstructionFailureMechanismSectionResult(section); - var row = new StrengthStabilityLengthwiseConstructionSectionResultRow(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/StrengthStabilityLengthwiseConstructionResultViewTest.cs =================================================================== diff -u -r44420c717ac32101ba0da4739d259c622f47976e -r802d3cd39b925ac9873ea277588ecd1933e374f6 --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/SectionResultViews/StrengthStabilityLengthwiseConstructionResultViewTest.cs (.../StrengthStabilityLengthwiseConstructionResultViewTest.cs) (revision 44420c717ac32101ba0da4739d259c622f47976e) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/SectionResultViews/StrengthStabilityLengthwiseConstructionResultViewTest.cs (.../StrengthStabilityLengthwiseConstructionResultViewTest.cs) (revision 802d3cd39b925ac9873ea277588ecd1933e374f6) @@ -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; @@ -58,159 +51,5 @@ Assert.AreSame(failureMechanism, view.FailureMechanism); } } - - [Test] - public void GivenFormWithFailureMechanismResultView_ThenExpectedColumnsAreVisible() - { - // Given - using (var form = new Form()) - using (var view = new StrengthStabilityLengthwiseConstructionResultView( - new ObservableList(), - new StrengthStabilityLengthwiseConstructionFailureMechanism())) - { - form.Controls.Add(view); - 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 StrengthStabilityLengthwiseConstructionFailureMechanismSectionResult( - FailureMechanismSectionTestFactory.CreateFailureMechanismSection("Section 1")) - { - SimpleAssessmentResult = SimpleAssessmentResultType.None, - AssessmentLayerThree = random.NextRoundedDouble() - }; - var result2 = new StrengthStabilityLengthwiseConstructionFailureMechanismSectionResult( - FailureMechanismSectionTestFactory.CreateFailureMechanismSection("Section 2")) - { - SimpleAssessmentResult = SimpleAssessmentResultType.NotApplicable, - AssessmentLayerThree = random.NextRoundedDouble() - }; - var result3 = new StrengthStabilityLengthwiseConstructionFailureMechanismSectionResult( - FailureMechanismSectionTestFactory.CreateFailureMechanismSection("Section 3")) - { - SimpleAssessmentResult = SimpleAssessmentResultType.ProbabilityNegligible, - AssessmentLayerThree = random.NextRoundedDouble() - }; - var result4 = new StrengthStabilityLengthwiseConstructionFailureMechanismSectionResult( - 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 StrengthStabilityLengthwiseConstructionResultView(sectionResults, - new StrengthStabilityLengthwiseConstructionFailureMechanism())) - { - 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 StrengthStabilityLengthwiseConstructionFailureMechanismSectionResult( - FailureMechanismSectionTestFactory.CreateFailureMechanismSection()) - { - SimpleAssessmentResult = simpleAssessmentResult, - AssessmentLayerThree = random.NextRoundedDouble() - }; - var sectionResults = new ObservableList - { - result - }; - - using (var form = new Form()) - using (var view = new StrengthStabilityLengthwiseConstructionResultView(sectionResults, - new StrengthStabilityLengthwiseConstructionFailureMechanism())) - { - 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