示例#1
0
        public void ReadNonAdoptableWithProfileProbabilityFailureMechanismSectionResultEntity_SectionResultNull_ThrowsArgumentNullException()
        {
            // Setup
            var entity = new NonAdoptableWithProfileProbabilityFailureMechanismSectionResultEntity();

            // Call
            void Call() => entity.Read(null);

            // Assert
            string paramName = Assert.Throws <ArgumentNullException>(Call).ParamName;

            Assert.AreEqual("sectionResult", paramName);
        }
示例#2
0
        public void ReadNonAdoptableWithProfileProbabilityFailureMechanismSectionResultEntity_EntityWithNullValues_SectionResultWithNaNValues()
        {
            // Setup
            var entity        = new NonAdoptableWithProfileProbabilityFailureMechanismSectionResultEntity();
            var sectionResult = new NonAdoptableWithProfileProbabilityFailureMechanismSectionResult(
                FailureMechanismSectionTestFactory.CreateFailureMechanismSection());

            // Call
            entity.Read(sectionResult);

            // Assert
            Assert.IsNaN(sectionResult.ManualInitialFailureMechanismResultProfileProbability);
            Assert.IsNaN(sectionResult.ManualInitialFailureMechanismResultSectionProbability);
            Assert.IsNaN(sectionResult.RefinedProfileProbability);
            Assert.IsNaN(sectionResult.RefinedSectionProbability);
        }
示例#3
0
        public void ReadNonAdoptableWithProfileProbabilityFailureMechanismSectionResultEntity_ParameterValues_SectionResultWithParameterValues()
        {
            // Setup
            var    random     = new Random(21);
            bool   isRelevant = random.NextBoolean();
            var    initialFailureMechanismResultType = random.NextEnumValue <NonAdoptableInitialFailureMechanismResultType>();
            double manualProfileProbability          = random.NextDouble();
            double manualSectionProbability          = random.NextDouble();
            var    furtherAnalysisType       = random.NextEnumValue <FailureMechanismSectionResultFurtherAnalysisType>();
            double refinedProfileProbability = random.NextDouble();
            double refinedSectionProbability = random.NextDouble();

            var entity = new NonAdoptableWithProfileProbabilityFailureMechanismSectionResultEntity
            {
                IsRelevant = Convert.ToByte(isRelevant),
                InitialFailureMechanismResultType = Convert.ToByte(initialFailureMechanismResultType),
                ManualInitialFailureMechanismResultProfileProbability = manualProfileProbability,
                ManualInitialFailureMechanismResultSectionProbability = manualSectionProbability,
                FurtherAnalysisType       = Convert.ToByte(furtherAnalysisType),
                RefinedProfileProbability = refinedProfileProbability,
                RefinedSectionProbability = refinedSectionProbability
            };

            var sectionResult = new NonAdoptableWithProfileProbabilityFailureMechanismSectionResult(
                FailureMechanismSectionTestFactory.CreateFailureMechanismSection());

            // Call
            entity.Read(sectionResult);

            // Assert
            Assert.AreEqual(isRelevant, sectionResult.IsRelevant);
            Assert.AreEqual(initialFailureMechanismResultType, sectionResult.InitialFailureMechanismResultType);
            Assert.AreEqual(manualProfileProbability, sectionResult.ManualInitialFailureMechanismResultProfileProbability);
            Assert.AreEqual(manualSectionProbability, sectionResult.ManualInitialFailureMechanismResultSectionProbability);
            Assert.AreEqual(furtherAnalysisType, sectionResult.FurtherAnalysisType);
            Assert.AreEqual(refinedProfileProbability, sectionResult.RefinedProfileProbability);
            Assert.AreEqual(refinedSectionProbability, sectionResult.RefinedSectionProbability);
        }