Index: Ringtoets/StabilityStoneCover/test/Ringtoets.StabilityStoneCover.Forms.Test/Views/StabilityStoneCoverSectionResultRowTest.cs =================================================================== diff -u -rbb25d0712db8bbcf0eacdfd4d6fd5e05282a89c7 -r0ff8623e873996b62996e6504278592342feae4f --- Ringtoets/StabilityStoneCover/test/Ringtoets.StabilityStoneCover.Forms.Test/Views/StabilityStoneCoverSectionResultRowTest.cs (.../StabilityStoneCoverSectionResultRowTest.cs) (revision bb25d0712db8bbcf0eacdfd4d6fd5e05282a89c7) +++ Ringtoets/StabilityStoneCover/test/Ringtoets.StabilityStoneCover.Forms.Test/Views/StabilityStoneCoverSectionResultRowTest.cs (.../StabilityStoneCoverSectionResultRowTest.cs) (revision 0ff8623e873996b62996e6504278592342feae4f) @@ -64,6 +64,9 @@ Assert.AreEqual(result.DetailedAssessmentResultForFactorizedLowerLimitNorm, row.DetailedAssessmentResultForFactorizedLowerLimitNorm); Assert.AreEqual(SelectableFailureMechanismSectionAssemblyCategoryGroupConverter.ConvertTo(result.TailorMadeAssessmentResult), row.TailorMadeAssessmentResult); + Assert.AreEqual(result.UseManualAssemblyCategoryGroup, row.UseManualAssemblyCategoryGroup); + Assert.AreEqual(SelectableFailureMechanismSectionAssemblyCategoryGroupConverter.ConvertTo(result.ManualAssemblyCategoryGroup), + row.ManualAssemblyCategoryGroup); } } @@ -101,6 +104,67 @@ } } + [Test] + public void UseManualAssemblyCategoryGroup_SetNewValue_NotifyObserversAndPropertyChanged() + { + // Setup + var mocks = new MockRepository(); + var observer = mocks.StrictMock(); + observer.Expect(o => o.UpdateObserver()); + mocks.ReplayAll(); + + FailureMechanismSection section = FailureMechanismSectionTestFactory.CreateFailureMechanismSection(); + var result = new StabilityStoneCoverFailureMechanismSectionResult(section); + result.Attach(observer); + + bool newValue = !result.UseManualAssemblyCategoryGroup; + + using (new AssemblyToolCalculatorFactoryConfig()) + { + var row = new StabilityStoneCoverSectionResultRow(result); + + // Precondition + Assert.IsFalse(result.UseManualAssemblyCategoryGroup); + + // Call + row.UseManualAssemblyCategoryGroup = newValue; + + // Assert + Assert.AreEqual(newValue, result.UseManualAssemblyCategoryGroup); + mocks.VerifyAll(); + } + } + + [Test] + public void ManualAssemblyCategoryGroup_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 StabilityStoneCoverFailureMechanismSectionResult(section); + result.Attach(observer); + + using (new AssemblyToolCalculatorFactoryConfig()) + { + var row = new StabilityStoneCoverSectionResultRow(result); + + // Call + row.ManualAssemblyCategoryGroup = newValue; + + // Assert + FailureMechanismSectionAssemblyCategoryGroup expectedCategoryGroup = SelectableFailureMechanismSectionAssemblyCategoryGroupConverter.ConvertFrom(newValue); + Assert.AreEqual(expectedCategoryGroup, result.ManualAssemblyCategoryGroup); + mocks.VerifyAll(); + } + } + #region Registration [Test]