Exemple #1
0
        public void Constructor_ExpectedValues()
        {
            // Setup
            var failureMechanism = new StabilityPointStructuresFailureMechanism();

            // Call
            var properties = new StabilityPointStructuresFailureMechanismProperties(failureMechanism);

            // Assert
            Assert.IsInstanceOf <StabilityPointStructuresFailureMechanismPropertiesBase>(properties);
            Assert.AreSame(failureMechanism, properties.Data);
            Assert.AreEqual(failureMechanism.Name, properties.Name);
            Assert.AreEqual(failureMechanism.Code, properties.Code);

            GeneralStabilityPointStructuresInput generalInput = failureMechanism.GeneralInput;

            Assert.AreEqual(generalInput.GravitationalAcceleration, properties.GravitationalAcceleration);
            Assert.AreEqual(generalInput.ModelFactorStorageVolume.Mean, properties.ModelFactorStorageVolume.Mean);
            Assert.AreEqual(generalInput.ModelFactorStorageVolume.StandardDeviation, properties.ModelFactorStorageVolume.StandardDeviation);
            Assert.AreEqual(generalInput.ModelFactorCollisionLoad.Mean, properties.ModelFactorCollisionLoad.Mean);
            Assert.AreEqual(generalInput.ModelFactorCollisionLoad.CoefficientOfVariation, properties.ModelFactorCollisionLoad.CoefficientOfVariation);
            Assert.AreEqual(generalInput.ModelFactorLoadEffect.Mean, properties.ModelFactorLoadEffect.Mean);
            Assert.AreEqual(generalInput.ModelFactorLoadEffect.StandardDeviation, properties.ModelFactorLoadEffect.StandardDeviation);
            Assert.AreEqual(generalInput.ModelFactorLongThreshold.Mean, properties.ModelFactorLongThreshold.Mean);
            Assert.AreEqual(generalInput.ModelFactorLongThreshold.StandardDeviation, properties.ModelFactorLongThreshold.StandardDeviation);
        }
        public void Constructor_ExpectedValues()
        {
            // Setup
            var random           = new Random(21);
            var failureMechanism = new StabilityPointStructuresFailureMechanism
            {
                InAssembly = random.NextBoolean()
            };

            // Call
            var properties = new StabilityPointStructuresFailureMechanismProperties(failureMechanism);

            // Assert
            Assert.IsInstanceOf <StabilityPointStructuresFailureMechanismPropertiesBase>(properties);
            Assert.AreEqual(failureMechanism.Name, properties.Name);
            Assert.AreEqual(failureMechanism.Code, properties.Code);
            Assert.AreEqual(failureMechanism.InAssembly, properties.InAssembly);

            GeneralStabilityPointStructuresInput generalInput = failureMechanism.GeneralInput;

            Assert.AreEqual(2, properties.N.NumberOfDecimalPlaces);
            Assert.AreEqual(generalInput.N,
                            properties.N,
                            properties.N.GetAccuracy());
            Assert.AreEqual(generalInput.ApplyLengthEffectInSection, properties.ApplyLengthEffectInSection);
        }
