/// <summary>
 /// Creates a new instance of <see cref="SerializableFailureMechanismSubSectionAssemblyResult"/>.
 /// </summary>
 /// <param name="assemblyMethod">The method used for this assembly result.</param>
 /// <param name="assemblyGroup">The assembly group of this assembly result.</param>
 public SerializableFailureMechanismSubSectionAssemblyResult(SerializableAssemblyMethod assemblyMethod,
                                                             SerializableFailureMechanismSectionAssemblyGroup assemblyGroup)
     : this()
 {
     AssemblyMethod = assemblyMethod;
     AssemblyGroup  = assemblyGroup;
 }
Beispiel #2
0
        public void Create_WithFailureMechanismSectionCategoryGroup_ReturnsExpectedValues(
            FailureMechanismSectionAssemblyGroup assemblyGroup, SerializableFailureMechanismSectionAssemblyGroup expectedSerializableAssemblyGroup)
        {
            // Call
            SerializableFailureMechanismSectionAssemblyGroup serializableGroup = SerializableFailureMechanismSectionAssemblyGroupCreator.Create(assemblyGroup);

            // Assert
            Assert.AreEqual(expectedSerializableAssemblyGroup, serializableGroup);
        }
Beispiel #3
0
 /// <summary>
 /// Creates a new instance of <see cref="SerializableFailureMechanismSectionAssemblyResult"/>.
 /// </summary>
 /// <param name="probabilityAssemblyMethod">The method used to assemble the probability of this result.</param>
 /// <param name="assemblyGroupAssemblyMethod">The method used to assemble the assembly group of this result.</param>
 /// <param name="assemblyGroup">The assembly group of this assembly result.</param>
 /// <param name="probability">The probability of this assembly result.</param>
 public SerializableFailureMechanismSectionAssemblyResult(SerializableAssemblyMethod probabilityAssemblyMethod,
                                                          SerializableAssemblyMethod assemblyGroupAssemblyMethod,
                                                          SerializableFailureMechanismSectionAssemblyGroup assemblyGroup,
                                                          double probability)
     : this()
 {
     ProbabilityAssemblyMethod   = probabilityAssemblyMethod;
     AssemblyGroupAssemblyMethod = assemblyGroupAssemblyMethod;
     AssemblyGroup = assemblyGroup;
     Probability   = probability;
 }
 /// <summary>
 /// Creates a new instance of <see cref="SerializableCombinedFailureMechanismSectionAssemblyResult"/>.
 /// </summary>
 /// <param name="assemblyMethod">The method used to assemble this result.</param>
 /// <param name="failureMechanismType">The type of the failure mechanism.</param>
 /// <param name="code">The code of the failure mechanism this result is assembled for.</param>
 /// <param name="name">The name of the failure mechanism this result is assembled for.</param>
 /// <param name="assemblyGroup">The group of this assembly result.</param>
 public SerializableCombinedFailureMechanismSectionAssemblyResult(
     SerializableAssemblyMethod assemblyMethod, SerializableFailureMechanismType failureMechanismType,
     string code, string name, SerializableFailureMechanismSectionAssemblyGroup assemblyGroup)
     : this()
 {
     AssemblyMethod               = assemblyMethod;
     FailureMechanismType         = failureMechanismType;
     GenericFailureMechanismCode  = code;
     SpecificFailureMechanismName = name;
     AssemblyGroup = assemblyGroup;
 }
        public void ShouldSerializeProbability_WithProbabilityAndAssemblyGroupOtherThanNotDominant_ReturnsTrue(
            SerializableFailureMechanismSectionAssemblyGroup assemblyGroup)
        {
            // Setup
            var random         = new Random(39);
            var assemblyResult = new SerializableFailureMechanismSectionAssemblyResult(
                random.NextEnumValue <SerializableAssemblyMethod>(),
                random.NextEnumValue <SerializableAssemblyMethod>(),
                assemblyGroup,
                random.NextDouble());

            // Call
            bool shouldSerialize = assemblyResult.ShouldSerializeProbability();

            // Assert
            Assert.IsTrue(shouldSerialize);
        }