Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/TreeNodeInfos/FailureMechanismSectionsContextTreeNodeInfoTest.cs =================================================================== diff -u -r76ace4042e4e8a92a0ba37e8e9a9373ed6cea951 -rfcc49aac894f989182fb9faa487e50a585fbed03 --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/TreeNodeInfos/FailureMechanismSectionsContextTreeNodeInfoTest.cs (.../FailureMechanismSectionsContextTreeNodeInfoTest.cs) (revision 76ace4042e4e8a92a0ba37e8e9a9373ed6cea951) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/TreeNodeInfos/FailureMechanismSectionsContextTreeNodeInfoTest.cs (.../FailureMechanismSectionsContextTreeNodeInfoTest.cs) (revision fcc49aac894f989182fb9faa487e50a585fbed03) @@ -1,5 +1,7 @@ -using System.Linq; +using System.Drawing; +using System.Linq; +using Core.Common.Base.Geometry; using Core.Common.Controls.TreeView; using Core.Common.Gui; using Core.Common.Gui.ContextMenu; @@ -12,6 +14,7 @@ using Ringtoets.Common.Data; using Ringtoets.Common.Forms.PresentationObjects; using Ringtoets.Integration.Plugin; + using RingtoetsCommonFormsResources = Ringtoets.Common.Forms.Properties.Resources; namespace Ringtoets.Integration.Forms.Test.TreeNodeInfos @@ -106,5 +109,50 @@ // Assert mocks.VerifyAll(); } + + [Test] + public void ForeColor_NoSectionsOnFailureMechanism_ReturnGrayText() + { + // Setup + var assessmentSection = mocks.Stub(); + var failureMechanism = mocks.Stub(); + failureMechanism.Stub(fm => fm.Sections).Return(Enumerable.Empty()); + mocks.ReplayAll(); + + var context = new FailureMechanismSectionsContext(failureMechanism, assessmentSection); + + // Call + Color color = info.ForeColor(context); + + // Assert + Assert.AreEqual(Color.FromKnownColor(KnownColor.GrayText), color); + mocks.VerifyAll(); + } + + [Test] + public void ForeColor_HasSectionsOnFailureMechanism_ReturnControlText() + { + // Setup + var assessmentSection = mocks.Stub(); + var failureMechanism = mocks.Stub(); + failureMechanism.Stub(fm => fm.Sections).Return(new[] + { + new FailureMechanismSection("A", new[] + { + new Point2D(3, 4), + new Point2D(5, 6) + }), + }); + mocks.ReplayAll(); + + var context = new FailureMechanismSectionsContext(failureMechanism, assessmentSection); + + // Call + Color color = info.ForeColor(context); + + // Assert + Assert.AreEqual(Color.FromKnownColor(KnownColor.ControlText), color); + mocks.VerifyAll(); + } } } \ No newline at end of file