/// <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; }
public void Create_WithAssemblyMethod_ReturnsExpectedValues(ExportableAssemblyMethod assemblyMethod, SerializableAssemblyMethod expectedAssemblyMethod) { // Call SerializableAssemblyMethod serializableAssemblyMethod = SerializableAssemblyMethodCreator.Create(assemblyMethod); // Assert Assert.AreEqual(expectedAssemblyMethod, serializableAssemblyMethod); }
/// <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; }
/// <summary> /// Creates an instance of <see cref="SerializableTotalAssemblyResult"/> /// based on its input parameters /// </summary> /// <param name="idGenerator">The generator to generate an id for the <see cref="SerializableTotalAssemblyResult"/>.</param> /// <param name="assessmentProcess">The assessment process this result belongs to.</param> /// <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 group of this assembly result.</param> /// <param name="probability">The probability of this assembly result.</param> /// <returns>A <see cref="SerializableTotalAssemblyResult"/>.</returns> /// <exception cref="ArgumentNullException">Thrown when <paramref name="idGenerator"/> /// or <paramref name="assessmentProcess"/> is <c>null</c>.</exception> public static SerializableTotalAssemblyResult Create(IdentifierGenerator idGenerator, SerializableAssessmentProcess assessmentProcess, SerializableAssemblyMethod probabilityAssemblyMethod, SerializableAssemblyMethod assemblyGroupAssemblyMethod, SerializableAssessmentSectionAssemblyGroup assemblyGroup, double probability) { if (idGenerator == null) { throw new ArgumentNullException(nameof(idGenerator)); } return(new SerializableTotalAssemblyResult(idGenerator.GetNewId(Resources.SerializableTotalAssemblyResult_IdPrefix), assessmentProcess, probabilityAssemblyMethod, assemblyGroupAssemblyMethod, assemblyGroup, probability)); }
/// <summary> /// Creates a new instance of <see cref="SerializableTotalAssemblyResult"/>. /// </summary> /// <param name="id">The unique assembly ID.</param> /// <param name="assessmentProcess">The assessment process this result belongs to.</param> /// <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 group of this assembly result.</param> /// <param name="probability">The probability of this assembly result.</param> /// <exception cref="ArgumentNullException">Thrown when <paramref name="assessmentProcess"/> is <c>null</c>.</exception> /// <exception cref="ArgumentException">Thrown when <paramref name="id"/> is invalid.</exception> public SerializableTotalAssemblyResult(string id, SerializableAssessmentProcess assessmentProcess, SerializableAssemblyMethod probabilityAssemblyMethod, SerializableAssemblyMethod assemblyGroupAssemblyMethod, SerializableAssessmentSectionAssemblyGroup assemblyGroup, double probability) : this() { SerializableIdValidator.ThrowIfInvalid(id); if (assessmentProcess == null) { throw new ArgumentNullException(nameof(assessmentProcess)); } Id = id; AssessmentProcessId = assessmentProcess.Id; ProbabilityAssemblyMethod = probabilityAssemblyMethod; AssemblyGroupAssemblyMethod = assemblyGroupAssemblyMethod; AssemblyGroup = assemblyGroup; Probability = probability; }
/// <summary> /// Creates a new instance of <see cref="SerializableFailureMechanismAssemblyResult"/>. /// </summary> /// <param name="probability">The probability of this assembly result.</param> /// <param name="assemblyMethod">The method that was used to assemble this result.</param> public SerializableFailureMechanismAssemblyResult(double probability, SerializableAssemblyMethod assemblyMethod) : this() { Probability = probability; AssemblyMethod = assemblyMethod; }