Index: Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.Plugin.Test/TreeNodeInfos/DuneLocationCalculationsGroupContextTreeNodeInfoTest.cs =================================================================== diff -u -r2fa288c2dca73f346a31c54f2ac2c89b67387ca9 -rd4a4f6fc0626fe052dc73d5bdba16a28a82e299d --- Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.Plugin.Test/TreeNodeInfos/DuneLocationCalculationsGroupContextTreeNodeInfoTest.cs (.../DuneLocationCalculationsGroupContextTreeNodeInfoTest.cs) (revision 2fa288c2dca73f346a31c54f2ac2c89b67387ca9) +++ Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.Plugin.Test/TreeNodeInfos/DuneLocationCalculationsGroupContextTreeNodeInfoTest.cs (.../DuneLocationCalculationsGroupContextTreeNodeInfoTest.cs) (revision d4a4f6fc0626fe052dc73d5bdba16a28a82e299d) @@ -52,7 +52,7 @@ // Assert Assert.IsNotNull(info.Text); - Assert.IsNull(info.ForeColor); + Assert.IsNotNull(info.ForeColor); Assert.IsNotNull(info.Image); Assert.IsNotNull(info.ContextMenuStrip); Assert.IsNull(info.EnsureVisibleOnCreate); @@ -89,6 +89,53 @@ } [Test] + public void ForeColor_LocationsEmpty_ReturnGrayText() + { + // Setup + var assessmentSection = new AssessmentSectionStub(); + var failureMechanism = new DuneErosionFailureMechanism(); + var locations = new ObservableList(); + + var calculationsGroupContext = new DuneLocationCalculationsGroupContext(locations, failureMechanism, assessmentSection); + + using (var plugin = new DuneErosionPlugin()) + { + TreeNodeInfo info = GetInfo(plugin); + + // Call + Color textColor = info.ForeColor(calculationsGroupContext); + + // Assert + Assert.AreEqual(Color.FromKnownColor(KnownColor.GrayText), textColor); + } + } + + [Test] + public void ForeColor_WithLocations_ReturnControlText() + { + // Setup + var assessmentSection = new AssessmentSectionStub(); + var failureMechanism = new DuneErosionFailureMechanism(); + var locations = new ObservableList + { + new TestDuneLocation() + }; + + var calculationsGroupContext = new DuneLocationCalculationsGroupContext(locations, failureMechanism, assessmentSection); + + using (var plugin = new DuneErosionPlugin()) + { + TreeNodeInfo info = GetInfo(plugin); + + // Call + Color textColor = info.ForeColor(calculationsGroupContext); + + // Assert + Assert.AreEqual(Color.FromKnownColor(KnownColor.ControlText), textColor); + } + } + + [Test] public void Image_Always_ReturnsGeneralFolderIcon() { // Setup