Index: Ringtoets/AssemblyTool/test/Ringtoets.AssemblyTool.KernelWrapper.TestUtil.Test/Calculators/Assessments/FailureMechanismSectionAssessmentAssemblyCalculatorStubTest.cs =================================================================== diff -u -rb632beac6ad383b7a6b1609a190d319ef530899f -r3b93c6ea184a8517cebfe202dde334069e0cbe59 --- Ringtoets/AssemblyTool/test/Ringtoets.AssemblyTool.KernelWrapper.TestUtil.Test/Calculators/Assessments/FailureMechanismSectionAssessmentAssemblyCalculatorStubTest.cs (.../FailureMechanismSectionAssessmentAssemblyCalculatorStubTest.cs) (revision b632beac6ad383b7a6b1609a190d319ef530899f) +++ Ringtoets/AssemblyTool/test/Ringtoets.AssemblyTool.KernelWrapper.TestUtil.Test/Calculators/Assessments/FailureMechanismSectionAssessmentAssemblyCalculatorStubTest.cs (.../FailureMechanismSectionAssessmentAssemblyCalculatorStubTest.cs) (revision 3b93c6ea184a8517cebfe202dde334069e0cbe59) @@ -21,7 +21,6 @@ using NUnit.Framework; using Ringtoets.AssemblyTool.KernelWrapper.Calculators.Assessments; -using Ringtoets.AssemblyTool.KernelWrapper.Calculators.Categories; using Ringtoets.AssemblyTool.KernelWrapper.TestUtil.Calculators.Assessments; using Ringtoets.Common.Data.AssemblyTool; using Ringtoets.Common.Data.FailureMechanism; Index: Ringtoets/AssemblyTool/test/Ringtoets.AssemblyTool.KernelWrapper.TestUtil.Test/Calculators/TestAssemblyToolCalculatorFactoryTest.cs =================================================================== diff -u -r7f7cb92f29ad73708c2346df6efd1c39fc29d41c -r3b93c6ea184a8517cebfe202dde334069e0cbe59 --- Ringtoets/AssemblyTool/test/Ringtoets.AssemblyTool.KernelWrapper.TestUtil.Test/Calculators/TestAssemblyToolCalculatorFactoryTest.cs (.../TestAssemblyToolCalculatorFactoryTest.cs) (revision 7f7cb92f29ad73708c2346df6efd1c39fc29d41c) +++ Ringtoets/AssemblyTool/test/Ringtoets.AssemblyTool.KernelWrapper.TestUtil.Test/Calculators/TestAssemblyToolCalculatorFactoryTest.cs (.../TestAssemblyToolCalculatorFactoryTest.cs) (revision 3b93c6ea184a8517cebfe202dde334069e0cbe59) @@ -19,13 +19,13 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. -using System; using NUnit.Framework; using Ringtoets.AssemblyTool.KernelWrapper.Calculators; +using Ringtoets.AssemblyTool.KernelWrapper.Calculators.Assessments; using Ringtoets.AssemblyTool.KernelWrapper.Calculators.Categories; using Ringtoets.AssemblyTool.KernelWrapper.TestUtil.Calculators; +using Ringtoets.AssemblyTool.KernelWrapper.TestUtil.Calculators.Assessments; using Ringtoets.AssemblyTool.KernelWrapper.TestUtil.Calculators.Categories; -using Ringtoets.AssemblyTool.KernelWrapper.TestUtil.Kernels; namespace Ringtoets.AssemblyTool.KernelWrapper.TestUtil.Test.Calculators { @@ -41,6 +41,7 @@ // Assert Assert.IsInstanceOf(factory); Assert.IsNotNull(factory.LastCreatedAssemblyCategoriesCalculator); + Assert.IsNotNull(factory.LastCreatedFailureMechanismSectionAssessmentAssemblyCalculator); } [Test] @@ -58,17 +59,17 @@ } [Test] - public void CreateFailureMechanismSectionAssessmentAssemblyCalculator_Always_ThrowsInvalidOperationException() + public void CreateFailureMechanismSectionAssessmentAssemblyCalculator_Always_ReturnStub() { // Setup var factory = new TestAssemblyToolCalculatorFactory(); // Call - TestDelegate test = () => factory.CreateFailureMechanismSectionAssessmentAssemblyCalculator(null); - + IFailureMechanismSectionAssessmentAssemblyCalculator calculator = factory.CreateFailureMechanismSectionAssessmentAssemblyCalculator(null); + // Assert - var exception = Assert.Throws(test); - Assert.AreEqual($"Use the { nameof(TestAssemblyToolKernelFactory)}", exception.Message); + Assert.IsInstanceOf(calculator); + Assert.AreSame(factory.LastCreatedFailureMechanismSectionAssessmentAssemblyCalculator, calculator); } } } \ No newline at end of file Index: Ringtoets/AssemblyTool/test/Ringtoets.AssemblyTool.KernelWrapper.TestUtil/Calculators/TestAssemblyToolCalculatorFactory.cs =================================================================== diff -u -r9c274457523062aad7b755fa88b20277c5d86bcb -r3b93c6ea184a8517cebfe202dde334069e0cbe59 --- Ringtoets/AssemblyTool/test/Ringtoets.AssemblyTool.KernelWrapper.TestUtil/Calculators/TestAssemblyToolCalculatorFactory.cs (.../TestAssemblyToolCalculatorFactory.cs) (revision 9c274457523062aad7b755fa88b20277c5d86bcb) +++ Ringtoets/AssemblyTool/test/Ringtoets.AssemblyTool.KernelWrapper.TestUtil/Calculators/TestAssemblyToolCalculatorFactory.cs (.../TestAssemblyToolCalculatorFactory.cs) (revision 3b93c6ea184a8517cebfe202dde334069e0cbe59) @@ -19,13 +19,12 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. -using System; using Ringtoets.AssemblyTool.KernelWrapper.Calculators; using Ringtoets.AssemblyTool.KernelWrapper.Calculators.Assessments; using Ringtoets.AssemblyTool.KernelWrapper.Calculators.Categories; using Ringtoets.AssemblyTool.KernelWrapper.Kernels; +using Ringtoets.AssemblyTool.KernelWrapper.TestUtil.Calculators.Assessments; using Ringtoets.AssemblyTool.KernelWrapper.TestUtil.Calculators.Categories; -using Ringtoets.AssemblyTool.KernelWrapper.TestUtil.Kernels; namespace Ringtoets.AssemblyTool.KernelWrapper.TestUtil.Calculators { @@ -40,22 +39,27 @@ public TestAssemblyToolCalculatorFactory() { LastCreatedAssemblyCategoriesCalculator = new AssemblyCategoriesCalculatorStub(); + LastCreatedFailureMechanismSectionAssessmentAssemblyCalculator = new FailureMechanismSectionAssessmentAssemblyCalculatorStub(); } /// /// Gets the last created . /// public AssemblyCategoriesCalculatorStub LastCreatedAssemblyCategoriesCalculator { get; } + /// + /// Gets the last created . + /// + public FailureMechanismSectionAssessmentAssemblyCalculatorStub LastCreatedFailureMechanismSectionAssessmentAssemblyCalculator { get; } + public IAssemblyCategoriesCalculator CreateAssemblyCategoriesCalculator(IAssemblyToolKernelFactory factory) { return LastCreatedAssemblyCategoriesCalculator; } - [Obsolete("Stub the kernel instead of the calculator.", false)] public IFailureMechanismSectionAssessmentAssemblyCalculator CreateFailureMechanismSectionAssessmentAssemblyCalculator(IAssemblyToolKernelFactory factory) { - throw new InvalidOperationException($"Use the {nameof(TestAssemblyToolKernelFactory)}"); + return LastCreatedFailureMechanismSectionAssessmentAssemblyCalculator; } } } \ No newline at end of file