示例#1
0
        public void ClearIllustrationPoints_OutputWithoutGeneralResult_OtherOutputIsNotAffected()
        {
            // Setup
            var    random      = new Random(39);
            double reliability = random.NextDouble();

            var partialProbabilisticPipingOutput = new TestPartialProbabilisticPipingOutput(reliability, null);

            // Call
            partialProbabilisticPipingOutput.ClearIllustrationPoints();

            // Assert
            Assert.AreEqual(reliability, partialProbabilisticPipingOutput.Reliability);
            Assert.IsFalse(partialProbabilisticPipingOutput.HasGeneralResult);
            Assert.IsNull(partialProbabilisticPipingOutput.GeneralResult);
        }
示例#2
0
        public void Constructor_ExpectedValues(bool withIllustrationPoints)
        {
            // Setup
            var    random      = new Random(39);
            double reliability = random.NextDouble();
            GeneralResult <TestTopLevelIllustrationPoint> generalResult = withIllustrationPoints
                                                                             ? new TestGeneralResultTopLevelIllustrationPoint()
                                                                             : null;

            // Call
            var partialProbabilisticPipingOutput = new TestPartialProbabilisticPipingOutput(reliability, generalResult);

            // Assert
            Assert.IsInstanceOf <IPartialProbabilisticPipingOutput>(partialProbabilisticPipingOutput);
            Assert.IsInstanceOf <ICloneable>(partialProbabilisticPipingOutput);
            Assert.AreEqual(reliability, partialProbabilisticPipingOutput.Reliability);
            Assert.AreEqual(withIllustrationPoints, partialProbabilisticPipingOutput.HasGeneralResult);
            Assert.AreSame(generalResult, partialProbabilisticPipingOutput.GeneralResult);
        }
        public void ClearIllustrationPoints_OutputWithoutGeneralResult_OtherOutputIsNotAffected()
        {
            // Setup
            var    random = new Random(39);
            double sectionSpecificReliability = random.NextDouble();
            double profileSpecificReliability = random.NextDouble();
            var    sectionSpecificOutput      = new TestPartialProbabilisticPipingOutput(sectionSpecificReliability, null);
            var    profileSpecificOutput      = new TestPartialProbabilisticPipingOutput(profileSpecificReliability, null);
            var    output = new ProbabilisticPipingOutput(sectionSpecificOutput, profileSpecificOutput);

            // Call
            output.ClearIllustrationPoints();

            // Assert
            Assert.AreEqual(sectionSpecificReliability, output.SectionSpecificOutput.Reliability);
            Assert.IsFalse(output.SectionSpecificOutput.HasGeneralResult);
            Assert.IsNull(sectionSpecificOutput.GeneralResult);
            Assert.AreEqual(profileSpecificReliability, output.ProfileSpecificOutput.Reliability);
            Assert.IsFalse(output.ProfileSpecificOutput.HasGeneralResult);
            Assert.IsNull(profileSpecificOutput.GeneralResult);
        }