Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/SectionResultRows/MacroStabilityOutwardsSectionResultRow.cs
===================================================================
diff -u -r7d14097d7c501d82bb46724e3dc92872771f036e -r874ea87b2507771b5618b14ecf64dedd84b2418d
--- Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/SectionResultRows/MacroStabilityOutwardsSectionResultRow.cs (.../MacroStabilityOutwardsSectionResultRow.cs) (revision 7d14097d7c501d82bb46724e3dc92872771f036e)
+++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/SectionResultRows/MacroStabilityOutwardsSectionResultRow.cs (.../MacroStabilityOutwardsSectionResultRow.cs) (revision 874ea87b2507771b5618b14ecf64dedd84b2418d)
@@ -213,5 +213,37 @@
assessmentSection).Group;
}
}
+
+ ///
+ /// Gets or sets the indicator whether the combined assembly should be overwritten by .
+ ///
+ public bool UseManualAssemblyCategoryGroup
+ {
+ get
+ {
+ return SectionResult.UseManualAssemblyCategoryGroup;
+ }
+ set
+ {
+ SectionResult.UseManualAssemblyCategoryGroup = value;
+ SectionResult.NotifyObservers();
+ }
+ }
+
+ ///
+ /// Gets or sets the manually selected assembly category group.
+ ///
+ public FailureMechanismSectionAssemblyCategoryGroup ManualAssemblyCategoryGroup
+ {
+ get
+ {
+ return SectionResult.ManualAssemblyCategoryGroup;
+ }
+ set
+ {
+ SectionResult.ManualAssemblyCategoryGroup = value;
+ SectionResult.NotifyObservers();
+ }
+ }
}
}
\ No newline at end of file
Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/SectionResultRows/MacroStabilityOutwardsSectionResultRowTest.cs
===================================================================
diff -u -r7d14097d7c501d82bb46724e3dc92872771f036e -r874ea87b2507771b5618b14ecf64dedd84b2418d
--- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/SectionResultRows/MacroStabilityOutwardsSectionResultRowTest.cs (.../MacroStabilityOutwardsSectionResultRowTest.cs) (revision 7d14097d7c501d82bb46724e3dc92872771f036e)
+++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/SectionResultRows/MacroStabilityOutwardsSectionResultRowTest.cs (.../MacroStabilityOutwardsSectionResultRowTest.cs) (revision 874ea87b2507771b5618b14ecf64dedd84b2418d)
@@ -100,6 +100,8 @@
Assert.AreEqual(result.DetailedAssessmentProbability, row.DetailedAssessmentProbability);
Assert.AreEqual(result.TailorMadeAssessmentResult, row.TailorMadeAssessmentResult);
Assert.AreEqual(result.TailorMadeAssessmentProbability, row.TailorMadeAssessmentProbability);
+ Assert.AreEqual(result.UseManualAssemblyCategoryGroup, row.UseManualAssemblyCategoryGroup);
+ Assert.AreEqual(result.ManualAssemblyCategoryGroup, row.ManualAssemblyCategoryGroup);
TestHelper.AssertTypeConverter(
@@ -109,6 +111,60 @@
nameof(MacroStabilityOutwardsSectionResultRow.TailorMadeAssessmentProbability));
}
+ [Test]
+ public void UseManualAssemblyCategoryGroup_SetNewValue_NotifyObserversAndPropertyChanged()
+ {
+ // Setup
+ var mocks = new MockRepository();
+ var assessmentSection = mocks.Stub();
+ var observer = mocks.StrictMock();
+ observer.Expect(o => o.UpdateObserver());
+ mocks.ReplayAll();
+
+ FailureMechanismSection section = FailureMechanismSectionTestFactory.CreateFailureMechanismSection();
+ var result = new MacroStabilityOutwardsFailureMechanismSectionResult(section);
+ result.Attach(observer);
+
+ var row = new MacroStabilityOutwardsSectionResultRow(result, new MacroStabilityOutwardsFailureMechanism(), assessmentSection);
+
+ // Precondition
+ Assert.IsFalse(result.UseManualAssemblyCategoryGroup);
+
+ // Call
+ row.UseManualAssemblyCategoryGroup = true;
+
+ // Assert
+ Assert.IsTrue(result.UseManualAssemblyCategoryGroup);
+ mocks.VerifyAll();
+ }
+
+ [Test]
+ public void ManualAssemblyCategoryGroup_SetNewValue_NotifyObserversAndPropertyChanged()
+ {
+ // Setup
+ var mocks = new MockRepository();
+ var assessmentSection = mocks.Stub();
+ 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 MacroStabilityOutwardsFailureMechanismSectionResult(section);
+ result.Attach(observer);
+
+ var row = new MacroStabilityOutwardsSectionResultRow(result, new MacroStabilityOutwardsFailureMechanism(), assessmentSection);
+
+ // Call
+ row.ManualAssemblyCategoryGroup = newValue;
+
+ // Assert
+ Assert.AreEqual(newValue, result.ManualAssemblyCategoryGroup);
+ mocks.VerifyAll();
+ }
+
#region Registration
[Test]
@@ -516,7 +572,7 @@
// Setup
var failureMechanism = new MacroStabilityOutwardsFailureMechanism();
- var mocks = new MockRepository();
+ var mocks = new MockRepository();
IAssessmentSection assessmentSection = AssessmentSectionHelper.CreateAssessmentSectionStub(failureMechanism, mocks);
mocks.ReplayAll();