Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/SectionResultRows/MacroStabilityOutwardsSectionResultRow.cs
===================================================================
diff -u -r60bd6e76d31e06ec9c3f70e2193d90cd3ea7c3b5 -r7d14097d7c501d82bb46724e3dc92872771f036e
--- Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/SectionResultRows/MacroStabilityOutwardsSectionResultRow.cs (.../MacroStabilityOutwardsSectionResultRow.cs) (revision 60bd6e76d31e06ec9c3f70e2193d90cd3ea7c3b5)
+++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/SectionResultRows/MacroStabilityOutwardsSectionResultRow.cs (.../MacroStabilityOutwardsSectionResultRow.cs) (revision 7d14097d7c501d82bb46724e3dc92872771f036e)
@@ -197,5 +197,21 @@
assessmentSection).Group;
}
}
+
+ ///
+ /// Gets the combined assembly category group.
+ ///
+ /// Thrown when the
+ /// could not be created.
+ public FailureMechanismSectionAssemblyCategoryGroup CombinedAssemblyCategoryGroup
+ {
+ get
+ {
+ return MacroStabilityOutwardsFailureMechanismSectionResultAssemblyFactory.AssembleCombinedAssembly(
+ SectionResult,
+ failureMechanism,
+ assessmentSection).Group;
+ }
+ }
}
}
\ No newline at end of file
Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/SectionResultRows/MacroStabilityOutwardsSectionResultRowTest.cs
===================================================================
diff -u -r60bd6e76d31e06ec9c3f70e2193d90cd3ea7c3b5 -r7d14097d7c501d82bb46724e3dc92872771f036e
--- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/SectionResultRows/MacroStabilityOutwardsSectionResultRowTest.cs (.../MacroStabilityOutwardsSectionResultRowTest.cs) (revision 60bd6e76d31e06ec9c3f70e2193d90cd3ea7c3b5)
+++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/SectionResultRows/MacroStabilityOutwardsSectionResultRowTest.cs (.../MacroStabilityOutwardsSectionResultRowTest.cs) (revision 7d14097d7c501d82bb46724e3dc92872771f036e)
@@ -367,8 +367,9 @@
public void DetailedAssemblyCategoryGroup_AssemblyRan_ReturnCategoryGroup()
{
// Setup
- var mocks = new MockRepository();
var failureMechanism = new MacroStabilityOutwardsFailureMechanism();
+
+ var mocks = new MockRepository();
IAssessmentSection assessmentSection = AssessmentSectionHelper.CreateAssessmentSectionStub(failureMechanism, mocks);
mocks.ReplayAll();
@@ -395,8 +396,9 @@
public void DetailedAssemblyCategoryGroup_AssemblyThrowsException_ThrowsAssemblyException()
{
// Setup
- var mocks = new MockRepository();
var failureMechanism = new MacroStabilityOutwardsFailureMechanism();
+
+ var mocks = new MockRepository();
IAssessmentSection assessmentSection = AssessmentSectionHelper.CreateAssessmentSectionStub(failureMechanism, mocks);
mocks.ReplayAll();
@@ -424,8 +426,9 @@
public void TailorMadeAssemblyCategoryGroup_AssemblyRan_ReturnCategoryGroup()
{
// Setup
- var mocks = new MockRepository();
var failureMechanism = new MacroStabilityOutwardsFailureMechanism();
+
+ var mocks = new MockRepository();
IAssessmentSection assessmentSection = AssessmentSectionHelper.CreateAssessmentSectionStub(failureMechanism, mocks);
mocks.ReplayAll();
@@ -452,8 +455,9 @@
public void TailorMadeAssemblyCategoryGroup_AssemblyThrowsException_ThrowsAssemblyException()
{
// Setup
- var mocks = new MockRepository();
var failureMechanism = new MacroStabilityOutwardsFailureMechanism();
+
+ var mocks = new MockRepository();
IAssessmentSection assessmentSection = AssessmentSectionHelper.CreateAssessmentSectionStub(failureMechanism, mocks);
mocks.ReplayAll();
@@ -477,6 +481,65 @@
}
}
+ [Test]
+ public void CombinedAssemblyCategoryGroup_AssemblyRan_ReturnCategoryGroup()
+ {
+ // Setup
+ var failureMechanism = new MacroStabilityOutwardsFailureMechanism();
+
+ var mocks = new MockRepository();
+ IAssessmentSection assessmentSection = AssessmentSectionHelper.CreateAssessmentSectionStub(failureMechanism, mocks);
+ mocks.ReplayAll();
+
+ FailureMechanismSection section = FailureMechanismSectionTestFactory.CreateFailureMechanismSection();
+ var result = new MacroStabilityOutwardsFailureMechanismSectionResult(section);
+ var row = new MacroStabilityOutwardsSectionResultRow(result, failureMechanism, assessmentSection);
+
+ using (new AssemblyToolCalculatorFactoryConfig())
+ {
+ var calculatorfactory = (TestAssemblyToolCalculatorFactory) AssemblyToolCalculatorFactory.Instance;
+ FailureMechanismSectionAssemblyCalculatorStub calculator = calculatorfactory.LastCreatedFailureMechanismSectionAssemblyCalculator;
+
+ // Call
+ FailureMechanismSectionAssemblyCategoryGroup combinedAssemblyCategoryGroup = row.CombinedAssemblyCategoryGroup;
+
+ // Assert
+ FailureMechanismSectionAssembly calculatorOutput = calculator.CombinedAssemblyOutput;
+ Assert.AreEqual(calculatorOutput.Group, combinedAssemblyCategoryGroup);
+ mocks.VerifyAll();
+ }
+ }
+
+ [Test]
+ public void CombinedAssemblyCategoryGroup_AssemblyThrowsException_ThrowsAssemblyException()
+ {
+ // Setup
+ var failureMechanism = new MacroStabilityOutwardsFailureMechanism();
+
+ var mocks = new MockRepository();
+ IAssessmentSection assessmentSection = AssessmentSectionHelper.CreateAssessmentSectionStub(failureMechanism, mocks);
+ mocks.ReplayAll();
+
+ FailureMechanismSection section = FailureMechanismSectionTestFactory.CreateFailureMechanismSection();
+ var result = new MacroStabilityOutwardsFailureMechanismSectionResult(section);
+ var row = new MacroStabilityOutwardsSectionResultRow(result, failureMechanism, assessmentSection);
+
+ using (new AssemblyToolCalculatorFactoryConfig())
+ {
+ var calculatorfactory = (TestAssemblyToolCalculatorFactory) AssemblyToolCalculatorFactory.Instance;
+ FailureMechanismSectionAssemblyCalculatorStub calculator = calculatorfactory.LastCreatedFailureMechanismSectionAssemblyCalculator;
+ calculator.ThrowExceptionOnCalculate = true;
+
+ // Call
+ FailureMechanismSectionAssemblyCategoryGroup combinedAssemblyCategoryGroup;
+ TestDelegate test = () => combinedAssemblyCategoryGroup = row.CombinedAssemblyCategoryGroup;
+
+ // Assert
+ Assert.Throws(test);
+ mocks.VerifyAll();
+ }
+ }
+
#endregion
}
}
\ No newline at end of file