Index: Riskeer/HeightStructures/src/Riskeer.HeightStructures.Forms/PresentationObjects/HeightStructuresScenariosContext.cs
===================================================================
diff -u -r35349144a21f4e3627505605840f286b21b2d004 -r54af7d44eb955fbef43211dd642a4a7264d68db1
--- Riskeer/HeightStructures/src/Riskeer.HeightStructures.Forms/PresentationObjects/HeightStructuresScenariosContext.cs (.../HeightStructuresScenariosContext.cs) (revision 35349144a21f4e3627505605840f286b21b2d004)
+++ Riskeer/HeightStructures/src/Riskeer.HeightStructures.Forms/PresentationObjects/HeightStructuresScenariosContext.cs (.../HeightStructuresScenariosContext.cs) (revision 54af7d44eb955fbef43211dd642a4a7264d68db1)
@@ -21,7 +21,6 @@
using System;
using Core.Common.Controls.PresentationObjects;
-using Riskeer.Common.Data.AssessmentSection;
using Riskeer.Common.Data.Calculation;
using Riskeer.HeightStructures.Data;
@@ -38,34 +37,21 @@
///
/// The wrapped .
/// A forming the context.
- /// The the belongs to.
/// Thrown when any parameter is null.
- public HeightStructuresScenariosContext(CalculationGroup wrappedData, HeightStructuresFailureMechanism failureMechanism,
- IAssessmentSection assessmentSection)
+ public HeightStructuresScenariosContext(CalculationGroup wrappedData, HeightStructuresFailureMechanism failureMechanism)
: base(wrappedData)
{
if (failureMechanism == null)
{
throw new ArgumentNullException(nameof(failureMechanism));
}
- if (assessmentSection == null)
- {
- throw new ArgumentNullException(nameof(assessmentSection));
- }
-
ParentFailureMechanism = failureMechanism;
- AssessmentSection = assessmentSection;
}
///
/// The parent failure mechanism of the calculation group.
///
public HeightStructuresFailureMechanism ParentFailureMechanism { get; }
-
- ///
- /// Gets the of the calculation group.
- ///
- public IAssessmentSection AssessmentSection { get; }
}
}
\ No newline at end of file
Index: Riskeer/HeightStructures/src/Riskeer.HeightStructures.Plugin/HeightStructuresPlugin.cs
===================================================================
diff -u -r3209fba2fd7c48ba59e92a99c83799e3deeb24ad -r54af7d44eb955fbef43211dd642a4a7264d68db1
--- Riskeer/HeightStructures/src/Riskeer.HeightStructures.Plugin/HeightStructuresPlugin.cs (.../HeightStructuresPlugin.cs) (revision 3209fba2fd7c48ba59e92a99c83799e3deeb24ad)
+++ Riskeer/HeightStructures/src/Riskeer.HeightStructures.Plugin/HeightStructuresPlugin.cs (.../HeightStructuresPlugin.cs) (revision 54af7d44eb955fbef43211dd642a4a7264d68db1)
@@ -463,7 +463,7 @@
return new object[]
{
new FailureMechanismAssemblyCategoriesContext(failureMechanism, assessmentSection, () => failureMechanism.GeneralInput.N),
- new HeightStructuresScenariosContext(failureMechanism.CalculationsGroup, failureMechanism, assessmentSection),
+ new HeightStructuresScenariosContext(failureMechanism.CalculationsGroup, failureMechanism),
new ProbabilityFailureMechanismSectionResultContext(
failureMechanism.SectionResults, failureMechanism, assessmentSection),
failureMechanism.OutputComments
Index: Riskeer/HeightStructures/test/Riskeer.HeightStructures.Forms.Test/PresentationObjects/HeightStructuresScenariosContextTest.cs
===================================================================
diff -u -r35349144a21f4e3627505605840f286b21b2d004 -r54af7d44eb955fbef43211dd642a4a7264d68db1
--- Riskeer/HeightStructures/test/Riskeer.HeightStructures.Forms.Test/PresentationObjects/HeightStructuresScenariosContextTest.cs (.../HeightStructuresScenariosContextTest.cs) (revision 35349144a21f4e3627505605840f286b21b2d004)
+++ Riskeer/HeightStructures/test/Riskeer.HeightStructures.Forms.Test/PresentationObjects/HeightStructuresScenariosContextTest.cs (.../HeightStructuresScenariosContextTest.cs) (revision 54af7d44eb955fbef43211dd642a4a7264d68db1)
@@ -22,8 +22,6 @@
using System;
using Core.Common.Controls.PresentationObjects;
using NUnit.Framework;
-using Rhino.Mocks;
-using Riskeer.Common.Data.AssessmentSection;
using Riskeer.Common.Data.Calculation;
using Riskeer.HeightStructures.Data;
using Riskeer.HeightStructures.Forms.PresentationObjects;
@@ -37,52 +35,30 @@
public void Constructor_FailureMechanismNull_ThrowArgumentNullException()
{
// Setup
- var mocks = new MockRepository();
- var assessmentSection = mocks.Stub();
- mocks.ReplayAll();
-
var calculationGroup = new CalculationGroup();
// Call
- void Call() => new HeightStructuresScenariosContext(calculationGroup, null, assessmentSection);
+ void Call() => new HeightStructuresScenariosContext(calculationGroup, null);
// Assert
var exception = Assert.Throws(Call);
Assert.AreEqual("failureMechanism", exception.ParamName);
- mocks.VerifyAll();
}
[Test]
- public void Constructor_AssessmentSectionNull_ThrowsArgumentNullException()
- {
- // Call
- void Call() => new HeightStructuresScenariosContext(new CalculationGroup(), new HeightStructuresFailureMechanism(), null);
-
- // Assert
- var exception = Assert.Throws(Call);
- Assert.AreEqual("assessmentSection", exception.ParamName);
- }
-
- [Test]
public void Constructor_ExpectedValues()
{
// Setup
- var mocks = new MockRepository();
- var assessmentSection = mocks.Stub();
- mocks.ReplayAll();
-
var calculationGroup = new CalculationGroup();
var failureMechanism = new HeightStructuresFailureMechanism();
// Call
- var context = new HeightStructuresScenariosContext(calculationGroup, failureMechanism, assessmentSection);
+ var context = new HeightStructuresScenariosContext(calculationGroup, failureMechanism);
// Assert
Assert.IsInstanceOf>(context);
Assert.AreSame(calculationGroup, context.WrappedData);
Assert.AreSame(failureMechanism, context.ParentFailureMechanism);
- Assert.AreSame(assessmentSection, context.AssessmentSection);
- mocks.VerifyAll();
}
}
}
\ No newline at end of file
Index: Riskeer/HeightStructures/test/Riskeer.HeightStructures.Plugin.Test/ViewInfos/HeightStructuresScenariosViewInfoTest.cs
===================================================================
diff -u -r3209fba2fd7c48ba59e92a99c83799e3deeb24ad -r54af7d44eb955fbef43211dd642a4a7264d68db1
--- Riskeer/HeightStructures/test/Riskeer.HeightStructures.Plugin.Test/ViewInfos/HeightStructuresScenariosViewInfoTest.cs (.../HeightStructuresScenariosViewInfoTest.cs) (revision 3209fba2fd7c48ba59e92a99c83799e3deeb24ad)
+++ Riskeer/HeightStructures/test/Riskeer.HeightStructures.Plugin.Test/ViewInfos/HeightStructuresScenariosViewInfoTest.cs (.../HeightStructuresScenariosViewInfoTest.cs) (revision 54af7d44eb955fbef43211dd642a4a7264d68db1)
@@ -77,20 +77,15 @@
public void GetViewData_Always_ReturnWrappedData()
{
// Setup
- var mocks = new MockRepository();
- var assessmentSection = mocks.Stub();
- mocks.ReplayAll();
-
var calculationGroup = new CalculationGroup();
var failureMechanism = new HeightStructuresFailureMechanism();
- var context = new HeightStructuresScenariosContext(calculationGroup, failureMechanism, assessmentSection);
+ var context = new HeightStructuresScenariosContext(calculationGroup, failureMechanism);
// Call
object viewData = info.GetViewData(context);
// Assert
Assert.AreSame(calculationGroup, viewData);
- mocks.VerifyAll();
}
[Test]
@@ -232,12 +227,8 @@
public void CreateInstance_WithContext_ReturnsHeightStructuresScenariosView()
{
// Setup
- var mocks = new MockRepository();
- var assessmentSection = mocks.Stub();
- mocks.ReplayAll();
-
var group = new CalculationGroup();
- var context = new HeightStructuresScenariosContext(group, new HeightStructuresFailureMechanism(), assessmentSection);
+ var context = new HeightStructuresScenariosContext(group, new HeightStructuresFailureMechanism());
// Call
using (IView view = info.CreateInstance(context))
@@ -246,8 +237,6 @@
Assert.IsInstanceOf(view);
Assert.AreSame(group, view.Data);
}
-
- mocks.VerifyAll();
}
}
}
\ No newline at end of file