Exemplo n.º 1
0
        public void Constructor_ExpectedValues()
        {
            // Call
            var calculation = new TestSemiProbabilisticPipingCalculation();

            // Assert
            Assert.IsInstanceOf <PipingCalculation <SemiProbabilisticPipingInput> >(calculation);
            Assert.IsInstanceOf <SemiProbabilisticPipingInput>(calculation.InputParameters);

            Assert.IsNull(calculation.Output);
        }
Exemplo n.º 2
0
        public void HasOutput_OutputSet_ReturnsTrue()
        {
            // Setup
            var calculation = new TestSemiProbabilisticPipingCalculation
            {
                Output = PipingTestDataGenerator.GetRandomSemiProbabilisticPipingOutput()
            };

            // Call
            bool hasOutput = calculation.HasOutput;

            // Assert
            Assert.IsTrue(hasOutput);
        }
Exemplo n.º 3
0
        public void HasOutput_OutputNull_ReturnsFalse()
        {
            // Setup
            var calculation = new TestSemiProbabilisticPipingCalculation
            {
                Output = null
            };

            // Call
            bool hasOutput = calculation.HasOutput;

            // Assert
            Assert.IsFalse(hasOutput);
        }
Exemplo n.º 4
0
        public void ShouldCalculate_HasOutputTrue_ReturnsFalse()
        {
            // Setup
            var calculation = new TestSemiProbabilisticPipingCalculation
            {
                Output = PipingTestDataGenerator.GetRandomSemiProbabilisticPipingOutput()
            };

            // Call
            bool shouldCalculate = calculation.ShouldCalculate;

            // Assert
            Assert.IsFalse(shouldCalculate);
        }
Exemplo n.º 5
0
        public void ShouldCalculate_HasOutputFalse_ReturnsTrue()
        {
            // Setup
            var calculation = new TestSemiProbabilisticPipingCalculation
            {
                Output = null
            };

            // Call
            bool shouldCalculate = calculation.ShouldCalculate;

            // Assert
            Assert.IsTrue(shouldCalculate);
        }
Exemplo n.º 6
0
        public void ClearOutput_Always_SetsOutputToNull()
        {
            // Setup
            var calculation = new TestSemiProbabilisticPipingCalculation
            {
                Output = PipingTestDataGenerator.GetRandomSemiProbabilisticPipingOutput()
            };

            // Call
            calculation.ClearOutput();

            // Assert
            Assert.IsNull(calculation.Output);
        }
Exemplo n.º 7
0
        private static SemiProbabilisticPipingCalculation CreateRandomCalculationWithoutOutput()
        {
            var calculation = new TestSemiProbabilisticPipingCalculation
            {
                Name     = "Random name",
                Comments =
                {
                    Body = "Random body"
                }
            };

            PipingTestDataGenerator.SetRandomDataToPipingInput(calculation.InputParameters);

            return(calculation);
        }
        public void Constructor_ExpectedValues()
        {
            // Setup
            var calculation = new TestSemiProbabilisticPipingCalculation();

            // Call
            var activity = new SemiProbabilisticPipingCalculationActivity(calculation,
                                                                          new GeneralPipingInput(),
                                                                          RoundedDouble.NaN);

            // Assert
            Assert.IsInstanceOf <CalculatableActivity>(activity);
            Assert.AreEqual($"Uitvoeren van berekening '{calculation.Name}'", activity.Description);
            Assert.IsNull(activity.ProgressText);
            Assert.AreEqual(ActivityState.None, activity.State);
        }