Exemple #3
0
        public void Constructor_ExpectedValues()
        {
            // Setup
            var modelFactorStorageVolume = new LogNormalDistribution(2)
            {
                Mean = (RoundedDouble)1,
                StandardDeviation = (RoundedDouble)0.2
            };

            var modelFactorCollisionLoad = new VariationCoefficientNormalDistribution(1)
            {
                Mean = (RoundedDouble)1,
                CoefficientOfVariation = (RoundedDouble)0.2
            };

            var modelFactorLoadEffect = new NormalDistribution(2)
            {
                Mean = (RoundedDouble)1,
                StandardDeviation = (RoundedDouble)0.05
            };

            var modelFactorLongThreshold = new NormalDistribution(2)
            {
                Mean = (RoundedDouble)0.9,
                StandardDeviation = (RoundedDouble)0.05
            };

            // Call
            var inputParameters = new GeneralStabilityPointStructuresInput();

            // Assert
            Assert.AreEqual(2, inputParameters.N.NumberOfDecimalPlaces);
            Assert.AreEqual(3.0, inputParameters.N, inputParameters.N.GetAccuracy());

            Assert.IsFalse(inputParameters.ApplyLengthEffectInSection);

            Assert.AreEqual(2, inputParameters.GravitationalAcceleration.NumberOfDecimalPlaces);
            Assert.AreEqual(9.81, inputParameters.GravitationalAcceleration, inputParameters.GravitationalAcceleration.GetAccuracy());

            DistributionAssert.AreEqual(modelFactorStorageVolume, inputParameters.ModelFactorStorageVolume);
            DistributionAssert.AreEqual(modelFactorCollisionLoad, inputParameters.ModelFactorCollisionLoad);
            DistributionAssert.AreEqual(modelFactorLoadEffect, inputParameters.ModelFactorLoadEffect);
            DistributionAssert.AreEqual(modelFactorLongThreshold, inputParameters.ModelFactorLongThreshold);

            Assert.AreEqual(2, inputParameters.ModelFactorInflowVolume.NumberOfDecimalPlaces);
            Assert.AreEqual(1, inputParameters.ModelFactorInflowVolume, inputParameters.ModelFactorInflowVolume.GetAccuracy());

            Assert.AreEqual(0, inputParameters.ModificationFactorWavesSlowlyVaryingPressureComponent.NumberOfDecimalPlaces);
            Assert.AreEqual(1, inputParameters.ModificationFactorWavesSlowlyVaryingPressureComponent, inputParameters.ModificationFactorWavesSlowlyVaryingPressureComponent.GetAccuracy());

            Assert.AreEqual(0, inputParameters.ModificationFactorDynamicOrImpulsivePressureComponent.NumberOfDecimalPlaces);
            Assert.AreEqual(1, inputParameters.ModificationFactorDynamicOrImpulsivePressureComponent, inputParameters.ModificationFactorDynamicOrImpulsivePressureComponent.GetAccuracy());

            Assert.AreEqual(2, inputParameters.WaveRatioMaxHN.NumberOfDecimalPlaces);
            Assert.AreEqual(5000, inputParameters.WaveRatioMaxHN, inputParameters.WaveRatioMaxHN.GetAccuracy());

            Assert.AreEqual(2, inputParameters.WaveRatioMaxHStandardDeviation.NumberOfDecimalPlaces);
            Assert.AreEqual(0.5, inputParameters.WaveRatioMaxHStandardDeviation, inputParameters.WaveRatioMaxHStandardDeviation.GetAccuracy());
        }
Exemple #4
0
        public void N_SetValidValue_UpdatesValue(double value)
        {
            // Setup
            var generalStabilityPointStructuresInput = new GeneralStabilityPointStructuresInput();

            // Call
            generalStabilityPointStructuresInput.N = (RoundedDouble)value;

            // Assert
            Assert.AreEqual(2, generalStabilityPointStructuresInput.N.NumberOfDecimalPlaces);
            Assert.AreEqual(value, generalStabilityPointStructuresInput.N, generalStabilityPointStructuresInput.N.GetAccuracy());
        }
Exemple #5
0
        public void N_SetValueOutsideValidRange_ThrowArgumentOutOfRangeException(double value)
        {
            // Setup
            var generalStabilityPointStructuresInput = new GeneralStabilityPointStructuresInput();

            // Call
            TestDelegate test = () => generalStabilityPointStructuresInput.N = (RoundedDouble)value;

            // Assert
            const string expectedMessage = "De waarde voor 'N' moet in het bereik [1,00, 20,00] liggen.";

            TestHelper.AssertThrowsArgumentExceptionAndTestMessage <ArgumentOutOfRangeException>(test, expectedMessage);
        }
        public void Read_Always_ReturnGeneralStabilityPointStructuresInput()
        {
            // Setup
            var entity = new StabilityPointStructuresFailureMechanismMetaEntity
            {
                N = new Random(39).NextRoundedDouble(1.0, 20.0)
            };

            // Call
            GeneralStabilityPointStructuresInput generalInput = entity.Read();

            // Assert
            Assert.AreEqual(entity.N, generalInput.N, generalInput.N.GetAccuracy());
        }