Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/TreeNodeInfos/GrassCoverErosionInwardsFailureMechanismContextTreeNodeInfoTest.cs =================================================================== diff -u -r6dbb29ed12c28b66db763ff603f3ab8e28a0adf4 -r3df200a3968f49aa1098764c284a7fafb2a14de4 --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/TreeNodeInfos/GrassCoverErosionInwardsFailureMechanismContextTreeNodeInfoTest.cs (.../GrassCoverErosionInwardsFailureMechanismContextTreeNodeInfoTest.cs) (revision 6dbb29ed12c28b66db763ff603f3ab8e28a0adf4) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/TreeNodeInfos/GrassCoverErosionInwardsFailureMechanismContextTreeNodeInfoTest.cs (.../GrassCoverErosionInwardsFailureMechanismContextTreeNodeInfoTest.cs) (revision 3df200a3968f49aa1098764c284a7fafb2a14de4) @@ -109,7 +109,7 @@ } [Test] - public void ChildNodeObjects_Always_ReturnChildDataNodes() + public void ChildNodeObjects_FailureMechanismIsRelevant_ReturnChildDataNodes() { // Setup var assessmentSection = mocksRepository.Stub(); @@ -152,6 +152,30 @@ } [Test] + public void ChildNodeObjects_FailureMechanismIsNotRelevant_ReturnOnlyFailureMechanismComments() + { + // Setup + var assessmentSection = mocksRepository.Stub(); + mocksRepository.ReplayAll(); + + var failureMechanism = new GrassCoverErosionInwardsFailureMechanism + { + IsRelevant = false + }; + var failureMechanismContext = new GrassCoverErosionInwardsFailureMechanismContext(failureMechanism, assessmentSection); + + // Call + var children = info.ChildNodeObjects(failureMechanismContext).ToArray(); + + // Assert + Assert.AreEqual(1, children.Length); + var commentContext = (CommentContext)children[0]; + Assert.AreSame(failureMechanism, commentContext.CommentContainer); + + mocksRepository.VerifyAll(); + } + + [Test] public void ContextMenuStrip_Always_CallsContextMenuBuilderMethods() { // Setup