Index: Riskeer/StabilityPointStructures/src/Riskeer.StabilityPointStructures.Forms/PresentationObjects/StabilityPointStructuresOutputContext.cs
===================================================================
diff -u -r68ec97043e735b40f5f6fa555ad53ef7cc43527d -r6fb278035c8d905474b19e469563fa35fcb485a1
--- Riskeer/StabilityPointStructures/src/Riskeer.StabilityPointStructures.Forms/PresentationObjects/StabilityPointStructuresOutputContext.cs (.../StabilityPointStructuresOutputContext.cs) (revision 68ec97043e735b40f5f6fa555ad53ef7cc43527d)
+++ Riskeer/StabilityPointStructures/src/Riskeer.StabilityPointStructures.Forms/PresentationObjects/StabilityPointStructuresOutputContext.cs (.../StabilityPointStructuresOutputContext.cs) (revision 6fb278035c8d905474b19e469563fa35fcb485a1)
@@ -23,7 +23,6 @@
using Riskeer.Common.Data.AssessmentSection;
using Riskeer.Common.Data.Structures;
using Riskeer.Common.Forms.PresentationObjects;
-using Riskeer.StabilityPointStructures.Data;
namespace Riskeer.StabilityPointStructures.Forms.PresentationObjects
{
@@ -36,25 +35,10 @@
/// Creates a new instance of .
///
/// The structures calculation wrapped by the context object.
- /// The failure mechanism the calculation belongs to.
/// The assessment section the calculation belongs to.
/// Thrown when any parameter is null.
public StabilityPointStructuresOutputContext(IStructuresCalculation wrappedData,
- StabilityPointStructuresFailureMechanism failureMechanism,
IAssessmentSection assessmentSection)
- : base(wrappedData, assessmentSection)
- {
- if (failureMechanism == null)
- {
- throw new ArgumentNullException(nameof(failureMechanism));
- }
-
- FailureMechanism = failureMechanism;
- }
-
- ///
- /// Gets the failure mechanism.
- ///
- public StabilityPointStructuresFailureMechanism FailureMechanism { get; }
+ : base(wrappedData, assessmentSection) {}
}
}
\ No newline at end of file
Index: Riskeer/StabilityPointStructures/src/Riskeer.StabilityPointStructures.Forms/PropertyClasses/StabilityPointStructuresOutputProperties.cs
===================================================================
diff -u -r86ac28697ad7b279055dde47c52d0d3b3952fac6 -r6fb278035c8d905474b19e469563fa35fcb485a1
--- Riskeer/StabilityPointStructures/src/Riskeer.StabilityPointStructures.Forms/PropertyClasses/StabilityPointStructuresOutputProperties.cs (.../StabilityPointStructuresOutputProperties.cs) (revision 86ac28697ad7b279055dde47c52d0d3b3952fac6)
+++ Riskeer/StabilityPointStructures/src/Riskeer.StabilityPointStructures.Forms/PropertyClasses/StabilityPointStructuresOutputProperties.cs (.../StabilityPointStructuresOutputProperties.cs) (revision 6fb278035c8d905474b19e469563fa35fcb485a1)
@@ -20,10 +20,8 @@
// All rights reserved.
using System;
-using Riskeer.Common.Data.AssessmentSection;
using Riskeer.Common.Data.Structures;
using Riskeer.Common.Forms.PropertyClasses;
-using Riskeer.StabilityPointStructures.Data;
namespace Riskeer.StabilityPointStructures.Forms.PropertyClasses
{
@@ -32,33 +30,12 @@
///
public class StabilityPointStructuresOutputProperties : StructuresOutputProperties
{
- private readonly StabilityPointStructuresFailureMechanism failureMechanism;
- private readonly IAssessmentSection assessmentSection;
-
///
/// Creates a new instance of .
///
/// The structures output to create the object properties for.
- /// The failure mechanism the output belongs to.
- /// The assessment section the output belongs to.
- /// Thrown when any parameter is null.
- public StabilityPointStructuresOutputProperties(StructuresOutput structuresOutput,
- StabilityPointStructuresFailureMechanism failureMechanism,
- IAssessmentSection assessmentSection)
- : base(structuresOutput)
- {
- if (failureMechanism == null)
- {
- throw new ArgumentNullException(nameof(failureMechanism));
- }
-
- if (assessmentSection == null)
- {
- throw new ArgumentNullException(nameof(assessmentSection));
- }
-
- this.failureMechanism = failureMechanism;
- this.assessmentSection = assessmentSection;
- }
+ /// Thrown when is null.
+ public StabilityPointStructuresOutputProperties(StructuresOutput structuresOutput)
+ : base(structuresOutput) {}
}
}
\ No newline at end of file
Index: Riskeer/StabilityPointStructures/src/Riskeer.StabilityPointStructures.Plugin/StabilityPointStructuresPlugin.cs
===================================================================
diff -u -r558e7064898721a6317eff7f6fc82048d41e3de6 -r6fb278035c8d905474b19e469563fa35fcb485a1
--- Riskeer/StabilityPointStructures/src/Riskeer.StabilityPointStructures.Plugin/StabilityPointStructuresPlugin.cs (.../StabilityPointStructuresPlugin.cs) (revision 558e7064898721a6317eff7f6fc82048d41e3de6)
+++ Riskeer/StabilityPointStructures/src/Riskeer.StabilityPointStructures.Plugin/StabilityPointStructuresPlugin.cs (.../StabilityPointStructuresPlugin.cs) (revision 6fb278035c8d905474b19e469563fa35fcb485a1)
@@ -88,9 +88,7 @@
};
yield return new PropertyInfo
{
- CreateInstance = context => new StabilityPointStructuresOutputProperties(context.WrappedData.Output,
- context.FailureMechanism,
- context.AssessmentSection)
+ CreateInstance = context => new StabilityPointStructuresOutputProperties(context.WrappedData.Output)
};
}
@@ -715,7 +713,7 @@
calculation,
context.FailureMechanism,
context.AssessmentSection),
- new StabilityPointStructuresOutputContext(calculation, context.FailureMechanism, context.AssessmentSection)
+ new StabilityPointStructuresOutputContext(calculation, context.AssessmentSection)
};
}
Index: Riskeer/StabilityPointStructures/test/Riskeer.StabilityPointStructures.Forms.Test/PresentationObjects/StabilityPointStructuresOutputContextTest.cs
===================================================================
diff -u -r68ec97043e735b40f5f6fa555ad53ef7cc43527d -r6fb278035c8d905474b19e469563fa35fcb485a1
--- Riskeer/StabilityPointStructures/test/Riskeer.StabilityPointStructures.Forms.Test/PresentationObjects/StabilityPointStructuresOutputContextTest.cs (.../StabilityPointStructuresOutputContextTest.cs) (revision 68ec97043e735b40f5f6fa555ad53ef7cc43527d)
+++ Riskeer/StabilityPointStructures/test/Riskeer.StabilityPointStructures.Forms.Test/PresentationObjects/StabilityPointStructuresOutputContextTest.cs (.../StabilityPointStructuresOutputContextTest.cs) (revision 6fb278035c8d905474b19e469563fa35fcb485a1)
@@ -19,12 +19,10 @@
// Stichting Deltares and remain full property of Stichting Deltares at all times.
// All rights reserved.
-using System;
using NUnit.Framework;
using Rhino.Mocks;
using Riskeer.Common.Data.AssessmentSection;
using Riskeer.Common.Forms.PresentationObjects;
-using Riskeer.StabilityPointStructures.Data;
using Riskeer.StabilityPointStructures.Data.TestUtil;
using Riskeer.StabilityPointStructures.Forms.PresentationObjects;
@@ -42,36 +40,15 @@
mocks.ReplayAll();
var calculation = new TestStabilityPointStructuresCalculationScenario();
- var failureMechanism = new StabilityPointStructuresFailureMechanism();
// Call
- var structuresOutputContext = new StabilityPointStructuresOutputContext(calculation, failureMechanism, assessmentSection);
+ var structuresOutputContext = new StabilityPointStructuresOutputContext(calculation, assessmentSection);
// Assert
Assert.IsInstanceOf(structuresOutputContext);
Assert.AreSame(calculation, structuresOutputContext.WrappedData);
- Assert.AreSame(failureMechanism, structuresOutputContext.FailureMechanism);
Assert.AreSame(assessmentSection, structuresOutputContext.AssessmentSection);
mocks.VerifyAll();
}
-
- [Test]
- public void Constructor_FailureMechanismNull_ThrowsArgumentNullException()
- {
- // Setup
- var mocks = new MockRepository();
- var assessmentSection = mocks.Stub();
- mocks.ReplayAll();
-
- var calculation = new TestStabilityPointStructuresCalculationScenario();
-
- // Call
- TestDelegate call = () => new StabilityPointStructuresOutputContext(calculation, null, assessmentSection);
-
- // Assert
- var exception = Assert.Throws(call);
- Assert.AreEqual("failureMechanism", exception.ParamName);
- mocks.VerifyAll();
- }
}
}
\ No newline at end of file
Index: Riskeer/StabilityPointStructures/test/Riskeer.StabilityPointStructures.Forms.Test/PropertyClasses/StabilityPointStructuresOutputPropertiesTest.cs
===================================================================
diff -u -re3422ff344de83f9cc3331b5af2c453dd730c74d -r6fb278035c8d905474b19e469563fa35fcb485a1
--- Riskeer/StabilityPointStructures/test/Riskeer.StabilityPointStructures.Forms.Test/PropertyClasses/StabilityPointStructuresOutputPropertiesTest.cs (.../StabilityPointStructuresOutputPropertiesTest.cs) (revision e3422ff344de83f9cc3331b5af2c453dd730c74d)
+++ Riskeer/StabilityPointStructures/test/Riskeer.StabilityPointStructures.Forms.Test/PropertyClasses/StabilityPointStructuresOutputPropertiesTest.cs (.../StabilityPointStructuresOutputPropertiesTest.cs) (revision 6fb278035c8d905474b19e469563fa35fcb485a1)
@@ -36,51 +36,17 @@
public class StabilityPointStructuresOutputPropertiesTest
{
[Test]
- public void Constructor_FailureMechanismNull_ThrowsArgumentNullException()
- {
- // Setup
- var mocks = new MockRepository();
- var assessmentSection = mocks.Stub();
- mocks.ReplayAll();
-
- // Call
- TestDelegate call = () => new StabilityPointStructuresOutputProperties(new TestStructuresOutput(), null, assessmentSection);
-
- // Assert
- var exception = Assert.Throws(call);
- Assert.AreEqual("failureMechanism", exception.ParamName);
- mocks.VerifyAll();
- }
-
- [Test]
- public void Constructor_AssessmentSectionNull_ThrowsArgumentNullException()
- {
- // Call
- TestDelegate call = () => new StabilityPointStructuresOutputProperties(new TestStructuresOutput(), new StabilityPointStructuresFailureMechanism(), 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 output = new TestStructuresOutput();
- var failureMechanism = new StabilityPointStructuresFailureMechanism();
// Call
- var properties = new StabilityPointStructuresOutputProperties(output, failureMechanism, assessmentSection);
+ var properties = new StabilityPointStructuresOutputProperties(output);
// Assert
Assert.IsInstanceOf(properties);
Assert.AreSame(output, properties.Data);
- mocks.VerifyAll();
}
[Test]
@@ -99,7 +65,7 @@
var structuresOutput = new TestStructuresOutput(reliability);
// Call
- var properties = new StabilityPointStructuresOutputProperties(structuresOutput, failureMechanism, assessmentSection);
+ var properties = new StabilityPointStructuresOutputProperties(structuresOutput);
// Assert
ProbabilityAssessmentOutput expectedProbabilityAssessmentOutput = StabilityPointStructuresProbabilityAssessmentOutputFactory.Create(
Index: Riskeer/StabilityPointStructures/test/Riskeer.StabilityPointStructures.Plugin.Test/PropertyInfos/StabilityPointStructuresOutputPropertyInfoTest.cs
===================================================================
diff -u -rb57fc33ef504ac61bac0ddd4786a72f21e4a2d4d -r6fb278035c8d905474b19e469563fa35fcb485a1
--- Riskeer/StabilityPointStructures/test/Riskeer.StabilityPointStructures.Plugin.Test/PropertyInfos/StabilityPointStructuresOutputPropertyInfoTest.cs (.../StabilityPointStructuresOutputPropertyInfoTest.cs) (revision b57fc33ef504ac61bac0ddd4786a72f21e4a2d4d)
+++ Riskeer/StabilityPointStructures/test/Riskeer.StabilityPointStructures.Plugin.Test/PropertyInfos/StabilityPointStructuresOutputPropertyInfoTest.cs (.../StabilityPointStructuresOutputPropertyInfoTest.cs) (revision 6fb278035c8d905474b19e469563fa35fcb485a1)
@@ -75,7 +75,7 @@
};
// Call
- IObjectProperties objectProperties = info.CreateInstance(new StabilityPointStructuresOutputContext(calculation, failureMechanism, assessmentSection));
+ IObjectProperties objectProperties = info.CreateInstance(new StabilityPointStructuresOutputContext(calculation, assessmentSection));
// Assert
Assert.IsInstanceOf(objectProperties);
Index: Riskeer/StabilityPointStructures/test/Riskeer.StabilityPointStructures.Plugin.Test/TreeNodeInfos/StabilityPointStructuresCalculationScenarioContextTreeNodeInfoTest.cs
===================================================================
diff -u -r0e0eff94d9452eeebda5f68f183414d4ee3df413 -r6fb278035c8d905474b19e469563fa35fcb485a1
--- Riskeer/StabilityPointStructures/test/Riskeer.StabilityPointStructures.Plugin.Test/TreeNodeInfos/StabilityPointStructuresCalculationScenarioContextTreeNodeInfoTest.cs (.../StabilityPointStructuresCalculationScenarioContextTreeNodeInfoTest.cs) (revision 0e0eff94d9452eeebda5f68f183414d4ee3df413)
+++ Riskeer/StabilityPointStructures/test/Riskeer.StabilityPointStructures.Plugin.Test/TreeNodeInfos/StabilityPointStructuresCalculationScenarioContextTreeNodeInfoTest.cs (.../StabilityPointStructuresCalculationScenarioContextTreeNodeInfoTest.cs) (revision 6fb278035c8d905474b19e469563fa35fcb485a1)
@@ -142,7 +142,6 @@
var structuresOutputContext = children[2] as StabilityPointStructuresOutputContext;
Assert.IsNotNull(structuresOutputContext);
Assert.AreSame(calculationContext.WrappedData, structuresOutputContext.WrappedData);
- Assert.AreSame(calculationContext.FailureMechanism, structuresOutputContext.FailureMechanism);
Assert.AreSame(calculationContext.AssessmentSection, structuresOutputContext.AssessmentSection);
}
@@ -954,7 +953,7 @@
using (var treeViewControl = new TreeViewControl())
{
IMainWindow mainWindow = MainWindowTestHelper.CreateMainWindowStub(mocks);
-
+
var gui = mocks.Stub();
gui.Stub(g => g.Get(calculationContext, treeViewControl)).Return(new CustomItemsOnlyContextMenuBuilder());
gui.Stub(g => g.MainWindow).Return(mainWindow);