Example #1
0
        public void ReadAdoptableWithProfileProbabilityFailureMechanismSectionResultEntity_SectionResultNull_ThrowsArgumentNullException()
        {
            // Setup
            var entity = new AdoptableWithProfileProbabilityFailureMechanismSectionResultEntity();

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

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

            Assert.AreEqual("sectionResult", paramName);
        }
Example #2
0
        public void ReadAdoptableWithProfileProbabilityFailureMechanismSectionResultEntity_EntityWithNullValues_SectionResultWithNaNValues()
        {
            // Setup
            var entity        = new AdoptableWithProfileProbabilityFailureMechanismSectionResultEntity();
            var sectionResult = new AdoptableWithProfileProbabilityFailureMechanismSectionResult(
                FailureMechanismSectionTestFactory.CreateFailureMechanismSection());

            // Call
            entity.Read(sectionResult);

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

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

            var sectionResult = new AdoptableWithProfileProbabilityFailureMechanismSectionResult(
                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(probabilityRefinementType, sectionResult.ProbabilityRefinementType);
            Assert.AreEqual(refinedProfileProbability, sectionResult.RefinedProfileProbability);
            Assert.AreEqual(refinedSectionProbability, sectionResult.RefinedSectionProbability);
        }