Index: Ringtoets/Integration/test/Ringtoets.Integration.IO.Test/Assembly/ExportableAssessmentSectionTest.cs =================================================================== diff -u -r3293cb26e7540dc2e61becd7eda453e234d30664 -r30c0356e486b018532e85b0dde94efe832cf445f --- Ringtoets/Integration/test/Ringtoets.Integration.IO.Test/Assembly/ExportableAssessmentSectionTest.cs (.../ExportableAssessmentSectionTest.cs) (revision 3293cb26e7540dc2e61becd7eda453e234d30664) +++ Ringtoets/Integration/test/Ringtoets.Integration.IO.Test/Assembly/ExportableAssessmentSectionTest.cs (.../ExportableAssessmentSectionTest.cs) (revision 30c0356e486b018532e85b0dde94efe832cf445f) @@ -23,9 +23,7 @@ using System.Collections.Generic; using System.Linq; using Core.Common.Base.Geometry; -using Core.Common.TestUtil; using NUnit.Framework; -using Ringtoets.AssemblyTool.Data; using Ringtoets.Integration.IO.Assembly; using Ringtoets.Integration.IO.TestUtil; @@ -47,7 +45,7 @@ // Call TestDelegate call = () => new ExportableAssessmentSection(null, geometry, - CreateAssessmentSectionAssembly(), + ExportableAssessmentSectionAssemblyResultTestFactory.CreateResult(), ExportableFailureMechanismAssemblyResultTestFactory.CreateResultWithProbability(), ExportableFailureMechanismAssemblyResultTestFactory.CreateResultWithoutProbability(), failureMechanismsWithProbability, @@ -71,7 +69,7 @@ // Call TestDelegate call = () => new ExportableAssessmentSection(string.Empty, null, - CreateAssessmentSectionAssembly(), + ExportableAssessmentSectionAssemblyResultTestFactory.CreateResult(), ExportableFailureMechanismAssemblyResultTestFactory.CreateResultWithProbability(), ExportableFailureMechanismAssemblyResultTestFactory.CreateResultWithoutProbability(), failureMechanismsWithProbability, @@ -97,7 +95,7 @@ TestDelegate call = () => new ExportableAssessmentSection(string.Empty, geometry, null, - ExportableFailureMechanismAssemblyResultTestFactory.CreateResultWithProbability(), + ExportableFailureMechanismAssemblyResultTestFactory.CreateResultWithProbability(), ExportableFailureMechanismAssemblyResultTestFactory.CreateResultWithoutProbability(), failureMechanismsWithProbability, failureMechanismsWithoutProbability, CreateCombinedSectionAssemblyCollection()); @@ -120,7 +118,7 @@ // Call TestDelegate call = () => new ExportableAssessmentSection(string.Empty, geometry, - CreateAssessmentSectionAssembly(), + ExportableAssessmentSectionAssemblyResultTestFactory.CreateResult(), null, ExportableFailureMechanismAssemblyResultTestFactory.CreateResultWithoutProbability(), failureMechanismsWithProbability, @@ -145,7 +143,7 @@ // Call TestDelegate call = () => new ExportableAssessmentSection(string.Empty, geometry, - CreateAssessmentSectionAssembly(), + ExportableAssessmentSectionAssemblyResultTestFactory.CreateResult(), ExportableFailureMechanismAssemblyResultTestFactory.CreateResultWithProbability(), null, failureMechanismsWithProbability, @@ -168,8 +166,8 @@ // Call TestDelegate call = () => new ExportableAssessmentSection(string.Empty, geometry, - CreateAssessmentSectionAssembly(), - ExportableFailureMechanismAssemblyResultTestFactory.CreateResultWithProbability(), + ExportableAssessmentSectionAssemblyResultTestFactory.CreateResult(), + ExportableFailureMechanismAssemblyResultTestFactory.CreateResultWithProbability(), ExportableFailureMechanismAssemblyResultTestFactory.CreateResultWithoutProbability(), null, failureMechanismsWithoutProbability, CreateCombinedSectionAssemblyCollection()); @@ -190,8 +188,8 @@ // Call TestDelegate call = () => new ExportableAssessmentSection(string.Empty, geometry, - CreateAssessmentSectionAssembly(), - ExportableFailureMechanismAssemblyResultTestFactory.CreateResultWithProbability(), + ExportableAssessmentSectionAssemblyResultTestFactory.CreateResult(), + ExportableFailureMechanismAssemblyResultTestFactory.CreateResultWithProbability(), ExportableFailureMechanismAssemblyResultTestFactory.CreateResultWithoutProbability(), failureMechanismsWithProbability, null, @@ -215,8 +213,8 @@ // Call TestDelegate call = () => new ExportableAssessmentSection(string.Empty, geometry, - CreateAssessmentSectionAssembly(), - ExportableFailureMechanismAssemblyResultTestFactory.CreateResultWithProbability(), + ExportableAssessmentSectionAssemblyResultTestFactory.CreateResult(), + ExportableFailureMechanismAssemblyResultTestFactory.CreateResultWithProbability(), ExportableFailureMechanismAssemblyResultTestFactory.CreateResultWithoutProbability(), failureMechanismsWithProbability, failureMechanismsWithoutProbability, @@ -234,9 +232,11 @@ { // Setup IEnumerable geometry = Enumerable.Empty(); - ExportableAssessmentSectionAssemblyResult assessmentSectionAssembly = CreateAssessmentSectionAssembly(); - ExportableFailureMechanismAssemblyResultWithProbability failureMechanismAssemblyResultWithProbability = ExportableFailureMechanismAssemblyResultTestFactory.CreateResultWithProbability(); - ExportableFailureMechanismAssemblyResult failureMechanismAssemblyResultWithoutProbability = ExportableFailureMechanismAssemblyResultTestFactory.CreateResultWithoutProbability(); + ExportableAssessmentSectionAssemblyResult assessmentSectionAssembly = ExportableAssessmentSectionAssemblyResultTestFactory.CreateResult(); + ExportableFailureMechanismAssemblyResultWithProbability failureMechanismAssemblyResultWithProbability = + ExportableFailureMechanismAssemblyResultTestFactory.CreateResultWithProbability(); + ExportableFailureMechanismAssemblyResult failureMechanismAssemblyResultWithoutProbability = + ExportableFailureMechanismAssemblyResultTestFactory.CreateResultWithoutProbability(); IEnumerable> failureMechanismsWithProbability = Enumerable.Empty>(); IEnumerable> failureMechanismsWithoutProbability = @@ -269,12 +269,5 @@ return new ExportableCombinedSectionAssemblyCollection(Enumerable.Empty(), Enumerable.Empty()); } - - private static ExportableAssessmentSectionAssemblyResult CreateAssessmentSectionAssembly() - { - var random = new Random(21); - return new ExportableAssessmentSectionAssemblyResult(random.NextEnumValue(), - random.NextEnumValue()); - } } } \ No newline at end of file Index: Ringtoets/Integration/test/Ringtoets.Integration.IO.TestUtil.Test/ExportableAssessmentSectionAssemblyResultTestFactoryTest.cs =================================================================== diff -u --- Ringtoets/Integration/test/Ringtoets.Integration.IO.TestUtil.Test/ExportableAssessmentSectionAssemblyResultTestFactoryTest.cs (revision 0) +++ Ringtoets/Integration/test/Ringtoets.Integration.IO.TestUtil.Test/ExportableAssessmentSectionAssemblyResultTestFactoryTest.cs (revision 30c0356e486b018532e85b0dde94efe832cf445f) @@ -0,0 +1,44 @@ +// Copyright (C) Stichting Deltares 2017. All rights reserved. +// +// This file is part of Ringtoets. +// +// Ringtoets is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using NUnit.Framework; +using Ringtoets.AssemblyTool.Data; +using Ringtoets.Integration.IO.Assembly; + +namespace Ringtoets.Integration.IO.TestUtil.Test +{ + [TestFixture] + public class ExportableAssessmentSectionAssemblyResultTestFactoryTest + { + [Test] + public void CreateResult_Always_ReturnsExportableAssessmentSectionAssemblyResult() + { + // Call + ExportableAssessmentSectionAssemblyResult result = + ExportableAssessmentSectionAssemblyResultTestFactory.CreateResult(); + + + // Assert + Assert.AreEqual(ExportableAssemblyMethod.WBI2C1, result.AssemblyMethod); + Assert.AreEqual(AssessmentSectionAssemblyCategoryGroup.C, result.AssemblyCategory); + } + } +} \ No newline at end of file Index: Ringtoets/Integration/test/Ringtoets.Integration.IO.TestUtil.Test/Ringtoets.Integration.IO.TestUtil.Test.csproj =================================================================== diff -u -ra5a1867560f3705d7037a951c9c1a7f9e817a0a6 -r30c0356e486b018532e85b0dde94efe832cf445f --- Ringtoets/Integration/test/Ringtoets.Integration.IO.TestUtil.Test/Ringtoets.Integration.IO.TestUtil.Test.csproj (.../Ringtoets.Integration.IO.TestUtil.Test.csproj) (revision a5a1867560f3705d7037a951c9c1a7f9e817a0a6) +++ Ringtoets/Integration/test/Ringtoets.Integration.IO.TestUtil.Test/Ringtoets.Integration.IO.TestUtil.Test.csproj (.../Ringtoets.Integration.IO.TestUtil.Test.csproj) (revision 30c0356e486b018532e85b0dde94efe832cf445f) @@ -7,6 +7,7 @@ + Index: Ringtoets/Integration/test/Ringtoets.Integration.IO.TestUtil/ExportableAssessmentSectionAssemblyResultTestFactory.cs =================================================================== diff -u --- Ringtoets/Integration/test/Ringtoets.Integration.IO.TestUtil/ExportableAssessmentSectionAssemblyResultTestFactory.cs (revision 0) +++ Ringtoets/Integration/test/Ringtoets.Integration.IO.TestUtil/ExportableAssessmentSectionAssemblyResultTestFactory.cs (revision 30c0356e486b018532e85b0dde94efe832cf445f) @@ -0,0 +1,43 @@ +// Copyright (C) Stichting Deltares 2017. All rights reserved. +// +// This file is part of Ringtoets. +// +// Ringtoets is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using Ringtoets.AssemblyTool.Data; +using Ringtoets.Integration.IO.Assembly; + +namespace Ringtoets.Integration.IO.TestUtil +{ + /// + /// Factory that creates simple instances + /// which can be used for testing. + /// + public static class ExportableAssessmentSectionAssemblyResultTestFactory + { + /// + /// Creates a default instance of . + /// + /// A . + public static ExportableAssessmentSectionAssemblyResult CreateResult() + { + return new ExportableAssessmentSectionAssemblyResult(ExportableAssemblyMethod.WBI2C1, + AssessmentSectionAssemblyCategoryGroup.C); + } + } +} \ No newline at end of file Index: Ringtoets/Integration/test/Ringtoets.Integration.IO.TestUtil/Ringtoets.Integration.IO.TestUtil.csproj =================================================================== diff -u -ra5a1867560f3705d7037a951c9c1a7f9e817a0a6 -r30c0356e486b018532e85b0dde94efe832cf445f --- Ringtoets/Integration/test/Ringtoets.Integration.IO.TestUtil/Ringtoets.Integration.IO.TestUtil.csproj (.../Ringtoets.Integration.IO.TestUtil.csproj) (revision a5a1867560f3705d7037a951c9c1a7f9e817a0a6) +++ Ringtoets/Integration/test/Ringtoets.Integration.IO.TestUtil/Ringtoets.Integration.IO.TestUtil.csproj (.../Ringtoets.Integration.IO.TestUtil.csproj) (revision 30c0356e486b018532e85b0dde94efe832cf445f) @@ -14,6 +14,7 @@ +