Index: Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/TreeNodeInfos/MacroStabilityOutwardsFailureMechanismContextTreeNodeInfoTest.cs =================================================================== diff -u -r6e6ff0259ba700bb1fe6e60cc47cf9741e8815b8 -r409f425c74884ec6cbd5f56ceb89111dfa2394b5 --- Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/TreeNodeInfos/MacroStabilityOutwardsFailureMechanismContextTreeNodeInfoTest.cs (.../MacroStabilityOutwardsFailureMechanismContextTreeNodeInfoTest.cs) (revision 6e6ff0259ba700bb1fe6e60cc47cf9741e8815b8) +++ Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/TreeNodeInfos/MacroStabilityOutwardsFailureMechanismContextTreeNodeInfoTest.cs (.../MacroStabilityOutwardsFailureMechanismContextTreeNodeInfoTest.cs) (revision 409f425c74884ec6cbd5f56ceb89111dfa2394b5) @@ -36,7 +36,6 @@ 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; @@ -151,9 +150,7 @@ { // Setup var assessmentSection = new AssessmentSectionStub(); - var failureMechanism = new MacroStabilityOutwardsFailureMechanism(); - var failureMechanismContext = new MacroStabilityOutwardsFailureMechanismContext(failureMechanism, assessmentSection); // Call @@ -162,6 +159,7 @@ // Assert Assert.AreEqual(2, children.Length); var inputFolder = (CategoryTreeFolder) children[0]; + Assert.AreEqual(2, inputFolder.Contents.Count()); Assert.AreEqual("Invoer", inputFolder.Name); Assert.AreEqual(TreeFolderCategory.Input, inputFolder.Category); @@ -191,7 +189,7 @@ Assert.AreEqual(probabilityAssessmentInput.GetN(probabilityAssessmentInput.SectionLength), calculator.FailureMechanismN); } - var failureMechanismResultsContext = (FailureMechanismSectionResultContext) + var failureMechanismResultsContext = (ProbabilityFailureMechanismSectionResultContext) outputFolder.Contents.ElementAt(1); Assert.AreSame(failureMechanism, failureMechanismResultsContext.FailureMechanism); Assert.AreSame(failureMechanism.SectionResults, failureMechanismResultsContext.WrappedData); @@ -266,15 +264,15 @@ public void ContextMenuStrip_FailureMechanismIsNotRelevant_CallsContextMenuBuilderMethods() { // Setup + var failureMechanism = new MacroStabilityOutwardsFailureMechanism + { + IsRelevant = false + }; + var assessmentSection = mocks.Stub(); + var context = new MacroStabilityOutwardsFailureMechanismContext(failureMechanism, assessmentSection); + using (var treeView = new TreeViewControl()) { - var failureMechanism = new MacroStabilityOutwardsFailureMechanism - { - IsRelevant = false - }; - var assessmentSection = mocks.Stub(); - var context = new MacroStabilityOutwardsFailureMechanismContext(failureMechanism, assessmentSection); - var menuBuilder = mocks.StrictMock(); using (mocks.Ordered()) { @@ -418,32 +416,5 @@ } } } - - /// - /// Used in ChildNodeObjects_FailureMechanismIsRelevant_OutputNodeAddedForResult(Type) - /// - private void ChildNodeObjects_FailureMechanismIsRelevantWithSectionResults_OutputNodeAdded() where T : FailureMechanismSectionResult - { - // Setup - var assessmentSection = mocks.Stub(); - var failureMechanism = mocks.StrictMultiMock>(typeof(IFailureMechanism)); - failureMechanism.Expect(fm => fm.IsRelevant).Return(true); - failureMechanism.Expect(fm => fm.SectionResults).Return(new ObservableList()).Repeat.Any(); - failureMechanism.Expect(fm => fm.InputComments).Return(new Comment()); - failureMechanism.Expect(fm => fm.OutputComments).Return(new Comment()); - var failureMechanismContext = mocks.Stub(failureMechanism, assessmentSection); - - mocks.ReplayAll(); - - // Call - object[] children = info.ChildNodeObjects(failureMechanismContext).ToArray(); - - // Assert - var outputFolder = (CategoryTreeFolder) children[1]; - - var failureMechanismResultsContext = (FailureMechanismSectionResultContext) outputFolder.Contents.ElementAt(0); - Assert.AreSame(failureMechanism, failureMechanismResultsContext.FailureMechanism); - Assert.AreSame(failureMechanism.SectionResults, failureMechanismResultsContext.WrappedData); - } } } \ No newline at end of file