public void Constructor_ExpectedValues()
        {
            // Setup
            var mocks        = new MockRepository();
            var distribution = mocks.Stub <IVariationCoefficientDistribution>();

            distribution.Mean = new RoundedDouble();
            mocks.ReplayAll();

            // Call
            var designVariable = new VariationCoefficientDeterministicDesignVariable <IVariationCoefficientDistribution>(distribution);

            // Assert
            Assert.IsInstanceOf <VariationCoefficientDesignVariable <IVariationCoefficientDistribution> >(designVariable);
            Assert.AreSame(distribution, designVariable.Distribution);
            Assert.AreEqual(0, designVariable.GetDesignValue().Value);
            mocks.VerifyAll();
        }
        public void GetBelowPhreaticLevel_ValidSoilLayerData_CreateDesignVariableForBelowPhreaticLevel()
        {
            // Setup
            var data = new MacroStabilityInwardsSoilLayerData
            {
                BelowPhreaticLevel =
                {
                    Mean                   = (RoundedDouble)mean,
                    CoefficientOfVariation = (RoundedDouble)coefficientOfVariation,
                    Shift                  = (RoundedDouble)(mean - 0.1)
                }
            };

            // Call
            VariationCoefficientDeterministicDesignVariable <VariationCoefficientLogNormalDistribution> belowPhreaticLevel = MacroStabilityInwardsSemiProbabilisticDesignVariableFactory.GetBelowPhreaticLevel(data);

            // Assert
            DistributionAssert.AreEqual(data.BelowPhreaticLevel, belowPhreaticLevel.Distribution);
            Assert.AreEqual(data.BelowPhreaticLevel.Mean, belowPhreaticLevel.GetDesignValue());
        }
        public void GetDesignValue_Always_ReturnsDeterministicValueWithNumberOfDecimalsFromDistributionMean()
        {
            // Setup
            double    testValue             = new Random(21).NextDouble();
            const int numberOfDecimalPlaces = 2;

            var mocks        = new MockRepository();
            var distribution = mocks.Stub <IVariationCoefficientDistribution>();

            distribution.Mean = new RoundedDouble(numberOfDecimalPlaces);
            mocks.ReplayAll();

            var designVariable = new VariationCoefficientDeterministicDesignVariable <IVariationCoefficientDistribution>(distribution, testValue);

            // Call
            RoundedDouble designValue = designVariable.GetDesignValue();

            // Assert
            Assert.AreEqual(testValue, designValue.Value, designValue.GetAccuracy());
            Assert.AreEqual(numberOfDecimalPlaces, designValue.NumberOfDecimalPlaces);
            mocks.VerifyAll();
        }