Index: Core/Common/src/Core.Common.Controls/PresentationObjects/WrappedObjectContextBase.cs =================================================================== diff -u -rdebefef18429127ee0963736030450abf4390cee -re775448bfb8290e43d62340a53a08723bbc035c6 --- Core/Common/src/Core.Common.Controls/PresentationObjects/WrappedObjectContextBase.cs (.../WrappedObjectContextBase.cs) (revision debefef18429127ee0963736030450abf4390cee) +++ Core/Common/src/Core.Common.Controls/PresentationObjects/WrappedObjectContextBase.cs (.../WrappedObjectContextBase.cs) (revision e775448bfb8290e43d62340a53a08723bbc035c6) @@ -58,6 +58,10 @@ { return false; } + if (other.GetType() != GetType()) + { + return false; + } if (ReferenceEquals(this, other)) { return true; @@ -67,19 +71,6 @@ public override bool Equals(object obj) { - if (ReferenceEquals(null, obj)) - { - return false; - } - if (obj.GetType() != GetType()) - { - return false; - } - if (ReferenceEquals(this, obj)) - { - return true; - } - return Equals(obj as WrappedObjectContextBase); } Index: Core/Common/test/Core.Common.Controls.Test/PresentationObjects/ObservableWrappedObjectContextBaseTest.cs =================================================================== diff -u -r44568559b13a82c0ed7640ff2d5648552a0d7add -re775448bfb8290e43d62340a53a08723bbc035c6 --- Core/Common/test/Core.Common.Controls.Test/PresentationObjects/ObservableWrappedObjectContextBaseTest.cs (.../ObservableWrappedObjectContextBaseTest.cs) (revision 44568559b13a82c0ed7640ff2d5648552a0d7add) +++ Core/Common/test/Core.Common.Controls.Test/PresentationObjects/ObservableWrappedObjectContextBaseTest.cs (.../ObservableWrappedObjectContextBaseTest.cs) (revision e775448bfb8290e43d62340a53a08723bbc035c6) @@ -35,17 +35,16 @@ { // Setup var mocks = new MockRepository(); - var sourceObject = mocks.Stub(); + var sourceObjectMock = mocks.StrictMock(); mocks.ReplayAll(); // Call - var context = new SimpleObservableWrappedObjectContext(sourceObject); + var context = new SimpleObservableWrappedObjectContext(sourceObjectMock); // Assert Assert.IsInstanceOf(context); Assert.IsInstanceOf>(context); - Assert.AreSame(sourceObject, context.WrappedData); - + Assert.AreSame(sourceObjectMock, context.WrappedData); mocks.VerifyAll(); } @@ -54,16 +53,16 @@ { // Setup var mocks = new MockRepository(); - var observer = mocks.Stub(); - observer.Expect(o => o.UpdateObserver()); + var observerMock = mocks.StrictMock(); + observerMock.Expect(o => o.UpdateObserver()); mocks.ReplayAll(); var equalitySource = new object(); var sourceObject = new SimpleObservable(equalitySource); - var context = new SimpleObservableWrappedObjectContext(sourceObject); - context.Attach(observer); + context.Attach(observerMock); + // Call context.NotifyObservers(); @@ -76,16 +75,16 @@ { // Setup var mocks = new MockRepository(); - var observer = mocks.StrictMock(); + var observerMock = mocks.StrictMock(); mocks.ReplayAll(); var equalitySource = new object(); var sourceObject = new SimpleObservable(equalitySource); - var context = new SimpleObservableWrappedObjectContext(sourceObject); - context.Attach(observer); - context.Detach(observer); + context.Attach(observerMock); + context.Detach(observerMock); + // Call context.NotifyObservers(); @@ -98,16 +97,16 @@ { // Setup var mocks = new MockRepository(); - var observer = mocks.Stub(); - observer.Expect(o => o.UpdateObserver()); + var observerMock = mocks.StrictMock(); + observerMock.Expect(o => o.UpdateObserver()); mocks.ReplayAll(); var equalitySource = new object(); var sourceObject = new SimpleObservable(equalitySource); - sourceObject.Attach(observer); - var context = new SimpleObservableWrappedObjectContext(sourceObject); + sourceObject.Attach(observerMock); + // Call context.NotifyObservers(); @@ -120,16 +119,16 @@ { // Setup var mocks = new MockRepository(); - var observer = mocks.Stub(); - observer.Expect(o => o.UpdateObserver()); + var observerMock = mocks.StrictMock(); + observerMock.Expect(o => o.UpdateObserver()); mocks.ReplayAll(); var equalitySource = new object(); var sourceObject = new SimpleObservable(equalitySource); - var context = new SimpleObservableWrappedObjectContext(sourceObject); - context.Attach(observer); + context.Attach(observerMock); + // Call sourceObject.NotifyObservers(); Index: Core/Common/test/Core.Common.Controls.Test/PresentationObjects/WrappedObjectContextBaseTest.cs =================================================================== diff -u -r15a9ac53dc65994d8307840763a97d02f85e64ea -re775448bfb8290e43d62340a53a08723bbc035c6 --- Core/Common/test/Core.Common.Controls.Test/PresentationObjects/WrappedObjectContextBaseTest.cs (.../WrappedObjectContextBaseTest.cs) (revision 15a9ac53dc65994d8307840763a97d02f85e64ea) +++ Core/Common/test/Core.Common.Controls.Test/PresentationObjects/WrappedObjectContextBaseTest.cs (.../WrappedObjectContextBaseTest.cs) (revision e775448bfb8290e43d62340a53a08723bbc035c6) @@ -25,7 +25,6 @@ using Core.Common.Controls.PresentationObjects; using Core.Common.TestUtil; using NUnit.Framework; -using Rhino.Mocks; namespace Core.Common.Controls.Test.PresentationObjects { @@ -36,18 +35,14 @@ public void Constructor_ValidWrappedObjectInstance_ExpectedValues() { // Setup - var mocks = new MockRepository(); - var sourceObject = mocks.Stub(); - mocks.ReplayAll(); + var sourceObject = new object(); // Call var context = new SimpleWrappedObjectContext(sourceObject); // Assert Assert.IsInstanceOf>>(context); Assert.AreSame(sourceObject, context.WrappedData); - - mocks.VerifyAll(); } [Test] @@ -65,49 +60,33 @@ public void Equals_ToNull_ReturnFalse() { // Setup - var mocks = new MockRepository(); - var sourceObject = mocks.Stub(); - mocks.ReplayAll(); + var context = new SimpleWrappedObjectContext(new object()); - var context = new SimpleWrappedObjectContext(sourceObject); - // Call var isEqual = context.Equals(null); // Assert Assert.IsFalse(isEqual); - - mocks.VerifyAll(); } [Test] public void Equals_ToItself_ReturnTrue() { // Setup - var mocks = new MockRepository(); - var sourceObject = mocks.Stub(); - mocks.ReplayAll(); + var context = new SimpleWrappedObjectContext(new object()); - var context = new SimpleWrappedObjectContext(sourceObject); - // Call var isEqual = context.Equals(context); // Assert Assert.IsTrue(isEqual); - - mocks.VerifyAll(); } [Test] public void Equals_ToOtherWithDifferentWrappedType_ReturnFalse() { // Setup - var mocks = new MockRepository(); - var sourceObject = mocks.Stub(); - mocks.ReplayAll(); - - var context1 = new SimpleWrappedObjectContext(sourceObject); + var context1 = new SimpleWrappedObjectContext(new object()); var context2 = new SimpleWrappedObjectContext>(Enumerable.Empty()); // Call @@ -117,18 +96,14 @@ // Assert Assert.IsFalse(isEqual1); Assert.IsFalse(isEqual2); - - mocks.VerifyAll(); } [Test] public void Equals_ToOtherWithDifferentWrappedData_ReturnFalse() { // Setup - var sourceObj1 = new object(); - var sourceObj2 = new object(); - var sourceObject1 = new SimpleEquatable(sourceObj1); - var sourceObject2 = new SimpleEquatable(sourceObj2); + var sourceObject1 = new SimpleEquatable(new object()); + var sourceObject2 = new SimpleEquatable(new object()); // Precondition: Assert.IsFalse(sourceObject1.Equals(sourceObject2)); @@ -149,44 +124,34 @@ public void Equals_ToOtherWithDifferentContextType_ReturnFalse() { // Setup - var mocks = new MockRepository(); - var sourceObject = mocks.Stub(); - mocks.ReplayAll(); - + var sourceObject = new object(); var context1 = new SimpleWrappedObjectContext(sourceObject); object context2 = new AnotherSimpleWrappedObjectContext(sourceObject); // Call var isEqual1 = context1.Equals(context2); - var isEqual2 = context1.Equals(context2); + var isEqual2 = context2.Equals(context1); // Assert Assert.IsFalse(isEqual1); Assert.IsFalse(isEqual2); - - mocks.VerifyAll(); } [Test] public void Equals_ToOtherWithSameWrappedData_ReturnTrue() { // Setup - var mocks = new MockRepository(); - var sourceObject = mocks.Stub(); - mocks.ReplayAll(); - + var sourceObject = new object(); var context1 = new SimpleWrappedObjectContext(sourceObject); object context2 = new SimpleWrappedObjectContext(sourceObject); // Call var isEqual1 = context1.Equals(context2); - var isEqual2 = context1.Equals(context2); + var isEqual2 = context2.Equals(context1); // Assert Assert.IsTrue(isEqual1); Assert.IsTrue(isEqual2); - - mocks.VerifyAll(); } [Test] @@ -196,7 +161,6 @@ var sourceObject = new object(); var sourceObject1 = new SimpleEquatable(sourceObject); var sourceObject2 = new SimpleEquatable(sourceObject); - var context1 = new SimpleWrappedObjectContext(sourceObject1); object context2 = new SimpleWrappedObjectContext(sourceObject2); @@ -215,10 +179,7 @@ public void GetHashCode_OtherWithDifferentContextType_ReturnDifferentHashCode() { // Setup - var mocks = new MockRepository(); - var sourceObject = mocks.Stub(); - mocks.ReplayAll(); - + var sourceObject = new object(); var context1 = new SimpleWrappedObjectContext(sourceObject); object context2 = new AnotherSimpleWrappedObjectContext(sourceObject); Index: Ringtoets/Common/src/Ringtoets.Common.Forms/PresentationObjects/CommentContext.cs =================================================================== diff -u -r14185c4e29bcfc887fa656a681bdde704d250a9f -re775448bfb8290e43d62340a53a08723bbc035c6 --- Ringtoets/Common/src/Ringtoets.Common.Forms/PresentationObjects/CommentContext.cs (.../CommentContext.cs) (revision 14185c4e29bcfc887fa656a681bdde704d250a9f) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/PresentationObjects/CommentContext.cs (.../CommentContext.cs) (revision e775448bfb8290e43d62340a53a08723bbc035c6) @@ -35,6 +35,7 @@ /// /// The commentable item to wrap. /// Thrown when is null. - public CommentContext(T wrappedCommentable) : base(wrappedCommentable) {} + public CommentContext(T wrappedCommentable) + : base(wrappedCommentable) {} } } \ No newline at end of file Index: Ringtoets/Common/src/Ringtoets.Common.Forms/PresentationObjects/FailureMechanismContext.cs =================================================================== diff -u -rdebefef18429127ee0963736030450abf4390cee -re775448bfb8290e43d62340a53a08723bbc035c6 --- Ringtoets/Common/src/Ringtoets.Common.Forms/PresentationObjects/FailureMechanismContext.cs (.../FailureMechanismContext.cs) (revision debefef18429127ee0963736030450abf4390cee) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/PresentationObjects/FailureMechanismContext.cs (.../FailureMechanismContext.cs) (revision e775448bfb8290e43d62340a53a08723bbc035c6) @@ -36,8 +36,9 @@ /// /// The failure mechanism. /// The parent of . - /// Thrown when or are null. - public FailureMechanismContext(T wrappedFailureMechanism, IAssessmentSection parent) : base(wrappedFailureMechanism) + /// When any input argument is null. + public FailureMechanismContext(T wrappedFailureMechanism, IAssessmentSection parent) + : base(wrappedFailureMechanism) { AssertInputsAreNotNull(parent); Index: Ringtoets/Common/src/Ringtoets.Common.Forms/PresentationObjects/FailureMechanismSectionResultContext.cs =================================================================== diff -u -r14185c4e29bcfc887fa656a681bdde704d250a9f -re775448bfb8290e43d62340a53a08723bbc035c6 --- Ringtoets/Common/src/Ringtoets.Common.Forms/PresentationObjects/FailureMechanismSectionResultContext.cs (.../FailureMechanismSectionResultContext.cs) (revision 14185c4e29bcfc887fa656a681bdde704d250a9f) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/PresentationObjects/FailureMechanismSectionResultContext.cs (.../FailureMechanismSectionResultContext.cs) (revision e775448bfb8290e43d62340a53a08723bbc035c6) @@ -36,7 +36,7 @@ /// /// The of to wrap. /// The the belongs to. - /// Thrown when or is null. + /// When any input argument is null. public FailureMechanismSectionResultContext(IEnumerable wrappedSectionResults, IFailureMechanism failureMechanism) : base(wrappedSectionResults) { Index: Ringtoets/Common/src/Ringtoets.Common.Forms/PresentationObjects/ReferenceLineContext.cs =================================================================== diff -u -rf01bfd8d4c0541a96d57071b397c39792a99da26 -re775448bfb8290e43d62340a53a08723bbc035c6 --- Ringtoets/Common/src/Ringtoets.Common.Forms/PresentationObjects/ReferenceLineContext.cs (.../ReferenceLineContext.cs) (revision f01bfd8d4c0541a96d57071b397c39792a99da26) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/PresentationObjects/ReferenceLineContext.cs (.../ReferenceLineContext.cs) (revision e775448bfb8290e43d62340a53a08723bbc035c6) @@ -35,6 +35,7 @@ /// /// The assessment section that is wrapped. /// Thrown when is null. - public ReferenceLineContext(IAssessmentSection wrappedAssessmentSection) : base(wrappedAssessmentSection) {} + public ReferenceLineContext(IAssessmentSection wrappedAssessmentSection) + : base(wrappedAssessmentSection) {} } } \ No newline at end of file Index: Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PresentationObjects/CommentContextTest.cs =================================================================== diff -u -r14185c4e29bcfc887fa656a681bdde704d250a9f -re775448bfb8290e43d62340a53a08723bbc035c6 --- Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PresentationObjects/CommentContextTest.cs (.../CommentContextTest.cs) (revision 14185c4e29bcfc887fa656a681bdde704d250a9f) +++ Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PresentationObjects/CommentContextTest.cs (.../CommentContextTest.cs) (revision e775448bfb8290e43d62340a53a08723bbc035c6) @@ -35,16 +35,15 @@ { // Setup var mocks = new MockRepository(); - var commentMock = mocks.StrictMock(); + var commentableMock = mocks.StrictMock(); mocks.ReplayAll(); // Call - var context = new CommentContext(commentMock); + var context = new CommentContext(commentableMock); // Assert Assert.IsInstanceOf>(context); - Assert.AreSame(commentMock, context.WrappedData); - + Assert.AreSame(commentableMock, context.WrappedData); mocks.VerifyAll(); } } Index: Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PresentationObjects/FailureMechanismContextTest.cs =================================================================== diff -u -r14185c4e29bcfc887fa656a681bdde704d250a9f -re775448bfb8290e43d62340a53a08723bbc035c6 --- Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PresentationObjects/FailureMechanismContextTest.cs (.../FailureMechanismContextTest.cs) (revision 14185c4e29bcfc887fa656a681bdde704d250a9f) +++ Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PresentationObjects/FailureMechanismContextTest.cs (.../FailureMechanismContextTest.cs) (revision e775448bfb8290e43d62340a53a08723bbc035c6) @@ -37,18 +37,18 @@ { // Setup var mocks = new MockRepository(); - var assessmentSection = mocks.Stub(); - var failureMechanism = mocks.Stub(); + var assessmentSectionMock = mocks.StrictMock(); + var failureMechanismMock = mocks.StrictMock(); mocks.ReplayAll(); // Call - var context = new SimpleFailureMechanismContext(failureMechanism, assessmentSection); + var context = new SimpleFailureMechanismContext(failureMechanismMock, assessmentSectionMock); // Assert Assert.IsInstanceOf>(context); Assert.IsInstanceOf>(context); - Assert.AreSame(assessmentSection, context.Parent); - Assert.AreSame(failureMechanism, context.WrappedData); + Assert.AreSame(assessmentSectionMock, context.Parent); + Assert.AreSame(failureMechanismMock, context.WrappedData); mocks.VerifyAll(); } @@ -57,15 +57,16 @@ { // Setup var mocks = new MockRepository(); - var failureMechanism = mocks.Stub(); + var failureMechanismMock = mocks.StrictMock(); mocks.ReplayAll(); // Call - TestDelegate test = () => new SimpleFailureMechanismContext(failureMechanism, null); + TestDelegate test = () => new SimpleFailureMechanismContext(failureMechanismMock, null); // Assert var exception = Assert.Throws(test); Assert.AreEqual("parent", exception.ParamName); + mocks.VerifyAll(); } private class SimpleFailureMechanismContext : FailureMechanismContext Index: Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PresentationObjects/FailureMechanismContributionContextTest.cs =================================================================== diff -u -r14185c4e29bcfc887fa656a681bdde704d250a9f -re775448bfb8290e43d62340a53a08723bbc035c6 --- Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PresentationObjects/FailureMechanismContributionContextTest.cs (.../FailureMechanismContributionContextTest.cs) (revision 14185c4e29bcfc887fa656a681bdde704d250a9f) +++ Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PresentationObjects/FailureMechanismContributionContextTest.cs (.../FailureMechanismContributionContextTest.cs) (revision e775448bfb8290e43d62340a53a08723bbc035c6) @@ -39,20 +39,20 @@ public void Contructor_ExpectedValues() { // Setup - var failureMechanisms = Enumerable.Empty(); - var contribution = new FailureMechanismContribution(failureMechanisms, 1.1, 30000); - var mocks = new MockRepository(); - IAssessmentSection assessmentSection = mocks.Stub(); + var assessmentSectionMock = mocks.StrictMock(); mocks.ReplayAll(); + var failureMechanisms = Enumerable.Empty(); + var contribution = new FailureMechanismContribution(failureMechanisms, 1.1, 30000); + // Call - var context = new FailureMechanismContributionContext(contribution, assessmentSection); + var context = new FailureMechanismContributionContext(contribution, assessmentSectionMock); // Assert Assert.IsInstanceOf>(context); Assert.AreSame(contribution, context.WrappedData); - Assert.AreSame(assessmentSection, context.Parent); + Assert.AreSame(assessmentSectionMock, context.Parent); mocks.VerifyAll(); } Index: Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PresentationObjects/FailureMechanismSectionResultContextTest.cs =================================================================== diff -u -r14185c4e29bcfc887fa656a681bdde704d250a9f -re775448bfb8290e43d62340a53a08723bbc035c6 --- Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PresentationObjects/FailureMechanismSectionResultContextTest.cs (.../FailureMechanismSectionResultContextTest.cs) (revision 14185c4e29bcfc887fa656a681bdde704d250a9f) +++ Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PresentationObjects/FailureMechanismSectionResultContextTest.cs (.../FailureMechanismSectionResultContextTest.cs) (revision e775448bfb8290e43d62340a53a08723bbc035c6) @@ -40,13 +40,13 @@ // Setup var mocks = new MockRepository(); var failureMechanismMock = mocks.StrictMock(); + mocks.ReplayAll(); + var failureMechanismSectionResults = new[] { CreateFailureMechanismSectionResult() }; - mocks.ReplayAll(); - // Call var context = new FailureMechanismSectionResultContext(failureMechanismSectionResults, failureMechanismMock); Index: Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PresentationObjects/FailureMechanismSectionsContextTest.cs =================================================================== diff -u -rfac9694977a32d8ce6ae3c1e994b3a13b8aa48fe -re775448bfb8290e43d62340a53a08723bbc035c6 --- Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PresentationObjects/FailureMechanismSectionsContextTest.cs (.../FailureMechanismSectionsContextTest.cs) (revision fac9694977a32d8ce6ae3c1e994b3a13b8aa48fe) +++ Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PresentationObjects/FailureMechanismSectionsContextTest.cs (.../FailureMechanismSectionsContextTest.cs) (revision e775448bfb8290e43d62340a53a08723bbc035c6) @@ -53,19 +53,18 @@ }; var mocks = new MockRepository(); - var failureMechanism = mocks.Stub(); - failureMechanism.Stub(fm => fm.Sections).Return(sectionsSequence); - - var assessmentSection = mocks.Stub(); + var assessmentSectionMock = mocks.StrictMock(); + var failureMechanismMock = mocks.StrictMock(); + failureMechanismMock.Stub(fm => fm.Sections).Return(sectionsSequence); mocks.ReplayAll(); // Call - var context = new FailureMechanismSectionsContext(failureMechanism, assessmentSection); + var context = new FailureMechanismSectionsContext(failureMechanismMock, assessmentSectionMock); // Assert Assert.IsInstanceOf>(context); - Assert.AreSame(failureMechanism, context.WrappedData); - Assert.AreSame(assessmentSection, context.ParentAssessmentSection); + Assert.AreSame(failureMechanismMock, context.WrappedData); + Assert.AreSame(assessmentSectionMock, context.ParentAssessmentSection); mocks.VerifyAll(); } @@ -74,11 +73,11 @@ { // Setup var mocks = new MockRepository(); - var failureMechanism = mocks.Stub(); + var failureMechanismMock = mocks.StrictMock(); mocks.ReplayAll(); // Call - TestDelegate call = () => new FailureMechanismSectionsContext(failureMechanism, null); + TestDelegate call = () => new FailureMechanismSectionsContext(failureMechanismMock, null); // Assert Assert.Throws(call); Index: Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PresentationObjects/ReferenceLineContextTest.cs =================================================================== diff -u -rf01bfd8d4c0541a96d57071b397c39792a99da26 -re775448bfb8290e43d62340a53a08723bbc035c6 --- Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PresentationObjects/ReferenceLineContextTest.cs (.../ReferenceLineContextTest.cs) (revision f01bfd8d4c0541a96d57071b397c39792a99da26) +++ Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PresentationObjects/ReferenceLineContextTest.cs (.../ReferenceLineContextTest.cs) (revision e775448bfb8290e43d62340a53a08723bbc035c6) @@ -34,19 +34,20 @@ public void ParameteredConstructor_ExpectedValues() { // Setup - var referenceLine = new ReferenceLine(); - var mocks = new MockRepository(); - var assessmentSection = mocks.Stub(); - assessmentSection.ReferenceLine = referenceLine; + var assessmentSectionStub = mocks.Stub(); mocks.ReplayAll(); + var referenceLine = new ReferenceLine(); + + assessmentSectionStub.ReferenceLine = referenceLine; + // Call - var referenceLineContext = new ReferenceLineContext(assessmentSection); + var referenceLineContext = new ReferenceLineContext(assessmentSectionStub); // Assert Assert.IsInstanceOf>(referenceLineContext); - Assert.AreSame(assessmentSection, referenceLineContext.WrappedData); + Assert.AreSame(assessmentSectionStub, referenceLineContext.WrappedData); mocks.VerifyAll(); } } Index: Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/PresentationObjects/GrassCoverErosionInwardsCalculationContext.cs =================================================================== diff -u -rb1a215180352084c8f320439c1893c639917f338 -re775448bfb8290e43d62340a53a08723bbc035c6 --- Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/PresentationObjects/GrassCoverErosionInwardsCalculationContext.cs (.../GrassCoverErosionInwardsCalculationContext.cs) (revision b1a215180352084c8f320439c1893c639917f338) +++ Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/PresentationObjects/GrassCoverErosionInwardsCalculationContext.cs (.../GrassCoverErosionInwardsCalculationContext.cs) (revision e775448bfb8290e43d62340a53a08723bbc035c6) @@ -38,7 +38,7 @@ /// The instance wrapped by this context object. /// The failure mechanism which the context belongs to. /// The assessment section which the calculation belongs to. - /// Thrown when any input parameter is null. + /// When any input argument is null. public GrassCoverErosionInwardsCalculationContext(GrassCoverErosionInwardsCalculation calculation, GrassCoverErosionInwardsFailureMechanism failureMechanism, IAssessmentSection assessmentSection) : base(calculation, failureMechanism, assessmentSection) {} } Index: Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/PresentationObjects/GrassCoverErosionInwardsCalculationGroupContext.cs =================================================================== diff -u -rb1a215180352084c8f320439c1893c639917f338 -re775448bfb8290e43d62340a53a08723bbc035c6 --- Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/PresentationObjects/GrassCoverErosionInwardsCalculationGroupContext.cs (.../GrassCoverErosionInwardsCalculationGroupContext.cs) (revision b1a215180352084c8f320439c1893c639917f338) +++ Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/PresentationObjects/GrassCoverErosionInwardsCalculationGroupContext.cs (.../GrassCoverErosionInwardsCalculationGroupContext.cs) (revision e775448bfb8290e43d62340a53a08723bbc035c6) @@ -19,6 +19,7 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. +using System; using Ringtoets.Common.Data.AssessmentSection; using Ringtoets.Common.Data.Calculation; using Ringtoets.Common.Forms.PresentationObjects; @@ -38,6 +39,7 @@ /// The instance wrapped by this context object. /// The failure mechanism which the context belongs to. /// The assessment section which the context belongs to. + /// When any input argument is null. public GrassCoverErosionInwardsCalculationGroupContext(CalculationGroup calculationsGroup, GrassCoverErosionInwardsFailureMechanism failureMechanism, IAssessmentSection assessmentSection) : base(calculationsGroup, failureMechanism, assessmentSection) {} } Index: Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/PresentationObjects/GrassCoverErosionInwardsContext.cs =================================================================== diff -u -r658bc34e6a72d83b209bf9bdf45d1001ca135e51 -re775448bfb8290e43d62340a53a08723bbc035c6 --- Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/PresentationObjects/GrassCoverErosionInwardsContext.cs (.../GrassCoverErosionInwardsContext.cs) (revision 658bc34e6a72d83b209bf9bdf45d1001ca135e51) +++ Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/PresentationObjects/GrassCoverErosionInwardsContext.cs (.../GrassCoverErosionInwardsContext.cs) (revision e775448bfb8290e43d62340a53a08723bbc035c6) @@ -43,7 +43,7 @@ /// The concrete data instance wrapped by this context object. /// The failure mechanism which the context belongs to. /// The assessment section which the context belongs to. - /// When any input parameter is null. + /// When any input argument is null. protected GrassCoverErosionInwardsContext( T wrappedData, GrassCoverErosionInwardsFailureMechanism failureMechanism, Index: Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/PresentationObjects/GrassCoverErosionInwardsFailureMechanismContext.cs =================================================================== diff -u -ra84ad0dc60c583bc68f6c95c57f3499e16a5f3d1 -re775448bfb8290e43d62340a53a08723bbc035c6 --- Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/PresentationObjects/GrassCoverErosionInwardsFailureMechanismContext.cs (.../GrassCoverErosionInwardsFailureMechanismContext.cs) (revision a84ad0dc60c583bc68f6c95c57f3499e16a5f3d1) +++ Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/PresentationObjects/GrassCoverErosionInwardsFailureMechanismContext.cs (.../GrassCoverErosionInwardsFailureMechanismContext.cs) (revision e775448bfb8290e43d62340a53a08723bbc035c6) @@ -36,7 +36,7 @@ /// /// The instance wrapped by this context object. /// The assessment section which the calculation belongs to. - /// Thrown when or is null. + /// When any input argument is null. public GrassCoverErosionInwardsFailureMechanismContext(GrassCoverErosionInwardsFailureMechanism failureMechanism, IAssessmentSection assessmentSection) : base(failureMechanism, assessmentSection) {} } Index: Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/PresentationObjects/GrassCoverErosionInwardsInputContext.cs =================================================================== diff -u -ra84ad0dc60c583bc68f6c95c57f3499e16a5f3d1 -re775448bfb8290e43d62340a53a08723bbc035c6 --- Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/PresentationObjects/GrassCoverErosionInwardsInputContext.cs (.../GrassCoverErosionInwardsInputContext.cs) (revision a84ad0dc60c583bc68f6c95c57f3499e16a5f3d1) +++ Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/PresentationObjects/GrassCoverErosionInwardsInputContext.cs (.../GrassCoverErosionInwardsInputContext.cs) (revision e775448bfb8290e43d62340a53a08723bbc035c6) @@ -40,7 +40,7 @@ /// The calculation item which the belongs to. /// The failure mechanism which the context belongs to. /// The assessment section which the context belongs to. - /// Thrown when any input parameter is null. + /// When any input argument is null. public GrassCoverErosionInwardsInputContext(GrassCoverErosionInwardsInput input, ICalculation calculation, GrassCoverErosionInwardsFailureMechanism failureMechanism, Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/PresentationObjects/GrassCoverErosionInwardsCalculationContextTest.cs =================================================================== diff -u -r0e8590d1ba6edc87a2ac73240662bfcf45f20914 -re775448bfb8290e43d62340a53a08723bbc035c6 --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/PresentationObjects/GrassCoverErosionInwardsCalculationContextTest.cs (.../GrassCoverErosionInwardsCalculationContextTest.cs) (revision 0e8590d1ba6edc87a2ac73240662bfcf45f20914) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/PresentationObjects/GrassCoverErosionInwardsCalculationContextTest.cs (.../GrassCoverErosionInwardsCalculationContextTest.cs) (revision e775448bfb8290e43d62340a53a08723bbc035c6) @@ -31,31 +31,25 @@ [TestFixture] public class GrassCoverErosionInwardsCalculationContextTest { - private MockRepository mocksRepository; - - [SetUp] - public void SetUp() - { - mocksRepository = new MockRepository(); - } - [Test] public void ConstructorWithData_Always_ExpectedPropertiesSet() { // Setup - var calculationMock = mocksRepository.StrictMock(); - var failureMechanismMock = mocksRepository.StrictMock(); + var mocksRepository = new MockRepository(); var assessmentSectionMock = mocksRepository.StrictMock(); mocksRepository.ReplayAll(); + var calculation = new GrassCoverErosionInwardsCalculation(); + var failureMechanism = new GrassCoverErosionInwardsFailureMechanism(); + // Call - var context = new GrassCoverErosionInwardsCalculationContext(calculationMock, failureMechanismMock, assessmentSectionMock); + var context = new GrassCoverErosionInwardsCalculationContext(calculation, failureMechanism, assessmentSectionMock); // Assert Assert.IsInstanceOf>(context); Assert.IsInstanceOf>(context); - Assert.AreEqual(calculationMock, context.WrappedData); - Assert.AreEqual(failureMechanismMock, context.FailureMechanism); + Assert.AreEqual(calculation, context.WrappedData); + Assert.AreEqual(failureMechanism, context.FailureMechanism); Assert.AreEqual(assessmentSectionMock, context.AssessmentSection); mocksRepository.VerifyAll(); } Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/PresentationObjects/GrassCoverErosionInwardsCalculationGroupContextTest.cs =================================================================== diff -u -r255ffcdbfd4ffff68c336ad9922e6196636c2803 -re775448bfb8290e43d62340a53a08723bbc035c6 --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/PresentationObjects/GrassCoverErosionInwardsCalculationGroupContextTest.cs (.../GrassCoverErosionInwardsCalculationGroupContextTest.cs) (revision 255ffcdbfd4ffff68c336ad9922e6196636c2803) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/PresentationObjects/GrassCoverErosionInwardsCalculationGroupContextTest.cs (.../GrassCoverErosionInwardsCalculationGroupContextTest.cs) (revision e775448bfb8290e43d62340a53a08723bbc035c6) @@ -37,19 +37,20 @@ { // Setup var mockRepository = new MockRepository(); - var calculationGroup = new CalculationGroup(); var assessmentSectionMock = mockRepository.StrictMock(); - var failureMechanismMock = mockRepository.StrictMock(); mockRepository.ReplayAll(); + var calculationGroup = new CalculationGroup(); + var failureMechanism = new GrassCoverErosionInwardsFailureMechanism(); + // Call - var groupContext = new GrassCoverErosionInwardsCalculationGroupContext(calculationGroup, failureMechanismMock, assessmentSectionMock); + var groupContext = new GrassCoverErosionInwardsCalculationGroupContext(calculationGroup, failureMechanism, assessmentSectionMock); // Assert Assert.IsInstanceOf>(groupContext); Assert.IsInstanceOf>(groupContext); Assert.AreSame(calculationGroup, groupContext.WrappedData); - Assert.AreSame(failureMechanismMock, groupContext.FailureMechanism); + Assert.AreSame(failureMechanism, groupContext.FailureMechanism); Assert.AreSame(assessmentSectionMock, groupContext.AssessmentSection); mockRepository.VerifyAll(); } Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/PresentationObjects/GrassCoverErosionInwardsContextTest.cs =================================================================== diff -u -r658bc34e6a72d83b209bf9bdf45d1001ca135e51 -re775448bfb8290e43d62340a53a08723bbc035c6 --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/PresentationObjects/GrassCoverErosionInwardsContextTest.cs (.../GrassCoverErosionInwardsContextTest.cs) (revision 658bc34e6a72d83b209bf9bdf45d1001ca135e51) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/PresentationObjects/GrassCoverErosionInwardsContextTest.cs (.../GrassCoverErosionInwardsContextTest.cs) (revision e775448bfb8290e43d62340a53a08723bbc035c6) @@ -36,33 +36,26 @@ [TestFixture] public class GrassCoverErosionInwardsContextTest { - private MockRepository mockRepository; - - [SetUp] - public void SetUp() - { - mockRepository = new MockRepository(); - } - [Test] public void ParameteredConstructor_ExpectedValues() { // Setup + var mockRepository = new MockRepository(); var assessmentSectionMock = mockRepository.StrictMock(); assessmentSectionMock.Expect(asm => asm.HydraulicBoundaryDatabase).Return(null); - var failureMechanismMock = mockRepository.StrictMock(); mockRepository.ReplayAll(); var target = new ObservableObject(); + var failureMechanism = new GrassCoverErosionInwardsFailureMechanism(); // Call - var context = new SimpleGrassCoverErosionInwardsContext(target, failureMechanismMock, assessmentSectionMock); + var context = new SimpleGrassCoverErosionInwardsContext(target, failureMechanism, assessmentSectionMock); // Assert Assert.IsInstanceOf>(context); Assert.AreSame(target, context.WrappedData); Assert.AreSame(assessmentSectionMock, context.AssessmentSection); - Assert.AreSame(failureMechanismMock, context.FailureMechanism); + Assert.AreSame(failureMechanism, context.FailureMechanism); CollectionAssert.IsEmpty(context.AvailableHydraulicBoundaryLocations); mockRepository.VerifyAll(); } @@ -71,6 +64,7 @@ public void ParameteredConstructor_FailureMechanismIsNull_ThrowsArgumentNullException() { // Setup + var mockRepository = new MockRepository(); var assessmentSectionMock = mockRepository.StrictMock(); mockRepository.ReplayAll(); @@ -88,17 +82,14 @@ public void ParameteredConstructor_AssessmentSectionIsNull_ThrowsArgumentNullException() { // Setup - var failureMechanismMock = mockRepository.StrictMock(); - mockRepository.ReplayAll(); - var observableObject = new ObservableObject(); + var failureMechanism = new GrassCoverErosionInwardsFailureMechanism(); // Call - TestDelegate call = () => new SimpleGrassCoverErosionInwardsContext(observableObject, failureMechanismMock, null); + TestDelegate call = () => new SimpleGrassCoverErosionInwardsContext(observableObject, failureMechanism, null); // Assert TestHelper.AssertThrowsArgumentExceptionAndTestMessage(call, "Het traject mag niet 'null' zijn."); - mockRepository.VerifyAll(); } [Test] @@ -107,13 +98,15 @@ // Setup var hydraulicBoundaryDatabase = new HydraulicBoundaryDatabase(); hydraulicBoundaryDatabase.Locations.Add(new HydraulicBoundaryLocation(1, "name", 1.1, 2.2)); + + var mockRepository = new MockRepository(); var assessmentSectionMock = mockRepository.StrictMock(); assessmentSectionMock.Expect(asm => asm.HydraulicBoundaryDatabase).Return(hydraulicBoundaryDatabase).Repeat.Twice(); - var failureMechanismMock = mockRepository.StrictMock(); mockRepository.ReplayAll(); + var failureMechanism = new GrassCoverErosionInwardsFailureMechanism(); var target = new ObservableObject(); - var context = new SimpleGrassCoverErosionInwardsContext(target, failureMechanismMock, assessmentSectionMock); + var context = new SimpleGrassCoverErosionInwardsContext(target, failureMechanism, assessmentSectionMock); // Call var availableHydraulicBoundaryLocations = context.AvailableHydraulicBoundaryLocations; Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/PresentationObjects/GrassCoverErosionInwardsFailureMechanismContextTest.cs =================================================================== diff -u -r14185c4e29bcfc887fa656a681bdde704d250a9f -re775448bfb8290e43d62340a53a08723bbc035c6 --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/PresentationObjects/GrassCoverErosionInwardsFailureMechanismContextTest.cs (.../GrassCoverErosionInwardsFailureMechanismContextTest.cs) (revision 14185c4e29bcfc887fa656a681bdde704d250a9f) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/PresentationObjects/GrassCoverErosionInwardsFailureMechanismContextTest.cs (.../GrassCoverErosionInwardsFailureMechanismContextTest.cs) (revision e775448bfb8290e43d62340a53a08723bbc035c6) @@ -37,17 +37,17 @@ { // Setup var mocks = new MockRepository(); - var assessmentSection = mocks.Stub(); + var assessmentSectionMock = mocks.StrictMock(); mocks.ReplayAll(); var failureMechanism = new GrassCoverErosionInwardsFailureMechanism(); // Call - var context = new GrassCoverErosionInwardsFailureMechanismContext(failureMechanism, assessmentSection); + var context = new GrassCoverErosionInwardsFailureMechanismContext(failureMechanism, assessmentSectionMock); // Assert Assert.IsInstanceOf>(context); - Assert.AreSame(assessmentSection, context.Parent); + Assert.AreSame(assessmentSectionMock, context.Parent); Assert.AreSame(failureMechanism, context.WrappedData); mocks.VerifyAll(); } Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/PresentationObjects/GrassCoverErosionInwardsInputContextTest.cs =================================================================== diff -u -rdd776cec9fe4d6fe0c3276dbb2ed371c72d43082 -re775448bfb8290e43d62340a53a08723bbc035c6 --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/PresentationObjects/GrassCoverErosionInwardsInputContextTest.cs (.../GrassCoverErosionInwardsInputContextTest.cs) (revision dd776cec9fe4d6fe0c3276dbb2ed371c72d43082) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/PresentationObjects/GrassCoverErosionInwardsInputContextTest.cs (.../GrassCoverErosionInwardsInputContextTest.cs) (revision e775448bfb8290e43d62340a53a08723bbc035c6) @@ -24,7 +24,6 @@ using NUnit.Framework; using Rhino.Mocks; using Ringtoets.Common.Data.AssessmentSection; -using Ringtoets.Common.Data.Calculation; using Ringtoets.GrassCoverErosionInwards.Data; using Ringtoets.GrassCoverErosionInwards.Forms.PresentationObjects; using Ringtoets.GrassCoverErosionInwards.Forms.Properties; @@ -46,20 +45,21 @@ public void ConstructorWithData_Always_ExpectedPropertiesSet() { // Setup - var inputMock = mocksRepository.StrictMock(); - var calculationMock = mocksRepository.StrictMock(); - var failureMechanismMock = mocksRepository.StrictMock(); var assessmentSectionMock = mocksRepository.StrictMock(); mocksRepository.ReplayAll(); + var input = new GrassCoverErosionInwardsInput(); + var calculation = new GrassCoverErosionInwardsCalculation(); + var failureMechanism = new GrassCoverErosionInwardsFailureMechanism(); + // Call - var context = new GrassCoverErosionInwardsInputContext(inputMock, calculationMock, failureMechanismMock, assessmentSectionMock); + var context = new GrassCoverErosionInwardsInputContext(input, calculation, failureMechanism, assessmentSectionMock); // Assert Assert.IsInstanceOf>(context); - Assert.AreEqual(inputMock, context.WrappedData); - Assert.AreEqual(calculationMock, context.Calculation); - Assert.AreEqual(failureMechanismMock, context.FailureMechanism); + Assert.AreEqual(input, context.WrappedData); + Assert.AreEqual(calculation, context.Calculation); + Assert.AreEqual(failureMechanism, context.FailureMechanism); Assert.AreEqual(assessmentSectionMock, context.AssessmentSection); mocksRepository.VerifyAll(); } @@ -68,13 +68,14 @@ public void Constructor_NullCalculation_ThrowsArgumentNullException() { // Setup - var inputMock = mocksRepository.StrictMock(); - var failureMechanismMock = mocksRepository.StrictMock(); var assessmentSectionMock = mocksRepository.StrictMock(); mocksRepository.ReplayAll(); + var input = new GrassCoverErosionInwardsInput(); + var failureMechanism = new GrassCoverErosionInwardsFailureMechanism(); + // Call - TestDelegate test = () => new GrassCoverErosionInwardsInputContext(inputMock, null, failureMechanismMock, assessmentSectionMock); + TestDelegate test = () => new GrassCoverErosionInwardsInputContext(input, null, failureMechanism, assessmentSectionMock); // Assert var message = String.Format(Resources.GrassCoverErosionInwardsContext_AssertInputsAreNotNull_DataDescription_0_cannot_be_null, Index: Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Forms/PresentationObjects/HeightStructuresCalculationContext.cs =================================================================== diff -u -rb04aec5d2e0dbedb3badb9aee6cb533f1efbf543 -re775448bfb8290e43d62340a53a08723bbc035c6 --- Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Forms/PresentationObjects/HeightStructuresCalculationContext.cs (.../HeightStructuresCalculationContext.cs) (revision b04aec5d2e0dbedb3badb9aee6cb533f1efbf543) +++ Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Forms/PresentationObjects/HeightStructuresCalculationContext.cs (.../HeightStructuresCalculationContext.cs) (revision e775448bfb8290e43d62340a53a08723bbc035c6) @@ -38,7 +38,7 @@ /// The instance wrapped by this context object. /// The failure mechanism which the context belongs to. /// The assessment section which the calculation belongs to. - /// Thrown when any input parameter is null. + /// When any input argument is null. public HeightStructuresCalculationContext(HeightStructuresCalculation calculation, HeightStructuresFailureMechanism failureMechanism, IAssessmentSection assessmentSection) : base(calculation, failureMechanism, assessmentSection) { } } Index: Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Forms/PresentationObjects/HeightStructuresCalculationGroupContext.cs =================================================================== diff -u -r9c97b82cdd55ddd5fbe5143110bbbbf576bda162 -re775448bfb8290e43d62340a53a08723bbc035c6 --- Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Forms/PresentationObjects/HeightStructuresCalculationGroupContext.cs (.../HeightStructuresCalculationGroupContext.cs) (revision 9c97b82cdd55ddd5fbe5143110bbbbf576bda162) +++ Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Forms/PresentationObjects/HeightStructuresCalculationGroupContext.cs (.../HeightStructuresCalculationGroupContext.cs) (revision e775448bfb8290e43d62340a53a08723bbc035c6) @@ -19,6 +19,7 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. +using System; using Ringtoets.Common.Data.AssessmentSection; using Ringtoets.Common.Data.Calculation; using Ringtoets.Common.Forms.PresentationObjects; @@ -38,6 +39,7 @@ /// The instance wrapped by this context object. /// The failure mechanism which the context belongs to. /// The assessment section which the context belongs to. + /// When any input argument is null. public HeightStructuresCalculationGroupContext(CalculationGroup calculationsGroup, HeightStructuresFailureMechanism failureMechanism, IAssessmentSection assessmentSection) : base(calculationsGroup, failureMechanism, assessmentSection) {} } Index: Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Forms/PresentationObjects/HeightStructuresContext.cs =================================================================== diff -u -r658bc34e6a72d83b209bf9bdf45d1001ca135e51 -re775448bfb8290e43d62340a53a08723bbc035c6 --- Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Forms/PresentationObjects/HeightStructuresContext.cs (.../HeightStructuresContext.cs) (revision 658bc34e6a72d83b209bf9bdf45d1001ca135e51) +++ Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Forms/PresentationObjects/HeightStructuresContext.cs (.../HeightStructuresContext.cs) (revision e775448bfb8290e43d62340a53a08723bbc035c6) @@ -43,7 +43,7 @@ /// The concrete data instance wrapped by this context object. /// The failure mechanism which the context belongs to. /// The assessment section which the context belongs to. - /// When any input parameter is null. + /// When any input argument is null. protected HeightStructuresContext( T wrappedData, HeightStructuresFailureMechanism failureMechanism, Index: Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Forms/PresentationObjects/HeightStructuresFailureMechanismContext.cs =================================================================== diff -u -r585c9f51efb215f4ead02e4b2c9a69d51fbfd07c -re775448bfb8290e43d62340a53a08723bbc035c6 --- Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Forms/PresentationObjects/HeightStructuresFailureMechanismContext.cs (.../HeightStructuresFailureMechanismContext.cs) (revision 585c9f51efb215f4ead02e4b2c9a69d51fbfd07c) +++ Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Forms/PresentationObjects/HeightStructuresFailureMechanismContext.cs (.../HeightStructuresFailureMechanismContext.cs) (revision e775448bfb8290e43d62340a53a08723bbc035c6) @@ -36,7 +36,7 @@ /// /// The instance wrapped by this context object. /// The assessment section which the failure mechanism belongs to. - /// Thrown when or is null. + /// When any input argument is null. public HeightStructuresFailureMechanismContext(HeightStructuresFailureMechanism wrappedFailureMechanism, IAssessmentSection parent) : base(wrappedFailureMechanism, parent) {} } Index: Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Forms/PresentationObjects/HeightStructuresInputContext.cs =================================================================== diff -u -r20231cfee041a316978347564bd1fddbb41b9ffc -re775448bfb8290e43d62340a53a08723bbc035c6 --- Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Forms/PresentationObjects/HeightStructuresInputContext.cs (.../HeightStructuresInputContext.cs) (revision 20231cfee041a316978347564bd1fddbb41b9ffc) +++ Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Forms/PresentationObjects/HeightStructuresInputContext.cs (.../HeightStructuresInputContext.cs) (revision e775448bfb8290e43d62340a53a08723bbc035c6) @@ -40,7 +40,7 @@ /// The calculation item which the belongs to. /// The failure mechanism which the context belongs to. /// The assessment section which the context belongs to. - /// Thrown when any input parameter is null. + /// When any input argument is null. public HeightStructuresInputContext(HeightStructuresInput input, ICalculation calculation, HeightStructuresFailureMechanism failureMechanism, Index: Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/PresentationObjects/HeightStructuresCalculationContextTest.cs =================================================================== diff -u -rea180de6e9f5ba1108b4ff3cf7bb7e57de72a37a -re775448bfb8290e43d62340a53a08723bbc035c6 --- Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/PresentationObjects/HeightStructuresCalculationContextTest.cs (.../HeightStructuresCalculationContextTest.cs) (revision ea180de6e9f5ba1108b4ff3cf7bb7e57de72a37a) +++ Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/PresentationObjects/HeightStructuresCalculationContextTest.cs (.../HeightStructuresCalculationContextTest.cs) (revision e775448bfb8290e43d62340a53a08723bbc035c6) @@ -31,23 +31,17 @@ [TestFixture] public class HeightStructuresCalculationContextTest { - private MockRepository mocksRepository; - - [SetUp] - public void SetUp() - { - mocksRepository = new MockRepository(); - } - [Test] public void ConstructorWithData_Always_ExpectedPropertiesSet() { // Setup - var failureMechanism = new HeightStructuresFailureMechanism(); - var calculation = new HeightStructuresCalculation(); + var mocksRepository = new MockRepository(); var assessmentSectionMock = mocksRepository.StrictMock(); mocksRepository.ReplayAll(); + var calculation = new HeightStructuresCalculation(); + var failureMechanism = new HeightStructuresFailureMechanism(); + // Call var context = new HeightStructuresCalculationContext(calculation, failureMechanism, assessmentSectionMock); Index: Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/PresentationObjects/HeightStructuresCalculationGroupContextTest.cs =================================================================== diff -u -r255ffcdbfd4ffff68c336ad9922e6196636c2803 -re775448bfb8290e43d62340a53a08723bbc035c6 --- Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/PresentationObjects/HeightStructuresCalculationGroupContextTest.cs (.../HeightStructuresCalculationGroupContextTest.cs) (revision 255ffcdbfd4ffff68c336ad9922e6196636c2803) +++ Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/PresentationObjects/HeightStructuresCalculationGroupContextTest.cs (.../HeightStructuresCalculationGroupContextTest.cs) (revision e775448bfb8290e43d62340a53a08723bbc035c6) @@ -37,19 +37,20 @@ { // Setup var mockRepository = new MockRepository(); - var calculationGroup = new CalculationGroup(); var assessmentSectionMock = mockRepository.StrictMock(); - var failureMechanismMock = mockRepository.StrictMock(); mockRepository.ReplayAll(); + var calculationGroup = new CalculationGroup(); + var failureMechanism = new HeightStructuresFailureMechanism(); + // Call - var groupContext = new HeightStructuresCalculationGroupContext(calculationGroup, failureMechanismMock, assessmentSectionMock); + var groupContext = new HeightStructuresCalculationGroupContext(calculationGroup, failureMechanism, assessmentSectionMock); // Assert Assert.IsInstanceOf>(groupContext); Assert.IsInstanceOf>(groupContext); Assert.AreSame(calculationGroup, groupContext.WrappedData); - Assert.AreSame(failureMechanismMock, groupContext.FailureMechanism); + Assert.AreSame(failureMechanism, groupContext.FailureMechanism); Assert.AreSame(assessmentSectionMock, groupContext.AssessmentSection); mockRepository.VerifyAll(); } Index: Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/PresentationObjects/HeightStructuresContextTest.cs =================================================================== diff -u -r658bc34e6a72d83b209bf9bdf45d1001ca135e51 -re775448bfb8290e43d62340a53a08723bbc035c6 --- Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/PresentationObjects/HeightStructuresContextTest.cs (.../HeightStructuresContextTest.cs) (revision 658bc34e6a72d83b209bf9bdf45d1001ca135e51) +++ Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/PresentationObjects/HeightStructuresContextTest.cs (.../HeightStructuresContextTest.cs) (revision e775448bfb8290e43d62340a53a08723bbc035c6) @@ -36,39 +36,33 @@ [TestFixture] public class HeightStructuresContextTest { - private MockRepository mockRepository; - - [SetUp] - public void SetUp() - { - mockRepository = new MockRepository(); - } - [Test] public void ParameteredConstructor_ExpectedValues() { // Setup + var mockRepository = new MockRepository(); var assessmentSectionMock = mockRepository.StrictMock(); - var failureMechanismMock = mockRepository.StrictMock(); mockRepository.ReplayAll(); var target = new ObservableObject(); + var failureMechanism = new HeightStructuresFailureMechanism(); // Call - var context = new SimpleHeightStructuresContext(target, failureMechanismMock, assessmentSectionMock); + var context = new SimpleHeightStructuresContext(target, failureMechanism, assessmentSectionMock); // Assert Assert.IsInstanceOf>(context); Assert.AreSame(target, context.WrappedData); Assert.AreSame(assessmentSectionMock, context.AssessmentSection); - Assert.AreSame(failureMechanismMock, context.FailureMechanism); + Assert.AreSame(failureMechanism, context.FailureMechanism); mockRepository.VerifyAll(); } [Test] public void ParameteredConstructor_FailureMechanismIsNull_ThrowsArgumentNullException() { // Setup + var mockRepository = new MockRepository(); var assessmentSectionMock = mockRepository.StrictMock(); mockRepository.ReplayAll(); @@ -86,17 +80,14 @@ public void ParameteredConstructor_AssessmentSectionIsNull_ThrowsArgumentNullException() { // Setup - var failureMechanismMock = mockRepository.StrictMock(); - mockRepository.ReplayAll(); - var observableObject = new ObservableObject(); + var failureMechanism = new HeightStructuresFailureMechanism(); // Call - TestDelegate call = () => new SimpleHeightStructuresContext(observableObject, failureMechanismMock, null); + TestDelegate call = () => new SimpleHeightStructuresContext(observableObject, failureMechanism, null); // Assert TestHelper.AssertThrowsArgumentExceptionAndTestMessage(call, "Het traject mag niet 'null' zijn."); - mockRepository.VerifyAll(); } [Test] @@ -105,13 +96,15 @@ // Setup var hydraulicBoundaryDatabase = new HydraulicBoundaryDatabase(); hydraulicBoundaryDatabase.Locations.Add(new HydraulicBoundaryLocation(1, "name", 1.1, 2.2)); - var assessmentSectionMock = mockRepository.Stub(); - assessmentSectionMock.HydraulicBoundaryDatabase = hydraulicBoundaryDatabase; + + var mockRepository = new MockRepository(); + var assessmentSectionStub = mockRepository.Stub(); + assessmentSectionStub.HydraulicBoundaryDatabase = hydraulicBoundaryDatabase; mockRepository.ReplayAll(); - var failureMechanism = new HeightStructuresFailureMechanism(); var target = new ObservableObject(); - var context = new SimpleHeightStructuresContext(target, failureMechanism, assessmentSectionMock); + var failureMechanism = new HeightStructuresFailureMechanism(); + var context = new SimpleHeightStructuresContext(target, failureMechanism, assessmentSectionStub); // Call var availableHydraulicBoundaryLocations = context.AvailableHydraulicBoundaryLocations; Index: Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/PresentationObjects/HeightStructuresFailureMechanismContextTest.cs =================================================================== diff -u -r14185c4e29bcfc887fa656a681bdde704d250a9f -re775448bfb8290e43d62340a53a08723bbc035c6 --- Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/PresentationObjects/HeightStructuresFailureMechanismContextTest.cs (.../HeightStructuresFailureMechanismContextTest.cs) (revision 14185c4e29bcfc887fa656a681bdde704d250a9f) +++ Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/PresentationObjects/HeightStructuresFailureMechanismContextTest.cs (.../HeightStructuresFailureMechanismContextTest.cs) (revision e775448bfb8290e43d62340a53a08723bbc035c6) @@ -37,17 +37,17 @@ { // Setup var mocks = new MockRepository(); - var assessmentSection = mocks.Stub(); + var assessmentSectionMock = mocks.StrictMock(); mocks.ReplayAll(); var failureMechanism = new HeightStructuresFailureMechanism(); // Call - var context = new HeightStructuresFailureMechanismContext(failureMechanism, assessmentSection); + var context = new HeightStructuresFailureMechanismContext(failureMechanism, assessmentSectionMock); // Assert Assert.IsInstanceOf>(context); - Assert.AreSame(assessmentSection, context.Parent); + Assert.AreSame(assessmentSectionMock, context.Parent); Assert.AreSame(failureMechanism, context.WrappedData); mocks.VerifyAll(); } Index: Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/PresentationObjects/HeightStructuresInputContextTest.cs =================================================================== diff -u -r7f4ee0fa245a18426c81c11c8f9ea18e73e42d07 -re775448bfb8290e43d62340a53a08723bbc035c6 --- Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/PresentationObjects/HeightStructuresInputContextTest.cs (.../HeightStructuresInputContextTest.cs) (revision 7f4ee0fa245a18426c81c11c8f9ea18e73e42d07) +++ Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/PresentationObjects/HeightStructuresInputContextTest.cs (.../HeightStructuresInputContextTest.cs) (revision e775448bfb8290e43d62340a53a08723bbc035c6) @@ -24,7 +24,6 @@ using NUnit.Framework; using Rhino.Mocks; using Ringtoets.Common.Data.AssessmentSection; -using Ringtoets.Common.Data.Calculation; using Ringtoets.HeightStructures.Data; using Ringtoets.HeightStructures.Forms.PresentationObjects; using Ringtoets.HeightStructures.Forms.Properties; @@ -46,20 +45,21 @@ public void ConstructorWithData_Always_ExpectedPropertiesSet() { // Setup - var input = new HeightStructuresInput(); - var calculationMock = mocksRepository.StrictMock(); - var failureMechanismMock = mocksRepository.StrictMock(); var assessmentSectionMock = mocksRepository.StrictMock(); mocksRepository.ReplayAll(); + var input = new HeightStructuresInput(); + var calculation = new HeightStructuresCalculation(); + var failureMechanism = new HeightStructuresFailureMechanism(); + // Call - var context = new HeightStructuresInputContext(input, calculationMock, failureMechanismMock, assessmentSectionMock); + var context = new HeightStructuresInputContext(input, calculation, failureMechanism, assessmentSectionMock); // Assert Assert.IsInstanceOf>(context); Assert.AreEqual(input, context.WrappedData); - Assert.AreEqual(calculationMock, context.Calculation); - Assert.AreEqual(failureMechanismMock, context.FailureMechanism); + Assert.AreEqual(calculation, context.Calculation); + Assert.AreEqual(failureMechanism, context.FailureMechanism); Assert.AreEqual(assessmentSectionMock, context.AssessmentSection); mocksRepository.VerifyAll(); } @@ -68,13 +68,14 @@ public void Constructor_NullCalculation_ThrowsArgumentNullException() { // Setup - var input = new HeightStructuresInput(); - var failureMechanismMock = mocksRepository.StrictMock(); var assessmentSectionMock = mocksRepository.StrictMock(); mocksRepository.ReplayAll(); + var input = new HeightStructuresInput(); + var failureMechanism = new HeightStructuresFailureMechanism(); + // Call - TestDelegate test = () => new HeightStructuresInputContext(input, null, failureMechanismMock, assessmentSectionMock); + TestDelegate test = () => new HeightStructuresInputContext(input, null, failureMechanism, assessmentSectionMock); // Assert var message = String.Format(Resources.HeightStructuresContext_AssertInputsAreNotNull_DataDescription_0_cannot_be_null, Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PresentationObjects/HydraulicBoundaryDatabaseContextTest.cs =================================================================== diff -u -r63fbdd5525927fbf9d63925eef9da8e17a0d7b44 -re775448bfb8290e43d62340a53a08723bbc035c6 --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PresentationObjects/HydraulicBoundaryDatabaseContextTest.cs (.../HydraulicBoundaryDatabaseContextTest.cs) (revision 63fbdd5525927fbf9d63925eef9da8e17a0d7b44) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PresentationObjects/HydraulicBoundaryDatabaseContextTest.cs (.../HydraulicBoundaryDatabaseContextTest.cs) (revision e775448bfb8290e43d62340a53a08723bbc035c6) @@ -44,6 +44,7 @@ // Assert Assert.IsInstanceOf>(pressentationObject); Assert.AreSame(assessmentSectionMock, pressentationObject.WrappedData); + mocks.VerifyAll(); } } } \ No newline at end of file Index: Ringtoets/Piping/src/Ringtoets.Piping.Forms/PresentationObjects/PipingCalculationGroupContext.cs =================================================================== diff -u -rb1a215180352084c8f320439c1893c639917f338 -re775448bfb8290e43d62340a53a08723bbc035c6 --- Ringtoets/Piping/src/Ringtoets.Piping.Forms/PresentationObjects/PipingCalculationGroupContext.cs (.../PipingCalculationGroupContext.cs) (revision b1a215180352084c8f320439c1893c639917f338) +++ Ringtoets/Piping/src/Ringtoets.Piping.Forms/PresentationObjects/PipingCalculationGroupContext.cs (.../PipingCalculationGroupContext.cs) (revision e775448bfb8290e43d62340a53a08723bbc035c6) @@ -19,6 +19,7 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. +using System; using System.Collections.Generic; using Ringtoets.Common.Data.AssessmentSection; using Ringtoets.Common.Data.Calculation; @@ -42,6 +43,7 @@ /// The stochastic soil models available within the piping context. /// The piping failure mechanism which the piping context belongs to. /// The assessment section which the piping context belongs to. + /// When any input argument is null. public PipingCalculationGroupContext(CalculationGroup calculationGroup, IEnumerable surfaceLines, IEnumerable stochasticSoilModels, PipingFailureMechanism pipingFailureMechanism, IAssessmentSection assessmentSection) : base(calculationGroup, surfaceLines, stochasticSoilModels, pipingFailureMechanism, assessmentSection) {} } Index: Ringtoets/Piping/src/Ringtoets.Piping.Forms/PresentationObjects/PipingCalculationScenarioContext.cs =================================================================== diff -u -r6821ff075261a98f42221ccc796d007ca11a93fe -re775448bfb8290e43d62340a53a08723bbc035c6 --- Ringtoets/Piping/src/Ringtoets.Piping.Forms/PresentationObjects/PipingCalculationScenarioContext.cs (.../PipingCalculationScenarioContext.cs) (revision 6821ff075261a98f42221ccc796d007ca11a93fe) +++ Ringtoets/Piping/src/Ringtoets.Piping.Forms/PresentationObjects/PipingCalculationScenarioContext.cs (.../PipingCalculationScenarioContext.cs) (revision e775448bfb8290e43d62340a53a08723bbc035c6) @@ -19,6 +19,7 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. +using System; using System.Collections.Generic; using Ringtoets.Common.Data.AssessmentSection; using Ringtoets.Common.Forms.PresentationObjects; @@ -41,6 +42,7 @@ /// The stochastic soil models available within the piping context. /// The piping failure mechanism which the piping context belongs to. /// The assessment section which the piping context belongs to. + /// When any input argument is null. public PipingCalculationScenarioContext(PipingCalculationScenario calculation, IEnumerable surfaceLines, IEnumerable stochasticSoilModels, PipingFailureMechanism pipingFailureMechanism, IAssessmentSection assessmentSection) : base(calculation, surfaceLines, stochasticSoilModels, pipingFailureMechanism, assessmentSection) {} } Index: Ringtoets/Piping/src/Ringtoets.Piping.Forms/PresentationObjects/PipingContext.cs =================================================================== diff -u -r658bc34e6a72d83b209bf9bdf45d1001ca135e51 -re775448bfb8290e43d62340a53a08723bbc035c6 --- Ringtoets/Piping/src/Ringtoets.Piping.Forms/PresentationObjects/PipingContext.cs (.../PipingContext.cs) (revision 658bc34e6a72d83b209bf9bdf45d1001ca135e51) +++ Ringtoets/Piping/src/Ringtoets.Piping.Forms/PresentationObjects/PipingContext.cs (.../PipingContext.cs) (revision e775448bfb8290e43d62340a53a08723bbc035c6) @@ -47,7 +47,7 @@ /// The stochastic soil models available within the piping context. /// The piping failure mechanism which the piping context belongs to. /// The assessment section which the piping context belongs to. - /// When any input parameter is null. + /// When any input argument is null. protected PipingContext( T wrappedData, IEnumerable surfaceLines, Index: Ringtoets/Piping/src/Ringtoets.Piping.Forms/PresentationObjects/PipingFailureMechanismContext.cs =================================================================== diff -u -rdebefef18429127ee0963736030450abf4390cee -re775448bfb8290e43d62340a53a08723bbc035c6 --- Ringtoets/Piping/src/Ringtoets.Piping.Forms/PresentationObjects/PipingFailureMechanismContext.cs (.../PipingFailureMechanismContext.cs) (revision debefef18429127ee0963736030450abf4390cee) +++ Ringtoets/Piping/src/Ringtoets.Piping.Forms/PresentationObjects/PipingFailureMechanismContext.cs (.../PipingFailureMechanismContext.cs) (revision e775448bfb8290e43d62340a53a08723bbc035c6) @@ -36,7 +36,7 @@ /// /// The failure mechanism. /// The parent of . - /// Thrown when or is null. + /// When any input argument is null. public PipingFailureMechanismContext(PipingFailureMechanism failureMechanism, IAssessmentSection assessmentSection) : base(failureMechanism, assessmentSection) {} } Index: Ringtoets/Piping/src/Ringtoets.Piping.Forms/PresentationObjects/PipingInputContext.cs =================================================================== diff -u -rb1a215180352084c8f320439c1893c639917f338 -re775448bfb8290e43d62340a53a08723bbc035c6 --- Ringtoets/Piping/src/Ringtoets.Piping.Forms/PresentationObjects/PipingInputContext.cs (.../PipingInputContext.cs) (revision b1a215180352084c8f320439c1893c639917f338) +++ Ringtoets/Piping/src/Ringtoets.Piping.Forms/PresentationObjects/PipingInputContext.cs (.../PipingInputContext.cs) (revision e775448bfb8290e43d62340a53a08723bbc035c6) @@ -44,7 +44,7 @@ /// The stochastic soil models available within the piping context. /// The failure mechanism which the piping context belongs to. /// The assessment section which the piping context belongs to. - /// When any input parameter is null. + /// When any input argument is null. public PipingInputContext(PipingInput pipingInput, PipingCalculationScenario calculation, IEnumerable surfaceLines, Index: Ringtoets/Piping/src/Ringtoets.Piping.Forms/PresentationObjects/RingtoetsPipingSurfaceLinesContext.cs =================================================================== diff -u -r63fbdd5525927fbf9d63925eef9da8e17a0d7b44 -re775448bfb8290e43d62340a53a08723bbc035c6 --- Ringtoets/Piping/src/Ringtoets.Piping.Forms/PresentationObjects/RingtoetsPipingSurfaceLinesContext.cs (.../RingtoetsPipingSurfaceLinesContext.cs) (revision 63fbdd5525927fbf9d63925eef9da8e17a0d7b44) +++ Ringtoets/Piping/src/Ringtoets.Piping.Forms/PresentationObjects/RingtoetsPipingSurfaceLinesContext.cs (.../RingtoetsPipingSurfaceLinesContext.cs) (revision e775448bfb8290e43d62340a53a08723bbc035c6) @@ -36,8 +36,9 @@ /// /// The failure mechanism to wrap. /// The assessment section. - /// Thrown when or is null. - public RingtoetsPipingSurfaceLinesContext(PipingFailureMechanism wrappedFailureMechanism, IAssessmentSection assessmentSection) : base(wrappedFailureMechanism) + /// When any input argument is null. + public RingtoetsPipingSurfaceLinesContext(PipingFailureMechanism wrappedFailureMechanism, IAssessmentSection assessmentSection) + : base(wrappedFailureMechanism) { if (assessmentSection == null) { Index: Ringtoets/Piping/src/Ringtoets.Piping.Forms/PresentationObjects/StochasticSoilModelContext.cs =================================================================== diff -u -rdebefef18429127ee0963736030450abf4390cee -re775448bfb8290e43d62340a53a08723bbc035c6 --- Ringtoets/Piping/src/Ringtoets.Piping.Forms/PresentationObjects/StochasticSoilModelContext.cs (.../StochasticSoilModelContext.cs) (revision debefef18429127ee0963736030450abf4390cee) +++ Ringtoets/Piping/src/Ringtoets.Piping.Forms/PresentationObjects/StochasticSoilModelContext.cs (.../StochasticSoilModelContext.cs) (revision e775448bfb8290e43d62340a53a08723bbc035c6) @@ -38,7 +38,7 @@ /// The stochastic soil models to wrap. /// The failure mechanism. /// The assessment section. - /// Thrown when any of the parameters is null. + /// When any input argument is null. public StochasticSoilModelContext(ObservableList wrappedStochasticSoilModels, PipingFailureMechanism failureMechanism, IAssessmentSection assessmentSection) Index: Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/PresentationObjects/PipingCalculationGroupContextTest.cs =================================================================== diff -u -r14185c4e29bcfc887fa656a681bdde704d250a9f -re775448bfb8290e43d62340a53a08723bbc035c6 --- Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/PresentationObjects/PipingCalculationGroupContextTest.cs (.../PipingCalculationGroupContextTest.cs) (revision 14185c4e29bcfc887fa656a681bdde704d250a9f) +++ Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/PresentationObjects/PipingCalculationGroupContextTest.cs (.../PipingCalculationGroupContextTest.cs) (revision e775448bfb8290e43d62340a53a08723bbc035c6) @@ -18,6 +18,10 @@ public void ParameteredConstructor_ExpectedValues() { // Setup + var mocks = new MockRepository(); + var assessmentSectionMock = mocks.StrictMock(); + mocks.ReplayAll(); + var calculationGroup = new CalculationGroup(); var surfaceLines = new[] { @@ -28,13 +32,10 @@ new TestStochasticSoilModel() }; - var mocks = new MockRepository(); - var assessmentSection = mocks.StrictMock(); - var pipingFailureMechanismMock = mocks.StrictMock(); - mocks.ReplayAll(); + var failureMechanism = new PipingFailureMechanism(); // Call - var groupContext = new PipingCalculationGroupContext(calculationGroup, surfaceLines, soilModels, pipingFailureMechanismMock, assessmentSection); + var groupContext = new PipingCalculationGroupContext(calculationGroup, surfaceLines, soilModels, failureMechanism, assessmentSectionMock); // Assert Assert.IsInstanceOf(groupContext); @@ -43,8 +44,9 @@ Assert.AreSame(calculationGroup, groupContext.WrappedData); Assert.AreSame(surfaceLines, groupContext.AvailablePipingSurfaceLines); Assert.AreSame(soilModels, groupContext.AvailableStochasticSoilModels); - Assert.AreSame(pipingFailureMechanismMock, groupContext.FailureMechanism); - Assert.AreSame(assessmentSection, groupContext.AssessmentSection); + Assert.AreSame(failureMechanism, groupContext.FailureMechanism); + Assert.AreSame(assessmentSectionMock, groupContext.AssessmentSection); + mocks.VerifyAll(); } } } \ No newline at end of file Index: Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/PresentationObjects/PipingCalculationScenarioContextTest.cs =================================================================== diff -u -r14185c4e29bcfc887fa656a681bdde704d250a9f -re775448bfb8290e43d62340a53a08723bbc035c6 --- Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/PresentationObjects/PipingCalculationScenarioContextTest.cs (.../PipingCalculationScenarioContextTest.cs) (revision 14185c4e29bcfc887fa656a681bdde704d250a9f) +++ Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/PresentationObjects/PipingCalculationScenarioContextTest.cs (.../PipingCalculationScenarioContextTest.cs) (revision e775448bfb8290e43d62340a53a08723bbc035c6) @@ -17,6 +17,10 @@ public void DefaultConstructor_ExpectedValues() { // Setup + var mocks = new MockRepository(); + var assessmentSectionMock = mocks.StrictMock(); + mocks.ReplayAll(); + var surfacelines = new[] { new RingtoetsPipingSurfaceLine() @@ -26,14 +30,10 @@ new TestStochasticSoilModel() }; var calculation = new PipingCalculationScenario(new GeneralPipingInput()); + var failureMechanism = new PipingFailureMechanism(); - var mocks = new MockRepository(); - var pipingFailureMechanismMock = mocks.StrictMock(); - var assessmentSectionMock = mocks.StrictMock(); - mocks.ReplayAll(); - // Call - var presentationObject = new PipingCalculationScenarioContext(calculation, surfacelines, soilModels, pipingFailureMechanismMock, assessmentSectionMock); + var presentationObject = new PipingCalculationScenarioContext(calculation, surfacelines, soilModels, failureMechanism, assessmentSectionMock); // Assert Assert.IsInstanceOf(presentationObject); @@ -42,8 +42,9 @@ Assert.AreSame(calculation, presentationObject.WrappedData); Assert.AreSame(surfacelines, presentationObject.AvailablePipingSurfaceLines); Assert.AreSame(soilModels, presentationObject.AvailableStochasticSoilModels); - Assert.AreSame(pipingFailureMechanismMock, presentationObject.FailureMechanism); + Assert.AreSame(failureMechanism, presentationObject.FailureMechanism); Assert.AreSame(assessmentSectionMock, presentationObject.AssessmentSection); + mocks.VerifyAll(); } } } \ No newline at end of file Index: Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/PresentationObjects/PipingContextTest.cs =================================================================== diff -u -r14185c4e29bcfc887fa656a681bdde704d250a9f -re775448bfb8290e43d62340a53a08723bbc035c6 --- Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/PresentationObjects/PipingContextTest.cs (.../PipingContextTest.cs) (revision 14185c4e29bcfc887fa656a681bdde704d250a9f) +++ Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/PresentationObjects/PipingContextTest.cs (.../PipingContextTest.cs) (revision e775448bfb8290e43d62340a53a08723bbc035c6) @@ -42,8 +42,7 @@ { // Setup var mocks = new MockRepository(); - var assessmentSection = mocks.StrictMock(); - var pipingFailureMechanism = mocks.StrictMock(); + var assessmentSectionMock = mocks.StrictMock(); mocks.ReplayAll(); RingtoetsPipingSurfaceLine[] surfaceLines = @@ -58,9 +57,10 @@ }; var target = new ObservableObject(); + var failureMechanism = new PipingFailureMechanism(); // Call - var context = new SimplePipingContext(target, surfaceLines, soilModels, pipingFailureMechanism, assessmentSection); + var context = new SimplePipingContext(target, surfaceLines, soilModels, failureMechanism, assessmentSectionMock); // Assert Assert.IsInstanceOf(context); @@ -70,9 +70,8 @@ Assert.AreSame(soilModels, context.AvailableStochasticSoilModels, "It is vital that the iterator should be identical to the collection, in order to stay in sync when items are added or removed."); Assert.AreSame(target, context.WrappedData); - Assert.AreSame(pipingFailureMechanism, context.FailureMechanism); - Assert.AreSame(assessmentSection, context.AssessmentSection); - + Assert.AreSame(failureMechanism, context.FailureMechanism); + Assert.AreSame(assessmentSectionMock, context.AssessmentSection); mocks.VerifyAll(); } @@ -81,16 +80,17 @@ { // Setup var mocks = new MockRepository(); - var assessmentSection = mocks.StrictMock(); - var pipingFailureMechanism = mocks.StrictMock(); + var assessmentSectionMock = mocks.StrictMock(); mocks.ReplayAll(); + var failureMechanism = new PipingFailureMechanism(); + // Call TestDelegate call = () => new SimplePipingContext(new ObservableObject(), null, Enumerable.Empty(), - pipingFailureMechanism, - assessmentSection); + failureMechanism, + assessmentSectionMock); // Assert var exception = Assert.Throws(call); @@ -107,16 +107,15 @@ { // Setup var mocks = new MockRepository(); - var assessmentSection = mocks.StrictMock(); - var pipingFailureMechanism = mocks.StrictMock(); + var assessmentSectionMock = mocks.StrictMock(); mocks.ReplayAll(); // Call TestDelegate call = () => new SimplePipingContext(new ObservableObject(), Enumerable.Empty(), null, - pipingFailureMechanism, - assessmentSection); + new PipingFailureMechanism(), + assessmentSectionMock); // Assert var exception = Assert.Throws(call); @@ -133,15 +132,15 @@ { // Setup var mocks = new MockRepository(); - var assessmentSection = mocks.StrictMock(); + var assessmentSectionMock = mocks.StrictMock(); mocks.ReplayAll(); // Call TestDelegate call = () => new SimplePipingContext(new ObservableObject(), Enumerable.Empty(), Enumerable.Empty(), null, - assessmentSection); + assessmentSectionMock); // Assert var exception = Assert.Throws(call); @@ -156,16 +155,11 @@ [Test] public void ParameteredConstructor_AssessmentSectionIsNull_ThrowArgumentNullException() { - // Setup - var mocks = new MockRepository(); - var pipingFailureMechanism = mocks.StrictMock(); - mocks.ReplayAll(); - // Call TestDelegate call = () => new SimplePipingContext(new ObservableObject(), Enumerable.Empty(), Enumerable.Empty(), - pipingFailureMechanism, + new PipingFailureMechanism(), null); // Assert @@ -175,7 +169,6 @@ Environment.NewLine }, StringSplitOptions.None)[0]; Assert.AreEqual("Het traject mag niet 'null' zijn.", customMessage); - mocks.VerifyAll(); } private class SimplePipingContext : PipingContext where T : IObservable Index: Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/PresentationObjects/PipingFailureMechanismContextTest.cs =================================================================== diff -u -r14185c4e29bcfc887fa656a681bdde704d250a9f -re775448bfb8290e43d62340a53a08723bbc035c6 --- Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/PresentationObjects/PipingFailureMechanismContextTest.cs (.../PipingFailureMechanismContextTest.cs) (revision 14185c4e29bcfc887fa656a681bdde704d250a9f) +++ Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/PresentationObjects/PipingFailureMechanismContextTest.cs (.../PipingFailureMechanismContextTest.cs) (revision e775448bfb8290e43d62340a53a08723bbc035c6) @@ -18,17 +18,17 @@ { // Setup var mocks = new MockRepository(); - var assessmentSection = mocks.Stub(); + var assessmentSectionMock = mocks.StrictMock(); mocks.ReplayAll(); var failureMechanism = new PipingFailureMechanism(); // Call - var context = new PipingFailureMechanismContext(failureMechanism, assessmentSection); + var context = new PipingFailureMechanismContext(failureMechanism, assessmentSectionMock); // Assert Assert.IsInstanceOf>(context); - Assert.AreSame(assessmentSection, context.Parent); + Assert.AreSame(assessmentSectionMock, context.Parent); Assert.AreSame(failureMechanism, context.WrappedData); mocks.VerifyAll(); } Index: Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/PresentationObjects/PipingInputContextTest.cs =================================================================== diff -u -r14185c4e29bcfc887fa656a681bdde704d250a9f -re775448bfb8290e43d62340a53a08723bbc035c6 --- Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/PresentationObjects/PipingInputContextTest.cs (.../PipingInputContextTest.cs) (revision 14185c4e29bcfc887fa656a681bdde704d250a9f) +++ Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/PresentationObjects/PipingInputContextTest.cs (.../PipingInputContextTest.cs) (revision e775448bfb8290e43d62340a53a08723bbc035c6) @@ -38,6 +38,10 @@ public void ParameteredConstructor_ExpectedValues() { // Setup + var mocks = new MockRepository(); + var assessmentSectionMock = mocks.StrictMock(); + mocks.ReplayAll(); + var calculation = new PipingCalculationScenario(new GeneralPipingInput()); var surfaceLines = new[] { @@ -48,31 +52,30 @@ new TestStochasticSoilModel() }; - var mocks = new MockRepository(); var failureMechanism = new PipingFailureMechanism(); - var assessmentSection = mocks.StrictMock(); - mocks.ReplayAll(); - // Call - var context = new PipingInputContext(calculation.InputParameters, calculation, surfaceLines, stochasticSoilModels, failureMechanism, assessmentSection); + var context = new PipingInputContext(calculation.InputParameters, calculation, surfaceLines, stochasticSoilModels, failureMechanism, assessmentSectionMock); // Assert Assert.IsInstanceOf>(context); Assert.AreSame(calculation.InputParameters, context.WrappedData); Assert.AreSame(calculation, context.PipingCalculation); Assert.AreSame(failureMechanism, context.FailureMechanism); - Assert.AreSame(assessmentSection, context.AssessmentSection); + Assert.AreSame(assessmentSectionMock, context.AssessmentSection); CollectionAssert.AreEqual(surfaceLines, context.AvailablePipingSurfaceLines); CollectionAssert.AreEqual(stochasticSoilModels, context.AvailableStochasticSoilModels); - mocks.VerifyAll(); } [Test] public void ParameteredConstructor_CalculationItemNull_ThrowsArgumentNullException() { // Setup + var mocks = new MockRepository(); + var assessmentSectionMock = mocks.StrictMock(); + mocks.ReplayAll(); + var calculationInput = new PipingInput(new GeneralPipingInput()); var surfaceLines = new[] { @@ -84,13 +87,8 @@ }; var failureMechanism = new PipingFailureMechanism(); - var mocks = new MockRepository(); - var assessmentSection = mocks.StrictMock(); - - mocks.ReplayAll(); - // Call - TestDelegate call = () => new PipingInputContext(calculationInput, null, surfaceLines, stochasticSoilModels, failureMechanism, assessmentSection); + TestDelegate call = () => new PipingInputContext(calculationInput, null, surfaceLines, stochasticSoilModels, failureMechanism, assessmentSectionMock); // Assert TestHelper.AssertThrowsArgumentExceptionAndTestMessage(call, "De berekening mag niet 'null' zijn."); Index: Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/PresentationObjects/RingtoetsPipingSurfaceLinesContextTest.cs =================================================================== diff -u -r63fbdd5525927fbf9d63925eef9da8e17a0d7b44 -re775448bfb8290e43d62340a53a08723bbc035c6 --- Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/PresentationObjects/RingtoetsPipingSurfaceLinesContextTest.cs (.../RingtoetsPipingSurfaceLinesContextTest.cs) (revision 63fbdd5525927fbf9d63925eef9da8e17a0d7b44) +++ Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/PresentationObjects/RingtoetsPipingSurfaceLinesContextTest.cs (.../RingtoetsPipingSurfaceLinesContextTest.cs) (revision e775448bfb8290e43d62340a53a08723bbc035c6) @@ -16,17 +16,18 @@ { // Setup var mocks = new MockRepository(); - var failureMechanism = new PipingFailureMechanism(); - var assessmentSection = mocks.StrictMock(); + var assessmentSectionMock = mocks.StrictMock(); mocks.ReplayAll(); + var failureMechanism = new PipingFailureMechanism(); + // Call - var context = new RingtoetsPipingSurfaceLinesContext(failureMechanism, assessmentSection); + var context = new RingtoetsPipingSurfaceLinesContext(failureMechanism, assessmentSectionMock); // Assert Assert.IsInstanceOf>(context); Assert.AreSame(failureMechanism, context.WrappedData); - Assert.AreSame(assessmentSection, context.AssessmentSection); + Assert.AreSame(assessmentSectionMock, context.AssessmentSection); mocks.VerifyAll(); } Index: Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/PresentationObjects/StochasticSoilModelContextTest.cs =================================================================== diff -u -rb53320286e086524c6003dc6e47af798ee3935be -re775448bfb8290e43d62340a53a08723bbc035c6 --- Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/PresentationObjects/StochasticSoilModelContextTest.cs (.../StochasticSoilModelContextTest.cs) (revision b53320286e086524c6003dc6e47af798ee3935be) +++ Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/PresentationObjects/StochasticSoilModelContextTest.cs (.../StochasticSoilModelContextTest.cs) (revision e775448bfb8290e43d62340a53a08723bbc035c6) @@ -38,18 +38,19 @@ { // Setup var mocks = new MockRepository(); - var failureMechanism = new PipingFailureMechanism(); - var assessmentSection = mocks.StrictMock(); + var assessmentSectionMock = mocks.StrictMock(); mocks.ReplayAll(); + var failureMechanism = new PipingFailureMechanism(); + // Call - var context = new StochasticSoilModelContext(failureMechanism.StochasticSoilModels, failureMechanism, assessmentSection); + var context = new StochasticSoilModelContext(failureMechanism.StochasticSoilModels, failureMechanism, assessmentSectionMock); // Assert Assert.IsInstanceOf>>(context); Assert.AreSame(failureMechanism.StochasticSoilModels, context.WrappedData); Assert.AreSame(failureMechanism, context.FailureMechanism); - Assert.AreSame(assessmentSection, context.AssessmentSection); + Assert.AreSame(assessmentSectionMock, context.AssessmentSection); mocks.VerifyAll(); } @@ -58,12 +59,13 @@ { // Setup var mocks = new MockRepository(); - var stochasticSoilModels = new ObservableList(); - var assessmentSection = mocks.StrictMock(); + var assessmentSectionMock = mocks.StrictMock(); mocks.ReplayAll(); + var stochasticSoilModels = new ObservableList(); + // Call - TestDelegate test = () => new StochasticSoilModelContext(stochasticSoilModels, null, assessmentSection); + TestDelegate test = () => new StochasticSoilModelContext(stochasticSoilModels, null, assessmentSectionMock); // Assert var exception = Assert.Throws(test);