Index: Ringtoets/Integration/test/Ringtoets.Integration.IO.Test/Assembly/ExportableAssessmentSectionTest.cs =================================================================== diff -u -ra48bcdc9670ec7dc1da17ca73bb6fc1f287c39a1 -ra5a1867560f3705d7037a951c9c1a7f9e817a0a6 --- Ringtoets/Integration/test/Ringtoets.Integration.IO.Test/Assembly/ExportableAssessmentSectionTest.cs (.../ExportableAssessmentSectionTest.cs) (revision a48bcdc9670ec7dc1da17ca73bb6fc1f287c39a1) +++ Ringtoets/Integration/test/Ringtoets.Integration.IO.Test/Assembly/ExportableAssessmentSectionTest.cs (.../ExportableAssessmentSectionTest.cs) (revision a5a1867560f3705d7037a951c9c1a7f9e817a0a6) @@ -27,6 +27,7 @@ using NUnit.Framework; using Ringtoets.AssemblyTool.Data; using Ringtoets.Integration.IO.Assembly; +using Ringtoets.Integration.IO.TestUtil; namespace Ringtoets.Integration.IO.Test.Assembly { @@ -47,8 +48,8 @@ TestDelegate call = () => new ExportableAssessmentSection(null, geometry, CreateAssessmentSectionAssembly(), - CreateFailureMechanismAssemblyResultWithProbability(), - CreateFailureMechanismAssemblyResultWithoutProbability(), + ExportableFailureMechanismAssemblyResultTestFactory.CreateFailureMechanismAssemblyResultWithProbability(), + ExportableFailureMechanismAssemblyResultTestFactory.CreateFailureMechanismAssemblyResultWithoutProbability(), failureMechanismsWithProbability, failureMechanismsWithoutProbability, CreateCombinedSectionAssemblyCollection()); @@ -70,9 +71,9 @@ // Call TestDelegate call = () => new ExportableAssessmentSection(string.Empty, null, - CreateAssessmentSectionAssembly(), - CreateFailureMechanismAssemblyResultWithProbability(), - CreateFailureMechanismAssemblyResultWithoutProbability(), + CreateAssessmentSectionAssembly(), + ExportableFailureMechanismAssemblyResultTestFactory.CreateFailureMechanismAssemblyResultWithProbability(), + ExportableFailureMechanismAssemblyResultTestFactory.CreateFailureMechanismAssemblyResultWithoutProbability(), failureMechanismsWithProbability, failureMechanismsWithoutProbability, CreateCombinedSectionAssemblyCollection()); @@ -96,8 +97,8 @@ TestDelegate call = () => new ExportableAssessmentSection(string.Empty, geometry, null, - CreateFailureMechanismAssemblyResultWithProbability(), - CreateFailureMechanismAssemblyResultWithoutProbability(), + ExportableFailureMechanismAssemblyResultTestFactory.CreateFailureMechanismAssemblyResultWithProbability(), + ExportableFailureMechanismAssemblyResultTestFactory.CreateFailureMechanismAssemblyResultWithoutProbability(), failureMechanismsWithProbability, failureMechanismsWithoutProbability, CreateCombinedSectionAssemblyCollection()); @@ -121,7 +122,7 @@ geometry, CreateAssessmentSectionAssembly(), null, - CreateFailureMechanismAssemblyResultWithoutProbability(), + ExportableFailureMechanismAssemblyResultTestFactory.CreateFailureMechanismAssemblyResultWithoutProbability(), failureMechanismsWithProbability, failureMechanismsWithoutProbability, CreateCombinedSectionAssemblyCollection()); @@ -145,7 +146,7 @@ TestDelegate call = () => new ExportableAssessmentSection(string.Empty, geometry, CreateAssessmentSectionAssembly(), - CreateFailureMechanismAssemblyResultWithProbability(), + ExportableFailureMechanismAssemblyResultTestFactory.CreateFailureMechanismAssemblyResultWithProbability(), null, failureMechanismsWithProbability, failureMechanismsWithoutProbability, @@ -167,9 +168,9 @@ // Call TestDelegate call = () => new ExportableAssessmentSection(string.Empty, geometry, - CreateAssessmentSectionAssembly(), - CreateFailureMechanismAssemblyResultWithProbability(), - CreateFailureMechanismAssemblyResultWithoutProbability(), + CreateAssessmentSectionAssembly(), + ExportableFailureMechanismAssemblyResultTestFactory.CreateFailureMechanismAssemblyResultWithProbability(), + ExportableFailureMechanismAssemblyResultTestFactory.CreateFailureMechanismAssemblyResultWithoutProbability(), null, failureMechanismsWithoutProbability, CreateCombinedSectionAssemblyCollection()); @@ -189,9 +190,9 @@ // Call TestDelegate call = () => new ExportableAssessmentSection(string.Empty, geometry, - CreateAssessmentSectionAssembly(), - CreateFailureMechanismAssemblyResultWithProbability(), - CreateFailureMechanismAssemblyResultWithoutProbability(), + CreateAssessmentSectionAssembly(), + ExportableFailureMechanismAssemblyResultTestFactory.CreateFailureMechanismAssemblyResultWithProbability(), + ExportableFailureMechanismAssemblyResultTestFactory.CreateFailureMechanismAssemblyResultWithoutProbability(), failureMechanismsWithProbability, null, CreateCombinedSectionAssemblyCollection()); @@ -214,9 +215,9 @@ // Call TestDelegate call = () => new ExportableAssessmentSection(string.Empty, geometry, - CreateAssessmentSectionAssembly(), - CreateFailureMechanismAssemblyResultWithProbability(), - CreateFailureMechanismAssemblyResultWithoutProbability(), + CreateAssessmentSectionAssembly(), + ExportableFailureMechanismAssemblyResultTestFactory.CreateFailureMechanismAssemblyResultWithProbability(), + ExportableFailureMechanismAssemblyResultTestFactory.CreateFailureMechanismAssemblyResultWithoutProbability(), failureMechanismsWithProbability, failureMechanismsWithoutProbability, null); @@ -234,8 +235,8 @@ // Setup IEnumerable geometry = Enumerable.Empty(); ExportableAssessmentSectionAssemblyResult assessmentSectionAssembly = CreateAssessmentSectionAssembly(); - ExportableFailureMechanismAssemblyResultWithProbability failureMechanismAssemblyResultWithProbability = CreateFailureMechanismAssemblyResultWithProbability(); - ExportableFailureMechanismAssemblyResult failureMechanismAssemblyResultWithoutProbability = CreateFailureMechanismAssemblyResultWithoutProbability(); + ExportableFailureMechanismAssemblyResultWithProbability failureMechanismAssemblyResultWithProbability = ExportableFailureMechanismAssemblyResultTestFactory.CreateFailureMechanismAssemblyResultWithProbability(); + ExportableFailureMechanismAssemblyResult failureMechanismAssemblyResultWithoutProbability = ExportableFailureMechanismAssemblyResultTestFactory.CreateFailureMechanismAssemblyResultWithoutProbability(); IEnumerable> failureMechanismsWithProbability = Enumerable.Empty>(); IEnumerable> failureMechanismsWithoutProbability = @@ -249,7 +250,8 @@ failureMechanismAssemblyResultWithProbability, failureMechanismAssemblyResultWithoutProbability, failureMechanismsWithProbability, - failureMechanismsWithoutProbability, combinedSectionAssemblyResults); + failureMechanismsWithoutProbability, + combinedSectionAssemblyResults); // Assert Assert.AreEqual(name, assessmentSection.Name); @@ -262,21 +264,6 @@ Assert.AreSame(combinedSectionAssemblyResults, assessmentSection.CombinedSectionAssemblyResults); } - private static ExportableFailureMechanismAssemblyResult CreateFailureMechanismAssemblyResultWithoutProbability() - { - var random = new Random(21); - return new ExportableFailureMechanismAssemblyResult(random.NextEnumValue(), - random.NextEnumValue()); - } - - private static ExportableFailureMechanismAssemblyResultWithProbability CreateFailureMechanismAssemblyResultWithProbability() - { - var random = new Random(21); - return new ExportableFailureMechanismAssemblyResultWithProbability(random.NextEnumValue(), - random.NextEnumValue(), - random.NextDouble()); - } - private static ExportableCombinedSectionAssemblyCollection CreateCombinedSectionAssemblyCollection() { return new ExportableCombinedSectionAssemblyCollection(Enumerable.Empty(),