public void CreateInstance_WithContext_ReturnsView()
        {
            // Setup
            var context = new ProbabilisticPipingSectionSpecificOutputContext(new ProbabilisticPipingCalculationScenario());

            // Call
            IView view = info.CreateInstance(context);

            // Assert
            Assert.IsInstanceOf <ProbabilisticSubMechanismPipingOutputView>(view);
        }
Пример #2
0
        public void ForeColor_HasNoOutput_ReturnGrayText()
        {
            // Setup
            var context = new ProbabilisticPipingSectionSpecificOutputContext(new ProbabilisticPipingCalculationScenario());

            // Call
            Color color = info.ForeColor(context);

            // Assert
            Assert.AreEqual(Color.FromKnownColor(KnownColor.GrayText), color);
        }
        public void AdditionalDataCheck_CalculationWithoutOutput_ReturnsFalse()
        {
            // Setup
            var context = new ProbabilisticPipingSectionSpecificOutputContext(
                new ProbabilisticPipingCalculationScenario());

            // Call
            bool additionalDataCheck = info.AdditionalDataCheck(context);

            // Assert
            Assert.IsFalse(additionalDataCheck);
        }
        public void GetViewData_WithContext_ReturnsWrappedCalculationScenario()
        {
            // Setup
            var calculationScenario = new ProbabilisticPipingCalculationScenario();
            var context             = new ProbabilisticPipingSectionSpecificOutputContext(calculationScenario);

            // Call
            object viewData = info.GetViewData(context);

            // Assert
            Assert.AreSame(calculationScenario, viewData);
        }
        public void Constructor_ExpectedValues()
        {
            // Setup
            var calculation = new ProbabilisticPipingCalculationScenario();

            // Call
            var context = new ProbabilisticPipingSectionSpecificOutputContext(calculation);

            // Assert
            Assert.IsInstanceOf <ObservableWrappedObjectContextBase <ProbabilisticPipingCalculationScenario> >(context);
            Assert.AreSame(calculation, context.WrappedData);
        }
        public void AdditionalDataCheck_CalculationWithoutSubMechanismOutput_ReturnsFalse()
        {
            // Setup
            var calculation = new ProbabilisticPipingCalculationScenario
            {
                Output = PipingTestDataGenerator.GetRandomProbabilisticPipingOutputWithIllustrationPoints()
            };

            var context = new ProbabilisticPipingSectionSpecificOutputContext(calculation);

            // Call
            bool additionalDataCheck = info.AdditionalDataCheck(context);

            // Assert
            Assert.IsFalse(additionalDataCheck);
        }
Пример #7
0
        public void ForeColor_HasOutput_ReturnControlText()
        {
            // Setup
            var calculation = new ProbabilisticPipingCalculationScenario
            {
                Output = PipingTestDataGenerator.GetRandomProbabilisticPipingOutputWithIllustrationPoints()
            };

            var context = new ProbabilisticPipingSectionSpecificOutputContext(calculation);

            // Call
            Color color = info.ForeColor(context);

            // Assert
            Assert.AreEqual(Color.FromKnownColor(KnownColor.ControlText), color);
        }
        public void CreateInstance_WithContextWithOtherPartialOutput_Null()
        {
            // Setup
            var calculation = new ProbabilisticPipingCalculationScenario
            {
                Output = new ProbabilisticPipingOutput(PipingTestDataGenerator.GetRandomPartialProbabilisticPipingOutput(),
                                                       PipingTestDataGenerator.GetRandomPartialProbabilisticPipingOutput())
            };

            var context = new ProbabilisticPipingSectionSpecificOutputContext(calculation);

            // Call
            IObjectProperties objectProperties = info.CreateInstance(context);

            // Assert
            Assert.IsNull(objectProperties);
        }
        public void CreateInstance_WithContextWithPartialSubMechanismOutput_ExpectedProperties()
        {
            // Setup
            var calculation = new ProbabilisticPipingCalculationScenario
            {
                Output = new ProbabilisticPipingOutput(PipingTestDataGenerator.GetRandomPartialProbabilisticSubMechanismPipingOutput(),
                                                       PipingTestDataGenerator.GetRandomPartialProbabilisticSubMechanismPipingOutput())
            };

            var context = new ProbabilisticPipingSectionSpecificOutputContext(calculation);

            // Call
            IObjectProperties objectProperties = info.CreateInstance(context);

            // Assert
            Assert.IsInstanceOf <ProbabilisticSubMechanismPipingOutputProperties>(objectProperties);
            Assert.AreSame(context.WrappedData.Output.SectionSpecificOutput, objectProperties.Data);
        }
        public void AdditionalDataCheck_CalculationWithSubMechanismOutput_ReturnsTrue()
        {
            // Setup
            var calculation = new ProbabilisticPipingCalculationScenario
            {
                Output = new ProbabilisticPipingOutput(
                    PipingTestDataGenerator.GetRandomPartialProbabilisticSubMechanismPipingOutput(),
                    PipingTestDataGenerator.GetRandomPartialProbabilisticSubMechanismPipingOutput())
            };

            var context = new ProbabilisticPipingSectionSpecificOutputContext(calculation);

            // Call
            bool additionalDataCheck = info.AdditionalDataCheck(context);

            // Assert
            Assert.IsTrue(additionalDataCheck);
        }