Index: Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/TreeNodeInfos/MacroStabilityOutwardsFailureMechanismContextTreeNodeInfoTest.cs =================================================================== diff -u -r31089c28777af00964e16b49b49fa2fff8311617 -r0ebcd2c2000e767623f8eada05f920af400d5530 --- Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/TreeNodeInfos/MacroStabilityOutwardsFailureMechanismContextTreeNodeInfoTest.cs (.../MacroStabilityOutwardsFailureMechanismContextTreeNodeInfoTest.cs) (revision 31089c28777af00964e16b49b49fa2fff8311617) +++ Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/TreeNodeInfos/MacroStabilityOutwardsFailureMechanismContextTreeNodeInfoTest.cs (.../MacroStabilityOutwardsFailureMechanismContextTreeNodeInfoTest.cs) (revision 0ebcd2c2000e767623f8eada05f920af400d5530) @@ -19,6 +19,7 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. +using System.Collections.Generic; using System.Drawing; using System.Linq; using System.Windows.Forms; @@ -32,10 +33,15 @@ using Core.Common.TestUtil; using NUnit.Framework; using Rhino.Mocks; +using Ringtoets.AssemblyTool.Data; +using Ringtoets.AssemblyTool.KernelWrapper.Calculators; +using Ringtoets.AssemblyTool.KernelWrapper.TestUtil.Calculators; +using Ringtoets.AssemblyTool.KernelWrapper.TestUtil.Calculators.Categories; using Ringtoets.Common.Data; using Ringtoets.Common.Data.AssessmentSection; using Ringtoets.Common.Data.FailureMechanism; using Ringtoets.Common.Data.Probability; +using Ringtoets.Common.Data.TestUtil; using Ringtoets.Common.Forms.PresentationObjects; using Ringtoets.Integration.Data.StandAlone; using Ringtoets.Integration.Data.StandAlone.Input; @@ -147,8 +153,7 @@ public void ChildNodeObjects_FailureMechanismIsRelevant_ReturnChildDataNodes() { // Setup - var assessmentSection = mocks.Stub(); - mocks.ReplayAll(); + var assessmentSection = new AssessmentSectionStub(); var failureMechanism = new MacroStabilityOutwardsFailureMechanism(); @@ -174,12 +179,21 @@ Assert.AreEqual(3, outputFolder.Contents.Count()); Assert.AreEqual("Oordeel", outputFolder.Name); Assert.AreEqual(TreeFolderCategory.Output, outputFolder.Category); + var failureMechanismAssemblyCategoriesContext = (GeotechnicalFailureMechanismAssemblyCategoriesContext) outputFolder.Contents.ElementAt(0); Assert.AreSame(failureMechanism, failureMechanismAssemblyCategoriesContext.WrappedData); Assert.AreSame(assessmentSection, failureMechanismAssemblyCategoriesContext.AssessmentSection); - MacroStabilityOutwardsProbabilityAssessmentInput probabilityAssessmentInput = failureMechanism.MacroStabilityOutwardsProbabilityAssessmentInput; - Assert.AreEqual(probabilityAssessmentInput.GetN(probabilityAssessmentInput.SectionLength), failureMechanismAssemblyCategoriesContext.GetNFunc()); + using (new AssemblyToolCalculatorFactoryConfig()) + { + var calculatorFactory = (TestAssemblyToolCalculatorFactory) AssemblyToolCalculatorFactory.Instance; + AssemblyCategoriesCalculatorStub calculator = calculatorFactory.LastCreatedAssemblyCategoriesCalculator; + + failureMechanismAssemblyCategoriesContext.GetFailureMechanismSectionAssemblyCategoriesFunc(); + MacroStabilityOutwardsProbabilityAssessmentInput probabilityAssessmentInput = failureMechanism.MacroStabilityOutwardsProbabilityAssessmentInput; + Assert.AreEqual(probabilityAssessmentInput.GetN(probabilityAssessmentInput.SectionLength), calculator.AssemblyCategoriesInput.N); + } + var failureMechanismResultsContext = (FailureMechanismSectionResultContext) outputFolder.Contents.ElementAt(1); Assert.AreSame(failureMechanism, failureMechanismResultsContext.FailureMechanism);