Index: Riskeer/ClosingStructures/src/Riskeer.ClosingStructures.Forms/PresentationObjects/ClosingStructuresScenariosContext.cs
===================================================================
diff -u -r767fd4c880443be2882b7510b290bd690c938fdc -r4336ebfcb998270d0f93585f9099e76c909cbc6d
--- Riskeer/ClosingStructures/src/Riskeer.ClosingStructures.Forms/PresentationObjects/ClosingStructuresScenariosContext.cs (.../ClosingStructuresScenariosContext.cs) (revision 767fd4c880443be2882b7510b290bd690c938fdc)
+++ Riskeer/ClosingStructures/src/Riskeer.ClosingStructures.Forms/PresentationObjects/ClosingStructuresScenariosContext.cs (.../ClosingStructuresScenariosContext.cs) (revision 4336ebfcb998270d0f93585f9099e76c909cbc6d)
@@ -22,7 +22,6 @@
using System;
using Core.Common.Controls.PresentationObjects;
using Riskeer.ClosingStructures.Data;
-using Riskeer.Common.Data.AssessmentSection;
using Riskeer.Common.Data.Calculation;
namespace Riskeer.ClosingStructures.Forms.PresentationObjects
@@ -38,33 +37,21 @@
///
/// The wrapped .
/// A forming the context.
- /// The the belongs to.
/// Thrown when any parameter is null.
- public ClosingStructuresScenariosContext(CalculationGroup wrappedData, ClosingStructuresFailureMechanism failureMechanism, IAssessmentSection assessmentSection)
+ public ClosingStructuresScenariosContext(CalculationGroup wrappedData, ClosingStructuresFailureMechanism 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 ClosingStructuresFailureMechanism ParentFailureMechanism { get; }
-
- ///
- /// Gets the of the calculation group.
- ///
- public IAssessmentSection AssessmentSection { get; }
}
}
\ No newline at end of file
Index: Riskeer/ClosingStructures/src/Riskeer.ClosingStructures.Plugin/ClosingStructuresPlugin.cs
===================================================================
diff -u -r6a7910cf149043f416b7a271ef7fc970832e7a97 -r4336ebfcb998270d0f93585f9099e76c909cbc6d
--- Riskeer/ClosingStructures/src/Riskeer.ClosingStructures.Plugin/ClosingStructuresPlugin.cs (.../ClosingStructuresPlugin.cs) (revision 6a7910cf149043f416b7a271ef7fc970832e7a97)
+++ Riskeer/ClosingStructures/src/Riskeer.ClosingStructures.Plugin/ClosingStructuresPlugin.cs (.../ClosingStructuresPlugin.cs) (revision 4336ebfcb998270d0f93585f9099e76c909cbc6d)
@@ -457,7 +457,7 @@
return new object[]
{
new FailureMechanismAssemblyCategoriesContext(failureMechanism, assessmentSection, () => failureMechanism.GeneralInput.N),
- new ClosingStructuresScenariosContext(failureMechanism.CalculationsGroup, failureMechanism, assessmentSection),
+ new ClosingStructuresScenariosContext(failureMechanism.CalculationsGroup, failureMechanism),
new ProbabilityFailureMechanismSectionResultContext(
failureMechanism.SectionResults, failureMechanism, assessmentSection),
failureMechanism.OutputComments
Index: Riskeer/ClosingStructures/test/Riskeer.ClosingStructures.Forms.Test/PresentationObjects/ClosingStructuresScenariosContextTest.cs
===================================================================
diff -u -r767fd4c880443be2882b7510b290bd690c938fdc -r4336ebfcb998270d0f93585f9099e76c909cbc6d
--- Riskeer/ClosingStructures/test/Riskeer.ClosingStructures.Forms.Test/PresentationObjects/ClosingStructuresScenariosContextTest.cs (.../ClosingStructuresScenariosContextTest.cs) (revision 767fd4c880443be2882b7510b290bd690c938fdc)
+++ Riskeer/ClosingStructures/test/Riskeer.ClosingStructures.Forms.Test/PresentationObjects/ClosingStructuresScenariosContextTest.cs (.../ClosingStructuresScenariosContextTest.cs) (revision 4336ebfcb998270d0f93585f9099e76c909cbc6d)
@@ -22,10 +22,8 @@
using System;
using Core.Common.Controls.PresentationObjects;
using NUnit.Framework;
-using Rhino.Mocks;
using Riskeer.ClosingStructures.Data;
using Riskeer.ClosingStructures.Forms.PresentationObjects;
-using Riskeer.Common.Data.AssessmentSection;
using Riskeer.Common.Data.Calculation;
namespace Riskeer.ClosingStructures.Forms.Test.PresentationObjects
@@ -37,26 +35,21 @@
public void Constructor_FailureMechanismNull_ThrowArgumentNullException()
{
// Setup
- var mocks = new MockRepository();
- var assessmentSection = mocks.Stub();
- mocks.ReplayAll();
-
var calculationGroup = new CalculationGroup();
// Call
- void Call() => new ClosingStructuresScenariosContext(calculationGroup, null, assessmentSection);
+ void Call() => new ClosingStructuresScenariosContext(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 ClosingStructuresScenariosContext(new CalculationGroup(), new ClosingStructuresFailureMechanism(), null);
+ void Call() => new ClosingStructuresScenariosContext(new CalculationGroup(), new ClosingStructuresFailureMechanism());
// Assert
var exception = Assert.Throws(Call);
@@ -67,22 +60,16 @@
public void Constructor_ExpectedValues()
{
// Setup
- var mocks = new MockRepository();
- var assessmentSection = mocks.Stub();
- mocks.ReplayAll();
-
var calculationGroup = new CalculationGroup();
var failureMechanism = new ClosingStructuresFailureMechanism();
// Call
- var context = new ClosingStructuresScenariosContext(calculationGroup, failureMechanism, assessmentSection);
+ var context = new ClosingStructuresScenariosContext(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/ClosingStructures/test/Riskeer.ClosingStructures.Plugin.Test/ViewInfos/ClosingStructuresScenariosViewInfoTest.cs
===================================================================
diff -u -r6a7910cf149043f416b7a271ef7fc970832e7a97 -r4336ebfcb998270d0f93585f9099e76c909cbc6d
--- Riskeer/ClosingStructures/test/Riskeer.ClosingStructures.Plugin.Test/ViewInfos/ClosingStructuresScenariosViewInfoTest.cs (.../ClosingStructuresScenariosViewInfoTest.cs) (revision 6a7910cf149043f416b7a271ef7fc970832e7a97)
+++ Riskeer/ClosingStructures/test/Riskeer.ClosingStructures.Plugin.Test/ViewInfos/ClosingStructuresScenariosViewInfoTest.cs (.../ClosingStructuresScenariosViewInfoTest.cs) (revision 4336ebfcb998270d0f93585f9099e76c909cbc6d)
@@ -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 ClosingStructuresFailureMechanism();
- var context = new ClosingStructuresScenariosContext(calculationGroup, failureMechanism, assessmentSection);
+ var context = new ClosingStructuresScenariosContext(calculationGroup, failureMechanism);
// Call
object viewData = info.GetViewData(context);
// Assert
Assert.AreSame(calculationGroup, viewData);
- mocks.VerifyAll();
}
[Test]
@@ -232,12 +227,8 @@
public void CreateInstance_WithContext_ReturnsClosingStructuresScenariosView()
{
// Setup
- var mocks = new MockRepository();
- var assessmentSection = mocks.Stub();
- mocks.ReplayAll();
-
var group = new CalculationGroup();
- var context = new ClosingStructuresScenariosContext(group, new ClosingStructuresFailureMechanism(), assessmentSection);
+ var context = new ClosingStructuresScenariosContext(group, new ClosingStructuresFailureMechanism());
// 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