Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Plugin/MacroStabilityInwardsPlugin.cs =================================================================== diff -u -r8135b9ec199f4ea57f175a5179a02a19bf2b6b0c -r48f0914ef806c9ed06462b91047e53d958d85dfe --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Plugin/MacroStabilityInwardsPlugin.cs (.../MacroStabilityInwardsPlugin.cs) (revision 8135b9ec199f4ea57f175a5179a02a19bf2b6b0c) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Plugin/MacroStabilityInwardsPlugin.cs (.../MacroStabilityInwardsPlugin.cs) (revision 48f0914ef806c9ed06462b91047e53d958d85dfe) @@ -118,7 +118,7 @@ Category = RingtoetsCommonFormsResources.Ringtoets_Category, Image = MacroStabilityInwardsFormsResources.SurfaceLineIcon, FileFilterGenerator = SurfaceLineFileFilter, - IsEnabled = context => context.AssessmentSection.ReferenceLine != null, + IsEnabled = context => HasReferenceLine(context.AssessmentSection), CreateFileImporter = (context, filePath) => new SurfaceLinesCsvImporter( context.WrappedData, filePath, @@ -133,7 +133,7 @@ Category = RingtoetsCommonFormsResources.Ringtoets_Category, Image = MacroStabilityInwardsFormsResources.SoilProfileIcon, FileFilterGenerator = StochasticSoilModelFileFilter, - IsEnabled = context => context.AssessmentSection.ReferenceLine != null, + IsEnabled = context => HasReferenceLine(context.AssessmentSection), CreateFileImporter = (context, filePath) => new StochasticSoilModelImporter( context.WrappedData, filePath, @@ -425,6 +425,11 @@ return !changeHandler.RequireConfirmation() || changeHandler.InquireConfirmation(); } + private static bool HasReferenceLine(IAssessmentSection assessmentSection) + { + return assessmentSection.ReferenceLine.Points.Any(); + } + #region MacroStabilityInwardsFailureMechanismView ViewInfo private static bool CloseFailureMechanismViewForData(MacroStabilityInwardsFailureMechanismView view, object o) Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Plugin.Test/ImportInfos/MacroStabilityInwardsStochasticSoilModelCollectionContextImportInfoTest.cs =================================================================== diff -u -r89af26f3e37c7febcb344be44597d9fcd9ef81d6 -r48f0914ef806c9ed06462b91047e53d958d85dfe --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Plugin.Test/ImportInfos/MacroStabilityInwardsStochasticSoilModelCollectionContextImportInfoTest.cs (.../MacroStabilityInwardsStochasticSoilModelCollectionContextImportInfoTest.cs) (revision 89af26f3e37c7febcb344be44597d9fcd9ef81d6) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Plugin.Test/ImportInfos/MacroStabilityInwardsStochasticSoilModelCollectionContextImportInfoTest.cs (.../MacroStabilityInwardsStochasticSoilModelCollectionContextImportInfoTest.cs) (revision 48f0914ef806c9ed06462b91047e53d958d85dfe) @@ -32,6 +32,7 @@ using NUnit.Framework; using Rhino.Mocks; using Ringtoets.Common.Data.AssessmentSection; +using Ringtoets.Common.Data.TestUtil; using Ringtoets.Common.IO.SoilProfile; using Ringtoets.MacroStabilityInwards.Data; using Ringtoets.MacroStabilityInwards.Data.SoilProfile; @@ -78,11 +79,12 @@ } [Test] - public void IsEnabled_ReferenceLineNull_ReturnFalse() + public void IsEnabled_ReferenceLineWithoutGeometry_ReturnFalse() { // Setup var mocks = new MockRepository(); var assessmentSection = mocks.Stub(); + assessmentSection.Stub(a => a.ReferenceLine).Return(new ReferenceLine()); mocks.ReplayAll(); var failureMechanism = new MacroStabilityInwardsFailureMechanism(); @@ -98,12 +100,12 @@ } [Test] - public void IsEnabled_ReferenceLineSet_ReturnTrue() + public void IsEnabled_ReferenceLineWithGeometry_ReturnTrue() { // Setup var mocks = new MockRepository(); var assessmentSection = mocks.Stub(); - assessmentSection.Stub(a => a.ReferenceLine).Return(new ReferenceLine()); + assessmentSection.Stub(a => a.ReferenceLine).Return(ReferenceLineTestFactory.CreateReferenceLineWithGeometry()); mocks.ReplayAll(); var failureMechanism = new MacroStabilityInwardsFailureMechanism(); Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Plugin.Test/ImportInfos/MacroStabilityInwardsSurfaceLinesContextImportInfoTest.cs =================================================================== diff -u -r89af26f3e37c7febcb344be44597d9fcd9ef81d6 -r48f0914ef806c9ed06462b91047e53d958d85dfe --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Plugin.Test/ImportInfos/MacroStabilityInwardsSurfaceLinesContextImportInfoTest.cs (.../MacroStabilityInwardsSurfaceLinesContextImportInfoTest.cs) (revision 89af26f3e37c7febcb344be44597d9fcd9ef81d6) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Plugin.Test/ImportInfos/MacroStabilityInwardsSurfaceLinesContextImportInfoTest.cs (.../MacroStabilityInwardsSurfaceLinesContextImportInfoTest.cs) (revision 48f0914ef806c9ed06462b91047e53d958d85dfe) @@ -32,6 +32,7 @@ using NUnit.Framework; using Rhino.Mocks; using Ringtoets.Common.Data.AssessmentSection; +using Ringtoets.Common.Data.TestUtil; using Ringtoets.Common.IO.SurfaceLines; using Ringtoets.MacroStabilityInwards.Data; using Ringtoets.MacroStabilityInwards.Data.TestUtil; @@ -78,11 +79,12 @@ } [Test] - public void IsEnabled_ReferenceLineNull_ReturnFalse() + public void IsEnabled_ReferenceLineWithoutGeometry_ReturnFalse() { // Setup var mocks = new MockRepository(); var assessmentSection = mocks.Stub(); + assessmentSection.Stub(a => a.ReferenceLine).Return(new ReferenceLine()); mocks.ReplayAll(); var failureMechanism = new MacroStabilityInwardsFailureMechanism(); @@ -99,12 +101,12 @@ } [Test] - public void IsEnabled_ReferenceLineSet_ReturnTrue() + public void IsEnabled_ReferenceLineWithGeometry_ReturnTrue() { // Setup var mocks = new MockRepository(); var assessmentSection = mocks.Stub(); - assessmentSection.Stub(a => a.ReferenceLine).Return(new ReferenceLine()); + assessmentSection.Stub(a => a.ReferenceLine).Return(ReferenceLineTestFactory.CreateReferenceLineWithGeometry()); mocks.ReplayAll(); var failureMechanism = new MacroStabilityInwardsFailureMechanism();