Index: Riskeer/StabilityPointStructures/test/Riskeer.StabilityPointStructures.Forms.Test/PropertyClasses/StabilityPointStructuresCalculationsPropertiesTest.cs =================================================================== diff -u -rd9a677f9a0d3da55efaba59f08983893bf86c572 -r92d09ddedac41a7c4aa797d76fdce1495a10c2d3 --- Riskeer/StabilityPointStructures/test/Riskeer.StabilityPointStructures.Forms.Test/PropertyClasses/StabilityPointStructuresCalculationsPropertiesTest.cs (.../StabilityPointStructuresCalculationsPropertiesTest.cs) (revision d9a677f9a0d3da55efaba59f08983893bf86c572) +++ Riskeer/StabilityPointStructures/test/Riskeer.StabilityPointStructures.Forms.Test/PropertyClasses/StabilityPointStructuresCalculationsPropertiesTest.cs (.../StabilityPointStructuresCalculationsPropertiesTest.cs) (revision 92d09ddedac41a7c4aa797d76fdce1495a10c2d3) @@ -21,14 +21,9 @@ using System; using System.ComponentModel; -using Core.Common.Base; -using Core.Common.Base.Data; -using Core.Common.TestUtil; using Core.Gui.PropertyBag; using Core.Gui.TestUtil; using NUnit.Framework; -using Rhino.Mocks; -using Riskeer.Common.Data.TestUtil; using Riskeer.StabilityPointStructures.Data; using Riskeer.StabilityPointStructures.Forms.PropertyClasses; @@ -179,51 +174,5 @@ "Modelfactor voor een lange overlaat.", true); } - - [Test] - [SetCulture("nl-NL")] - [TestCase(0.0)] - [TestCase(-1.0)] - [TestCase(-20.0)] - public void N_InvalidValue_ThrowsArgumentOutOfRangeException(double value) - { - // Setup - var failureMechanism = new StabilityPointStructuresFailureMechanism(); - - var properties = new StabilityPointStructuresCalculationsProperties(failureMechanism); - - // Call - void Call() => properties.N = (RoundedDouble) value; - - // Assert - const string expectedMessage = "De waarde voor 'N' moet in het bereik [1,00, 20,00] liggen."; - TestHelper.AssertThrowsArgumentExceptionAndTestMessage(Call, expectedMessage); - } - - [Test] - [TestCase(1.0)] - [TestCase(10.0)] - [TestCase(20.0)] - public void N_SetValidValue_UpdateDataAndNotifyObservers(double value) - { - // Setup - var mockRepository = new MockRepository(); - var observer = mockRepository.StrictMock(); - observer.Expect(o => o.UpdateObserver()); - mockRepository.ReplayAll(); - - var failureMechanism = new StabilityPointStructuresFailureMechanism(); - failureMechanism.Attach(observer); - - var properties = new StabilityPointStructuresCalculationsProperties(failureMechanism); - - // Call - properties.N = (RoundedDouble) value; - - // Assert - Assert.AreEqual(value, failureMechanism.GeneralInput.N, failureMechanism.GeneralInput.N.GetAccuracy()); - - mockRepository.VerifyAll(); - } } } \ No newline at end of file Index: Riskeer/StabilityPointStructures/test/Riskeer.StabilityPointStructures.Forms.Test/PropertyClasses/StabilityPointStructuresFailureMechanismPropertiesTest.cs =================================================================== diff -u -rd9a677f9a0d3da55efaba59f08983893bf86c572 -r92d09ddedac41a7c4aa797d76fdce1495a10c2d3 --- Riskeer/StabilityPointStructures/test/Riskeer.StabilityPointStructures.Forms.Test/PropertyClasses/StabilityPointStructuresFailureMechanismPropertiesTest.cs (.../StabilityPointStructuresFailureMechanismPropertiesTest.cs) (revision d9a677f9a0d3da55efaba59f08983893bf86c572) +++ Riskeer/StabilityPointStructures/test/Riskeer.StabilityPointStructures.Forms.Test/PropertyClasses/StabilityPointStructuresFailureMechanismPropertiesTest.cs (.../StabilityPointStructuresFailureMechanismPropertiesTest.cs) (revision 92d09ddedac41a7c4aa797d76fdce1495a10c2d3) @@ -152,7 +152,11 @@ public void N_InvalidValue_ThrowsArgumentOutOfRangeException(double value) { // Setup + var mocks = new MockRepository(); + var observer = mocks.StrictMock(); + var failureMechanism = new StabilityPointStructuresFailureMechanism(); + failureMechanism.Attach(observer); var properties = new StabilityPointStructuresFailureMechanismProperties(failureMechanism, new StabilityPointStructuresFailureMechanismProperties.ConstructionProperties()); @@ -162,6 +166,8 @@ // Assert const string expectedMessage = "De waarde voor 'N' moet in het bereik [1,00, 20,00] liggen."; TestHelper.AssertThrowsArgumentExceptionAndTestMessage(Call, expectedMessage); + + mocks.VerifyAll(); } [Test] @@ -171,10 +177,10 @@ public void N_SetValidValue_UpdateDataAndNotifyObservers(double value) { // Setup - var mockRepository = new MockRepository(); - var observer = mockRepository.StrictMock(); + var mocks = new MockRepository(); + var observer = mocks.StrictMock(); observer.Expect(o => o.UpdateObserver()); - mockRepository.ReplayAll(); + mocks.ReplayAll(); var failureMechanism = new StabilityPointStructuresFailureMechanism(); failureMechanism.Attach(observer); @@ -187,7 +193,7 @@ // Assert Assert.AreEqual(value, failureMechanism.GeneralInput.N, failureMechanism.GeneralInput.N.GetAccuracy()); - mockRepository.VerifyAll(); + mocks.VerifyAll(); } } } \ No newline at end of file Index: Riskeer/StabilityPointStructures/test/Riskeer.StabilityPointStructures.Forms.Test/PropertyClasses/StabilityPointStructuresFailurePathPropertiesTest.cs =================================================================== diff -u -rd9a677f9a0d3da55efaba59f08983893bf86c572 -r92d09ddedac41a7c4aa797d76fdce1495a10c2d3 --- Riskeer/StabilityPointStructures/test/Riskeer.StabilityPointStructures.Forms.Test/PropertyClasses/StabilityPointStructuresFailurePathPropertiesTest.cs (.../StabilityPointStructuresFailurePathPropertiesTest.cs) (revision d9a677f9a0d3da55efaba59f08983893bf86c572) +++ Riskeer/StabilityPointStructures/test/Riskeer.StabilityPointStructures.Forms.Test/PropertyClasses/StabilityPointStructuresFailurePathPropertiesTest.cs (.../StabilityPointStructuresFailurePathPropertiesTest.cs) (revision 92d09ddedac41a7c4aa797d76fdce1495a10c2d3) @@ -19,14 +19,9 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. -using System; using System.ComponentModel; -using Core.Common.Base; -using Core.Common.Base.Data; -using Core.Common.TestUtil; using Core.Gui.TestUtil; using NUnit.Framework; -using Rhino.Mocks; using Riskeer.Common.Data.TestUtil; using Riskeer.StabilityPointStructures.Data; using Riskeer.StabilityPointStructures.Forms.PropertyClasses; @@ -114,51 +109,5 @@ "N [-]", "De parameter 'N' die gebruikt wordt om het lengte-effect mee te nemen in de beoordeling."); } - - [Test] - [SetCulture("nl-NL")] - [TestCase(0.0)] - [TestCase(-1.0)] - [TestCase(-20.0)] - public void N_InvalidValue_ThrowsArgumentOutOfRangeException(double value) - { - // Setup - var failureMechanism = new StabilityPointStructuresFailureMechanism(); - - var properties = new StabilityPointStructuresFailurePathProperties(failureMechanism); - - // Call - void Call() => properties.N = (RoundedDouble) value; - - // Assert - const string expectedMessage = "De waarde voor 'N' moet in het bereik [1,00, 20,00] liggen."; - TestHelper.AssertThrowsArgumentExceptionAndTestMessage(Call, expectedMessage); - } - - [Test] - [TestCase(1.0)] - [TestCase(10.0)] - [TestCase(20.0)] - public void N_SetValidValue_UpdateDataAndNotifyObservers(double value) - { - // Setup - var mockRepository = new MockRepository(); - var observer = mockRepository.StrictMock(); - observer.Expect(o => o.UpdateObserver()); - mockRepository.ReplayAll(); - - var failureMechanism = new StabilityPointStructuresFailureMechanism(); - failureMechanism.Attach(observer); - - var properties = new StabilityPointStructuresFailurePathProperties(failureMechanism); - - // Call - properties.N = (RoundedDouble) value; - - // Assert - Assert.AreEqual(value, failureMechanism.GeneralInput.N, failureMechanism.GeneralInput.N.GetAccuracy()); - - mockRepository.VerifyAll(); - } } } \ No newline at end of file