Example #1
0
        public void Clone_Always_ReturnNewInstanceWithCopiedValues()
        {
            // Setup
            var original = new MacroStabilityInwardsLocationInputDaily();

            // Call
            object clone = original.Clone();

            // Assert
            CoreCloneAssert.AreObjectClones(original, clone, MacroStabilityInwardsCloneAssert.AreClones);
        }
Example #2
0
        public void Constructor_ExpectedValues()
        {
            // Call
            var locationInput = new MacroStabilityInwardsLocationInputDaily();

            // Assert
            Assert.IsInstanceOf <MacroStabilityInwardsLocationInputBase>(locationInput);
            Assert.IsInstanceOf <IMacroStabilityInwardsLocationInputDaily>(locationInput);

            Assert.AreEqual(0.0, locationInput.PenetrationLength);
            Assert.AreEqual(2, locationInput.PhreaticLineOffsetBelowDikeToeAtPolder.NumberOfDecimalPlaces);
        }
        public void Constructor_ValidData_PropertiesHaveExpectedAttributesValues()
        {
            // Setup
            var mocks         = new MockRepository();
            var changeHandler = mocks.Stub <IObservablePropertyChangeHandler>();

            mocks.ReplayAll();

            var input = new MacroStabilityInwardsLocationInputDaily();

            // Call
            var properties = new MacroStabilityInwardsLocationInputDailyProperties(input, changeHandler);

            // Assert
            PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties);

            Assert.AreEqual(3, dynamicProperties.Count);

            const string waterStressesCategory = "Waterspanningen";

            PropertyDescriptor waterLevelPolderProperty = dynamicProperties[expectedwaterLevelPolderPropertyIndex];

            PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(
                waterLevelPolderProperty,
                waterStressesCategory,
                "Polderpeil [m+NAP]",
                "Het niveau van het oppervlaktewater binnen een beheersgebied.");

            PropertyDescriptor offsetProperty = dynamicProperties[expectedOffsetPropertyIndex];

            PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(
                offsetProperty,
                waterStressesCategory,
                "Offsets PL 1",
                "Eigenschappen van offsets PL 1.",
                true);

            PropertyDescriptor penetrationLengthProperty = dynamicProperties[expectedPenetrationLengthPropertyIndex];

            PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(
                penetrationLengthProperty,
                waterStressesCategory,
                "Indringingslengte [m]",
                "De verticale afstand waarover de waterspanning in de deklaag verandert bij waterspanningsvariaties in de watervoerende zandlaag.",
                true);

            mocks.VerifyAll();
        }
        public void GetProperties_WithData_ReturnExpectedValues()
        {
            // Setup
            var mocks         = new MockRepository();
            var changeHandler = mocks.Stub <IObservablePropertyChangeHandler>();

            mocks.ReplayAll();

            var input = new MacroStabilityInwardsLocationInputDaily();

            // Call
            var properties = new MacroStabilityInwardsLocationInputDailyProperties(input, changeHandler);

            // Assert
            Assert.AreEqual(input.PenetrationLength, properties.PenetrationLength);

            mocks.VerifyAll();
        }
        public void Constructor_ExpectedValues()
        {
            // Setup
            var mocks         = new MockRepository();
            var changeHandler = mocks.Stub <IObservablePropertyChangeHandler>();

            mocks.ReplayAll();

            var input = new MacroStabilityInwardsLocationInputDaily();

            // Call
            var properties = new MacroStabilityInwardsLocationInputDailyProperties(input, changeHandler);

            // Assert
            Assert.IsInstanceOf <MacroStabilityInwardsLocationInputBaseProperties <MacroStabilityInwardsLocationInputDaily> >(properties);
            Assert.AreSame(input, properties.Data);

            mocks.VerifyAll();
        }
 /// <summary>
 /// Method that asserts whether <paramref name="original"/> and <paramref name="clone"/>
 /// are clones.
 /// </summary>
 /// <param name="original">The original object.</param>
 /// <param name="clone">The cloned object.</param>
 /// <exception cref="AssertionException">Thrown when <paramref name="original"/> and
 /// <paramref name="clone"/> are not clones.</exception>
 public static void AreClones(MacroStabilityInwardsLocationInputDaily original,
                              MacroStabilityInwardsLocationInputDaily clone)
 {
     AreClones((MacroStabilityInwardsLocationInputBase)original, clone);
     Assert.AreEqual(original.PenetrationLength, clone.PenetrationLength);
 }