Index: Riskeer/StabilityStoneCover/src/Riskeer.StabilityStoneCover.Forms/PropertyClasses/StabilityStoneCoverCalculationsProperties.cs =================================================================== diff -u -rf9ca24058b91d70a3ff903638831960c76899d95 -r29c590694571ca38e860be0e67f639d0a41523fb --- Riskeer/StabilityStoneCover/src/Riskeer.StabilityStoneCover.Forms/PropertyClasses/StabilityStoneCoverCalculationsProperties.cs (.../StabilityStoneCoverCalculationsProperties.cs) (revision f9ca24058b91d70a3ff903638831960c76899d95) +++ Riskeer/StabilityStoneCover/src/Riskeer.StabilityStoneCover.Forms/PropertyClasses/StabilityStoneCoverCalculationsProperties.cs (.../StabilityStoneCoverCalculationsProperties.cs) (revision 29c590694571ca38e860be0e67f639d0a41523fb) @@ -51,16 +51,8 @@ NamePropertyIndex = namePropertyIndex, CodePropertyIndex = codePropertyIndex, GroupPropertyIndex = groupPropertyIndex - }) - { - if (data == null) - { - throw new ArgumentNullException(nameof(data)); - } + }) {} - Data = data; - } - #region Model settings [PropertyOrder(blocksPropertyIndex)] Index: Riskeer/StabilityStoneCover/src/Riskeer.StabilityStoneCover.Forms/PropertyClasses/StabilityStoneCoverFailurePathProperties.cs =================================================================== diff -u -ref37178ba647c277a7514166566f846fda14f7e0 -r29c590694571ca38e860be0e67f639d0a41523fb --- Riskeer/StabilityStoneCover/src/Riskeer.StabilityStoneCover.Forms/PropertyClasses/StabilityStoneCoverFailurePathProperties.cs (.../StabilityStoneCoverFailurePathProperties.cs) (revision ef37178ba647c277a7514166566f846fda14f7e0) +++ Riskeer/StabilityStoneCover/src/Riskeer.StabilityStoneCover.Forms/PropertyClasses/StabilityStoneCoverFailurePathProperties.cs (.../StabilityStoneCoverFailurePathProperties.cs) (revision 29c590694571ca38e860be0e67f639d0a41523fb) @@ -49,16 +49,8 @@ NamePropertyIndex = namePropertyIndex, CodePropertyIndex = codePropertyIndex, GroupPropertyIndex = groupPropertyIndex - }) - { - if (data == null) - { - throw new ArgumentNullException(nameof(data)); - } + }) {} - Data = data; - } - #region Length effect parameters [PropertyOrder(nPropertyIndex)] Index: Riskeer/StabilityStoneCover/test/Riskeer.StabilityStoneCover.Forms.Test/PropertyClasses/StabilityStoneCoverCalculationsPropertiesTest.cs =================================================================== diff -u -ra4921cd3a6c1247f24331618100ab7c468007bd5 -r29c590694571ca38e860be0e67f639d0a41523fb --- Riskeer/StabilityStoneCover/test/Riskeer.StabilityStoneCover.Forms.Test/PropertyClasses/StabilityStoneCoverCalculationsPropertiesTest.cs (.../StabilityStoneCoverCalculationsPropertiesTest.cs) (revision a4921cd3a6c1247f24331618100ab7c468007bd5) +++ Riskeer/StabilityStoneCover/test/Riskeer.StabilityStoneCover.Forms.Test/PropertyClasses/StabilityStoneCoverCalculationsPropertiesTest.cs (.../StabilityStoneCoverCalculationsPropertiesTest.cs) (revision 29c590694571ca38e860be0e67f639d0a41523fb) @@ -19,10 +19,8 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. -using System; using System.ComponentModel; using Core.Common.TestUtil; -using Core.Gui.PropertyBag; using Core.Gui.TestUtil; using NUnit.Framework; using Riskeer.StabilityStoneCover.Data; @@ -40,27 +38,16 @@ private const int columnsPropertyIndex = 4; [Test] - public void Constructor_DataIsNull_ThrowArgumentNullException() + public void Constructor_ExpectedValues() { - // Call - void Call() => new StabilityStoneCoverCalculationsProperties(null); - - // Assert - string paramName = Assert.Throws(Call).ParamName; - Assert.AreEqual("data", paramName); - } - - [Test] - public void Constructor_WithData_ExpectedValues() - { // Setup var failureMechanism = new StabilityStoneCoverFailureMechanism(); // Call var properties = new StabilityStoneCoverCalculationsProperties(failureMechanism); // Assert - Assert.IsInstanceOf>(properties); + Assert.IsInstanceOf(properties); TestHelper.AssertTypeConverter( nameof(StabilityStoneCoverCalculationsProperties.Columns)); TestHelper.AssertTypeConverter( Index: Riskeer/StabilityStoneCover/test/Riskeer.StabilityStoneCover.Forms.Test/PropertyClasses/StabilityStoneCoverFailureMechanismPropertiesTest.cs =================================================================== diff -u -rf9ca24058b91d70a3ff903638831960c76899d95 -r29c590694571ca38e860be0e67f639d0a41523fb --- Riskeer/StabilityStoneCover/test/Riskeer.StabilityStoneCover.Forms.Test/PropertyClasses/StabilityStoneCoverFailureMechanismPropertiesTest.cs (.../StabilityStoneCoverFailureMechanismPropertiesTest.cs) (revision f9ca24058b91d70a3ff903638831960c76899d95) +++ Riskeer/StabilityStoneCover/test/Riskeer.StabilityStoneCover.Forms.Test/PropertyClasses/StabilityStoneCoverFailureMechanismPropertiesTest.cs (.../StabilityStoneCoverFailureMechanismPropertiesTest.cs) (revision 29c590694571ca38e860be0e67f639d0a41523fb) @@ -21,7 +21,6 @@ using System; using System.ComponentModel; -using Core.Common.TestUtil; using Core.Gui.PropertyBag; using Core.Gui.TestUtil; using NUnit.Framework; @@ -63,16 +62,7 @@ public void Constructor_ExpectedValues() { // Setup - var random = new Random(39); - bool isRelevant = random.NextBoolean(); - var failureMechanism = new StabilityStoneCoverFailureMechanism - { - IsRelevant = isRelevant, - GeneralInput = - { - N = random.NextRoundedDouble(1.0, 20.0) - } - }; + var failureMechanism = new StabilityStoneCoverFailureMechanism(); // Call var properties = new StabilityStoneCoverFailureMechanismProperties(failureMechanism, new StabilityStoneCoverFailureMechanismProperties.ConstructionProperties()); @@ -90,10 +80,7 @@ public void Constructor_Always_PropertiesHaveExpectedAttributesValues() { // Setup - var failureMechanism = new StabilityStoneCoverFailureMechanism - { - IsRelevant = true - }; + var failureMechanism = new StabilityStoneCoverFailureMechanism(); // Call var properties = new StabilityStoneCoverFailureMechanismProperties(failureMechanism, new StabilityStoneCoverFailureMechanismProperties.ConstructionProperties Index: Riskeer/StabilityStoneCover/test/Riskeer.StabilityStoneCover.Forms.Test/PropertyClasses/StabilityStoneCoverFailurePathPropertiesTest.cs =================================================================== diff -u -ref37178ba647c277a7514166566f846fda14f7e0 -r29c590694571ca38e860be0e67f639d0a41523fb --- Riskeer/StabilityStoneCover/test/Riskeer.StabilityStoneCover.Forms.Test/PropertyClasses/StabilityStoneCoverFailurePathPropertiesTest.cs (.../StabilityStoneCoverFailurePathPropertiesTest.cs) (revision ef37178ba647c277a7514166566f846fda14f7e0) +++ Riskeer/StabilityStoneCover/test/Riskeer.StabilityStoneCover.Forms.Test/PropertyClasses/StabilityStoneCoverFailurePathPropertiesTest.cs (.../StabilityStoneCoverFailurePathPropertiesTest.cs) (revision 29c590694571ca38e860be0e67f639d0a41523fb) @@ -40,14 +40,7 @@ private const int groupPropertyIndex = 2; private const int contributionPropertyIndex = 3; private const int nPropertyIndex = 4; - private MockRepository mocks; - [SetUp] - public void SetUp() - { - mocks = new MockRepository(); - } - [Test] public void Constructor_ExpectedValues() { @@ -127,7 +120,7 @@ [TestCase(0.0)] [TestCase(-1.0)] [TestCase(-20.0)] - public void N_SetInvalidValue_ThrowsArgumentOutOfRangeExceptionNoNotifications(double newN) + public void N_SetInvalidValue_ThrowsArgumentOutOfRangeException(double newN) { // Setup var failureMechanism = new StabilityStoneCoverFailureMechanism(); @@ -149,6 +142,7 @@ public void N_SetValidValue_UpdateDataAndNotifyObservers(double newN) { // Setup + var mocks = new MockRepository(); var observer = mocks.StrictMock(); observer.Expect(o => o.UpdateObserver()); mocks.ReplayAll();