Index: Riskeer/GrassCoverErosionInwards/src/Riskeer.GrassCoverErosionInwards.Forms/PresentationObjects/GrassCoverErosionInwardsOutputContext.cs
===================================================================
diff -u -ra4e3b2745a48598260107bb5bfca7485205cdcc2 -r72ecf8d28448698d9077f780cd0afc6b07101b54
--- Riskeer/GrassCoverErosionInwards/src/Riskeer.GrassCoverErosionInwards.Forms/PresentationObjects/GrassCoverErosionInwardsOutputContext.cs (.../GrassCoverErosionInwardsOutputContext.cs) (revision a4e3b2745a48598260107bb5bfca7485205cdcc2)
+++ Riskeer/GrassCoverErosionInwards/src/Riskeer.GrassCoverErosionInwards.Forms/PresentationObjects/GrassCoverErosionInwardsOutputContext.cs (.../GrassCoverErosionInwardsOutputContext.cs) (revision 72ecf8d28448698d9077f780cd0afc6b07101b54)
@@ -21,7 +21,6 @@
using System;
using Core.Common.Controls.PresentationObjects;
-using Riskeer.Common.Data.AssessmentSection;
using Riskeer.GrassCoverErosionInwards.Data;
namespace Riskeer.GrassCoverErosionInwards.Forms.PresentationObjects
@@ -35,36 +34,8 @@
/// Creates a new instance of .
///
/// The grass cover erosion inwards 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 GrassCoverErosionInwardsOutputContext(GrassCoverErosionInwardsCalculation wrappedData,
- GrassCoverErosionInwardsFailureMechanism failureMechanism,
- IAssessmentSection assessmentSection)
- : base(wrappedData)
- {
- if (failureMechanism == null)
- {
- throw new ArgumentNullException(nameof(failureMechanism));
- }
-
- if (assessmentSection == null)
- {
- throw new ArgumentNullException(nameof(assessmentSection));
- }
-
- FailureMechanism = failureMechanism;
- AssessmentSection = assessmentSection;
- }
-
- ///
- /// Gets the failure mechanism.
- ///
- public GrassCoverErosionInwardsFailureMechanism FailureMechanism { get; }
-
- ///
- /// Gets the assessment section.
- ///
- public IAssessmentSection AssessmentSection { get; }
+ /// Thrown when is null.
+ public GrassCoverErosionInwardsOutputContext(GrassCoverErosionInwardsCalculation wrappedData)
+ : base(wrappedData) {}
}
}
\ No newline at end of file
Index: Riskeer/GrassCoverErosionInwards/src/Riskeer.GrassCoverErosionInwards.Plugin/GrassCoverErosionInwardsPlugin.cs
===================================================================
diff -u -re9eab53fe6879727ee749dc04785e90adfb3aaf1 -r72ecf8d28448698d9077f780cd0afc6b07101b54
--- Riskeer/GrassCoverErosionInwards/src/Riskeer.GrassCoverErosionInwards.Plugin/GrassCoverErosionInwardsPlugin.cs (.../GrassCoverErosionInwardsPlugin.cs) (revision e9eab53fe6879727ee749dc04785e90adfb3aaf1)
+++ Riskeer/GrassCoverErosionInwards/src/Riskeer.GrassCoverErosionInwards.Plugin/GrassCoverErosionInwardsPlugin.cs (.../GrassCoverErosionInwardsPlugin.cs) (revision 72ecf8d28448698d9077f780cd0afc6b07101b54)
@@ -867,9 +867,7 @@
calculation,
context.FailureMechanism,
context.AssessmentSection),
- new GrassCoverErosionInwardsOutputContext(calculation,
- context.FailureMechanism,
- context.AssessmentSection)
+ new GrassCoverErosionInwardsOutputContext(calculation)
};
}
Index: Riskeer/GrassCoverErosionInwards/test/Riskeer.GrassCoverErosionInwards.Forms.Test/PresentationObjects/GrassCoverErosionInwardsOutputContextTest.cs
===================================================================
diff -u -rb1e11dbfdf58d43200d940bdffaf02ec8bcd522d -r72ecf8d28448698d9077f780cd0afc6b07101b54
--- Riskeer/GrassCoverErosionInwards/test/Riskeer.GrassCoverErosionInwards.Forms.Test/PresentationObjects/GrassCoverErosionInwardsOutputContextTest.cs (.../GrassCoverErosionInwardsOutputContextTest.cs) (revision b1e11dbfdf58d43200d940bdffaf02ec8bcd522d)
+++ Riskeer/GrassCoverErosionInwards/test/Riskeer.GrassCoverErosionInwards.Forms.Test/PresentationObjects/GrassCoverErosionInwardsOutputContextTest.cs (.../GrassCoverErosionInwardsOutputContextTest.cs) (revision 72ecf8d28448698d9077f780cd0afc6b07101b54)
@@ -19,11 +19,8 @@
// Stichting Deltares and remain full property of Stichting Deltares at all times.
// All rights reserved.
-using System;
using Core.Common.Controls.PresentationObjects;
using NUnit.Framework;
-using Rhino.Mocks;
-using Riskeer.Common.Data.AssessmentSection;
using Riskeer.GrassCoverErosionInwards.Data;
using Riskeer.GrassCoverErosionInwards.Forms.PresentationObjects;
@@ -36,52 +33,14 @@
public void Constructor_ExpectedValues()
{
// Setup
- var mocks = new MockRepository();
- var assessmentSection = mocks.Stub();
- mocks.ReplayAll();
-
- var failureMechanism = new GrassCoverErosionInwardsFailureMechanism();
var calculation = new GrassCoverErosionInwardsCalculation(0.1);
// Call
- var grassCoverErosionInwardsOutputContext = new GrassCoverErosionInwardsOutputContext(calculation, failureMechanism, assessmentSection);
+ var grassCoverErosionInwardsOutputContext = new GrassCoverErosionInwardsOutputContext(calculation);
// Assert
Assert.IsInstanceOf>(grassCoverErosionInwardsOutputContext);
Assert.AreSame(calculation, grassCoverErosionInwardsOutputContext.WrappedData);
- Assert.AreSame(failureMechanism, grassCoverErosionInwardsOutputContext.FailureMechanism);
- Assert.AreSame(assessmentSection, grassCoverErosionInwardsOutputContext.AssessmentSection);
- mocks.VerifyAll();
}
-
- [Test]
- public void Constructror_FailureMechanismNull_ThrowsArgumentNullException()
- {
- // Setup
- var mocks = new MockRepository();
- var assessmentSection = mocks.Stub();
- mocks.ReplayAll();
-
- // Call
- void Call() => new GrassCoverErosionInwardsOutputContext(new GrassCoverErosionInwardsCalculation(0.1),
- null, assessmentSection);
-
- // Assert
- var exception = Assert.Throws(Call);
- Assert.AreEqual("failureMechanism", exception.ParamName);
- mocks.VerifyAll();
- }
-
- [Test]
- public void Constructor_AssessmentSectionNull_ThrowsArgumentNullException()
- {
- // Call
- void Call() => new GrassCoverErosionInwardsOutputContext(new GrassCoverErosionInwardsCalculation(0.1),
- new GrassCoverErosionInwardsFailureMechanism(), null);
-
- // Assert
- var exception = Assert.Throws(Call);
- Assert.AreEqual("assessmentSection", exception.ParamName);
- }
}
}
\ No newline at end of file
Index: Riskeer/GrassCoverErosionInwards/test/Riskeer.GrassCoverErosionInwards.Plugin.Test/PropertyInfos/GrassCoverErosionInwardsOutputContextPropertyInfoTest.cs
===================================================================
diff -u -rd3cc05b596f5c889d6ca5260459892ecfcc23cbd -r72ecf8d28448698d9077f780cd0afc6b07101b54
--- Riskeer/GrassCoverErosionInwards/test/Riskeer.GrassCoverErosionInwards.Plugin.Test/PropertyInfos/GrassCoverErosionInwardsOutputContextPropertyInfoTest.cs (.../GrassCoverErosionInwardsOutputContextPropertyInfoTest.cs) (revision d3cc05b596f5c889d6ca5260459892ecfcc23cbd)
+++ Riskeer/GrassCoverErosionInwards/test/Riskeer.GrassCoverErosionInwards.Plugin.Test/PropertyInfos/GrassCoverErosionInwardsOutputContextPropertyInfoTest.cs (.../GrassCoverErosionInwardsOutputContextPropertyInfoTest.cs) (revision 72ecf8d28448698d9077f780cd0afc6b07101b54)
@@ -23,9 +23,6 @@
using Core.Gui.Plugin;
using Core.Gui.PropertyBag;
using NUnit.Framework;
-using Rhino.Mocks;
-using Riskeer.Common.Data.AssessmentSection;
-using Riskeer.Common.Data.TestUtil;
using Riskeer.GrassCoverErosionInwards.Data;
using Riskeer.GrassCoverErosionInwards.Data.TestUtil;
using Riskeer.GrassCoverErosionInwards.Forms.PresentationObjects;
@@ -64,25 +61,18 @@
public void CreateInstance_WithContext_NewPropertiesWithData()
{
// Setup
- var failureMechanism = new GrassCoverErosionInwardsFailureMechanism();
-
- var mocks = new MockRepository();
- IAssessmentSection assessmentSection = AssessmentSectionTestHelper.CreateAssessmentSectionStub(failureMechanism, mocks);
- mocks.ReplayAll();
-
var output = new TestGrassCoverErosionInwardsOutput();
var calculation = new GrassCoverErosionInwardsCalculation(0.1)
{
Output = output
};
// Call
- IObjectProperties objectProperties = info.CreateInstance(new GrassCoverErosionInwardsOutputContext(calculation, failureMechanism, assessmentSection));
+ IObjectProperties objectProperties = info.CreateInstance(new GrassCoverErosionInwardsOutputContext(calculation));
// Assert
Assert.IsInstanceOf(objectProperties);
Assert.AreSame(output, objectProperties.Data);
- mocks.VerifyAll();
}
}
}
\ No newline at end of file
Index: Riskeer/GrassCoverErosionInwards/test/Riskeer.GrassCoverErosionInwards.Plugin.Test/TreeNodeInfos/GrassCoverErosionInwardsCalculationContextTreeNodeInfoTest.cs
===================================================================
diff -u -r19fe78dad099e732a640666a868b42d93b599991 -r72ecf8d28448698d9077f780cd0afc6b07101b54
--- Riskeer/GrassCoverErosionInwards/test/Riskeer.GrassCoverErosionInwards.Plugin.Test/TreeNodeInfos/GrassCoverErosionInwardsCalculationContextTreeNodeInfoTest.cs (.../GrassCoverErosionInwardsCalculationContextTreeNodeInfoTest.cs) (revision 19fe78dad099e732a640666a868b42d93b599991)
+++ Riskeer/GrassCoverErosionInwards/test/Riskeer.GrassCoverErosionInwards.Plugin.Test/TreeNodeInfos/GrassCoverErosionInwardsCalculationContextTreeNodeInfoTest.cs (.../GrassCoverErosionInwardsCalculationContextTreeNodeInfoTest.cs) (revision 72ecf8d28448698d9077f780cd0afc6b07101b54)
@@ -145,8 +145,6 @@
var grassCoverErosionInwardsOutputContext = children[2] as GrassCoverErosionInwardsOutputContext;
Assert.IsNotNull(grassCoverErosionInwardsOutputContext);
Assert.AreSame(calculationContext.WrappedData, grassCoverErosionInwardsOutputContext.WrappedData);
- Assert.AreSame(calculationContext.FailureMechanism, grassCoverErosionInwardsOutputContext.FailureMechanism);
- Assert.AreSame(calculationContext.AssessmentSection, grassCoverErosionInwardsOutputContext.AssessmentSection);
}
[Test]
Index: Riskeer/GrassCoverErosionInwards/test/Riskeer.GrassCoverErosionInwards.Plugin.Test/TreeNodeInfos/GrassCoverErosionInwardsOutputContextTreeNodeInfoTest.cs
===================================================================
diff -u -re9eab53fe6879727ee749dc04785e90adfb3aaf1 -r72ecf8d28448698d9077f780cd0afc6b07101b54
--- Riskeer/GrassCoverErosionInwards/test/Riskeer.GrassCoverErosionInwards.Plugin.Test/TreeNodeInfos/GrassCoverErosionInwardsOutputContextTreeNodeInfoTest.cs (.../GrassCoverErosionInwardsOutputContextTreeNodeInfoTest.cs) (revision e9eab53fe6879727ee749dc04785e90adfb3aaf1)
+++ Riskeer/GrassCoverErosionInwards/test/Riskeer.GrassCoverErosionInwards.Plugin.Test/TreeNodeInfos/GrassCoverErosionInwardsOutputContextTreeNodeInfoTest.cs (.../GrassCoverErosionInwardsOutputContextTreeNodeInfoTest.cs) (revision 72ecf8d28448698d9077f780cd0afc6b07101b54)
@@ -27,7 +27,6 @@
using Core.Gui.ContextMenu;
using NUnit.Framework;
using Rhino.Mocks;
-using Riskeer.Common.Data.AssessmentSection;
using Riskeer.GrassCoverErosionInwards.Data;
using Riskeer.GrassCoverErosionInwards.Data.TestUtil;
using Riskeer.GrassCoverErosionInwards.Forms.PresentationObjects;
@@ -91,42 +90,24 @@
[Test]
public void ForeColor_HasNoOutput_ReturnGrayText()
{
- // Setup
- var mocks = new MockRepository();
- var assessmentSection = mocks.Stub();
- mocks.ReplayAll();
-
- var failureMechanism = new GrassCoverErosionInwardsFailureMechanism();
-
// Call
- Color color = info.ForeColor(new GrassCoverErosionInwardsOutputContext(new GrassCoverErosionInwardsCalculation(0.1),
- failureMechanism,
- assessmentSection));
+ Color color = info.ForeColor(new GrassCoverErosionInwardsOutputContext(new GrassCoverErosionInwardsCalculation(0.1)));
// Assert
Assert.AreEqual(Color.FromKnownColor(KnownColor.GrayText), color);
- mocks.VerifyAll();
}
[Test]
public void ForeColor_HasOutput_ReturnControlText()
{
- // Setup
- var mocks = new MockRepository();
- var assessmentSection = mocks.Stub();
- mocks.ReplayAll();
-
- var failureMechanism = new GrassCoverErosionInwardsFailureMechanism();
-
// Call
Color color = info.ForeColor(new GrassCoverErosionInwardsOutputContext(new GrassCoverErosionInwardsCalculation(0.1)
{
Output = new TestGrassCoverErosionInwardsOutput()
- }, failureMechanism, assessmentSection));
+ }));
// Assert
Assert.AreEqual(Color.FromKnownColor(KnownColor.ControlText), color);
- mocks.VerifyAll();
}
[Test]
@@ -145,19 +126,11 @@
public void ChildNodeObjects_Always_ReturnsCollectionWithOutputObjects(bool hasOutput)
{
// Setup
- var mocks = new MockRepository();
- var assessmentSection = mocks.Stub();
- mocks.ReplayAll();
-
- var failureMechanism = new GrassCoverErosionInwardsFailureMechanism();
-
var grassCoverErosionInwardsCalculation = new GrassCoverErosionInwardsCalculation(0.1)
{
Output = hasOutput ? new TestGrassCoverErosionInwardsOutput() : null
};
- var grassCoverErosionInwardsOutputContext = new GrassCoverErosionInwardsOutputContext(grassCoverErosionInwardsCalculation,
- failureMechanism,
- assessmentSection);
+ var grassCoverErosionInwardsOutputContext = new GrassCoverErosionInwardsOutputContext(grassCoverErosionInwardsCalculation);
// Call
object[] children = info.ChildNodeObjects(grassCoverErosionInwardsOutputContext).ToArray();
@@ -176,7 +149,6 @@
var overtoppingRateOutputContext = children[2] as OvertoppingRateOutputContext;
Assert.IsNotNull(overtoppingRateOutputContext);
Assert.AreSame(grassCoverErosionInwardsCalculation, overtoppingRateOutputContext.WrappedData);
- mocks.VerifyAll();
}
[Test]