Index: Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/FileImporter/StochasticSoilModelUpdateDataStrategyTest.cs
===================================================================
diff -u -r501642521ffd0016f8f8c1d1b618395c4898612b -r8ea0b6677004524ccbf89c744a2126b9f0dc3039
--- Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/FileImporter/StochasticSoilModelUpdateDataStrategyTest.cs (.../StochasticSoilModelUpdateDataStrategyTest.cs) (revision 501642521ffd0016f8f8c1d1b618395c4898612b)
+++ Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/FileImporter/StochasticSoilModelUpdateDataStrategyTest.cs (.../StochasticSoilModelUpdateDataStrategyTest.cs) (revision 8ea0b6677004524ccbf89c744a2126b9f0dc3039)
@@ -211,7 +211,7 @@
var pipingFailureMechanism = new PipingFailureMechanism();
pipingFailureMechanism.StochasticSoilModels.AddRange(new[]
{
- existingModel,
+ existingModel
}, sourceFilePath);
var strategy = new StochasticSoilModelUpdateDataStrategy(pipingFailureMechanism);
var readModel = new TestStochasticSoilModel("read");
@@ -242,7 +242,7 @@
var targetCollection = new StochasticSoilModelCollection();
targetCollection.AddRange(new[]
{
- existingModel,
+ existingModel
}, sourceFilePath);
var strategy = new StochasticSoilModelUpdateDataStrategy(new PipingFailureMechanism());
@@ -273,7 +273,7 @@
var targetCollection = new StochasticSoilModelCollection();
targetCollection.AddRange(new[]
{
- existingModel,
+ existingModel
}, sourceFilePath);
var strategy = new StochasticSoilModelUpdateDataStrategy(new PipingFailureMechanism());
@@ -305,7 +305,7 @@
var targetCollection = new StochasticSoilModelCollection();
targetCollection.AddRange(new[]
{
- existingModel,
+ existingModel
}, sourceFilePath);
StochasticSoilProfile firstExistingProfile = existingModel.StochasticSoilProfiles[0];
@@ -359,7 +359,7 @@
var targetCollection = new StochasticSoilModelCollection();
targetCollection.AddRange(new[]
{
- existingModel,
+ existingModel
}, sourceFilePath);
StochasticSoilModel readModel = new TestStochasticSoilModel(modelsName);
@@ -427,7 +427,7 @@
var targetCollection = new StochasticSoilModelCollection();
targetCollection.AddRange(new[]
{
- existingModel,
+ existingModel
}, sourceFilePath);
// Call
Index: Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/Ringtoets.Piping.Plugin.Test.csproj
===================================================================
diff -u -r7ee2bf67507878c09c5c587c38e6c82e5e213720 -r8ea0b6677004524ccbf89c744a2126b9f0dc3039
--- Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/Ringtoets.Piping.Plugin.Test.csproj (.../Ringtoets.Piping.Plugin.Test.csproj) (revision 7ee2bf67507878c09c5c587c38e6c82e5e213720)
+++ Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/Ringtoets.Piping.Plugin.Test.csproj (.../Ringtoets.Piping.Plugin.Test.csproj) (revision 8ea0b6677004524ccbf89c744a2126b9f0dc3039)
@@ -101,7 +101,8 @@
-
+
+
Fisheye: Tag 8ea0b6677004524ccbf89c744a2126b9f0dc3039 refers to a dead (removed) revision in file `Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/UpdateInfos/RingtoetsPipingSurfaceLineContextUpdateInfoTest.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Index: Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/UpdateInfos/RingtoetsPipingSurfaceLinesContextUpdateInfoTest.cs
===================================================================
diff -u
--- Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/UpdateInfos/RingtoetsPipingSurfaceLinesContextUpdateInfoTest.cs (revision 0)
+++ Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/UpdateInfos/RingtoetsPipingSurfaceLinesContextUpdateInfoTest.cs (revision 8ea0b6677004524ccbf89c744a2126b9f0dc3039)
@@ -0,0 +1,201 @@
+// Copyright (C) Stichting Deltares 2016. All rights reserved.
+//
+// This file is part of Ringtoets.
+//
+// Ringtoets is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+//
+// All names, logos, and references to "Deltares" are registered trademarks of
+// Stichting Deltares and remain full property of Stichting Deltares at all times.
+// All rights reserved.
+
+using System.Drawing;
+using System.IO;
+using System.Linq;
+using Core.Common.Base.Geometry;
+using Core.Common.Base.IO;
+using Core.Common.Gui.Plugin;
+using Core.Common.TestUtil;
+using NUnit.Framework;
+using Rhino.Mocks;
+using Ringtoets.Common.Data.AssessmentSection;
+using Ringtoets.Piping.Data;
+using Ringtoets.Piping.Forms.PresentationObjects;
+using Ringtoets.Piping.Primitives;
+using PipingFormsResources = Ringtoets.Piping.Forms.Properties.Resources;
+
+namespace Ringtoets.Piping.Plugin.Test.UpdateInfos
+{
+ [TestFixture]
+ public class RingtoetsPipingSurfaceLinesContextUpdateInfoTest
+ {
+ private UpdateInfo updateInfo;
+ private PipingPlugin plugin;
+
+ [SetUp]
+ public void SetUp()
+ {
+ plugin = new PipingPlugin();
+ updateInfo = plugin.GetUpdateInfos().First(i => i.DataType == typeof(RingtoetsPipingSurfaceLinesContext));
+ }
+
+ [TearDown]
+ public void TearDown()
+ {
+ plugin.Dispose();
+ }
+
+ [Test]
+ public void Name_Always_ReturnExpectedName()
+ {
+ // Call
+ string name = updateInfo.Name;
+
+ // Assert
+ Assert.AreEqual("Profielschematisaties", name);
+ }
+
+ [Test]
+ public void Category_Always_ReturnExpectedCategory()
+ {
+ // Call
+ string category = updateInfo.Category;
+
+ // Assert
+ Assert.AreEqual("Algemeen", category);
+ }
+
+ [Test]
+ public void Image_Always_ReturnExpectedIcon()
+ {
+ // Call
+ Image image = updateInfo.Image;
+
+ // Assert
+ TestHelper.AssertImagesAreEqual(PipingFormsResources.PipingSurfaceLineIcon, image);
+ }
+
+ [Test]
+ public void IsEnabled_ReferenceLineNull_ReturnFalse()
+ {
+ // Setup
+ var mocks = new MockRepository();
+ var assessmentSection = mocks.Stub();
+ assessmentSection.ReferenceLine = null;
+ mocks.ReplayAll();
+
+ var failureMechanism = new PipingFailureMechanism();
+ var surfaceLines = new RingtoetsPipingSurfaceLineCollection();
+
+ var context = new RingtoetsPipingSurfaceLinesContext(surfaceLines, failureMechanism, assessmentSection);
+
+ // Call
+ bool isEnabled = updateInfo.IsEnabled(context);
+
+ // Assert
+ Assert.IsFalse(isEnabled);
+ mocks.VerifyAll();
+ }
+
+ [Test]
+ public void IsEnabled_ReferenceLineSet_ReturnTrue()
+ {
+ // Setup
+ var mocks = new MockRepository();
+ var assessmentSection = mocks.Stub();
+ assessmentSection.ReferenceLine = new ReferenceLine();
+ mocks.ReplayAll();
+
+ var failureMechanism = new PipingFailureMechanism();
+ var surfaceLines = new RingtoetsPipingSurfaceLineCollection();
+
+ var context = new RingtoetsPipingSurfaceLinesContext(surfaceLines, failureMechanism, assessmentSection);
+
+ // Call
+ bool isEnabled = updateInfo.IsEnabled(context);
+
+ // Assert
+ Assert.IsTrue(isEnabled);
+ mocks.VerifyAll();
+ }
+
+ [Test]
+ public void FileFilter_Always_ReturnExpectedFileFilter()
+ {
+ // Call
+ string fileFilter = updateInfo.FileFilterGenerator.Filter;
+
+ // Assert
+ Assert.AreEqual("Profielschematisaties Kommagescheiden bestand (*.csv)|*.csv", fileFilter);
+ }
+
+ [Test]
+ public void CurrentPath_SurfaceLineCollectionHasPathSet_ReturnsExpectedPath()
+ {
+ // Setup
+ var mocks = new MockRepository();
+ var assessmentSection = mocks.Stub();
+ assessmentSection.ReferenceLine = new ReferenceLine();
+ mocks.ReplayAll();
+
+ const string expectedFilePath = "some/path";
+ var surfaceLines = new RingtoetsPipingSurfaceLineCollection();
+ surfaceLines.AddRange(new [] {new RingtoetsPipingSurfaceLine()}, expectedFilePath);
+
+ var failureMechanism = new PipingFailureMechanism();
+
+ var context = new RingtoetsPipingSurfaceLinesContext(surfaceLines, failureMechanism, assessmentSection);
+
+ // Call
+ string currentPath = updateInfo.CurrentPath(context);
+
+ // Assert
+ Assert.AreEqual(expectedFilePath, currentPath);
+ mocks.VerifyAll();
+ }
+
+ [Test]
+ public void CreateFileImporter_ValidInput_SuccessfulImport()
+ {
+ // Setup
+ var filePath = TestHelper.GetTestDataPath(TestDataPath.Ringtoets.Piping.IO,
+ Path.Combine("SurfaceLines", "TwoValidSurfaceLines.csv"));
+
+ var referenceLine = new ReferenceLine();
+ referenceLine.SetGeometry(new[]
+ {
+ new Point2D(3.3, -1),
+ new Point2D(3.3, 1),
+ new Point2D(94270, 427775.65),
+ new Point2D(94270, 427812.08)
+ });
+
+ var mocks = new MockRepository();
+ var assessmentSection = mocks.Stub();
+ assessmentSection.ReferenceLine = referenceLine;
+ mocks.ReplayAll();
+
+ var failureMechanism = new PipingFailureMechanism();
+ var surfaceLines = new RingtoetsPipingSurfaceLineCollection();
+
+ var updateTarget = new RingtoetsPipingSurfaceLinesContext(surfaceLines, failureMechanism, assessmentSection);
+
+ // Call
+ IFileImporter importer = updateInfo.CreateFileImporter(updateTarget, filePath);
+
+ // Assert
+ Assert.IsTrue(importer.Import());
+ mocks.VerifyAll();
+ }
+ }
+}
Index: Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/UpdateInfos/StochasticSoilModelCollectionContextUpdateInfoTest.cs
===================================================================
diff -u
--- Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/UpdateInfos/StochasticSoilModelCollectionContextUpdateInfoTest.cs (revision 0)
+++ Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/UpdateInfos/StochasticSoilModelCollectionContextUpdateInfoTest.cs (revision 8ea0b6677004524ccbf89c744a2126b9f0dc3039)
@@ -0,0 +1,184 @@
+// Copyright (C) Stichting Deltares 2016. All rights reserved.
+//
+// This file is part of Ringtoets.
+//
+// Ringtoets is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+//
+// All names, logos, and references to "Deltares" are registered trademarks of
+// Stichting Deltares and remain full property of Stichting Deltares at all times.
+// All rights reserved.
+
+using System;
+using System.Drawing;
+using System.IO;
+using System.Linq;
+using Core.Common.Base.Geometry;
+using Core.Common.Base.IO;
+using Core.Common.Gui;
+using Core.Common.Gui.Plugin;
+using Core.Common.TestUtil;
+using NUnit.Framework;
+using Rhino.Mocks;
+using Ringtoets.Common.Data.AssessmentSection;
+using Ringtoets.Piping.Data;
+using Ringtoets.Piping.Forms.PresentationObjects;
+using PipingFormsResources = Ringtoets.Piping.Forms.Properties.Resources;
+
+namespace Ringtoets.Piping.Plugin.Test.UpdateInfos
+{
+ [TestFixture]
+ public class StochasticSoilModelCollectionContextUpdateInfoTest
+ {
+ private UpdateInfo updateInfo;
+ private PipingPlugin plugin;
+
+ [SetUp]
+ public void SetUp()
+ {
+ plugin = new PipingPlugin();
+ updateInfo = plugin.GetUpdateInfos().First(i => i.DataType == typeof(StochasticSoilModelCollectionContext));
+ }
+
+ [TearDown]
+ public void TearDown()
+ {
+ plugin.Dispose();
+ }
+
+ [Test]
+ public void Name_Always_ReturnExpectedName()
+ {
+ // Call
+ string name = updateInfo.Name;
+
+ // Assert
+ Assert.AreEqual("Stochastische ondergrondmodellen", name);
+ }
+
+ [Test]
+ public void Category_Always_ReturnExpectedCategory()
+ {
+ // Call
+ string category = updateInfo.Category;
+
+ // Assert
+ Assert.AreEqual("Algemeen", category);
+ }
+
+ [Test]
+ public void Image_Always_ReturnExpectedIcon()
+ {
+ // Call
+ Image image = updateInfo.Image;
+
+ // Assert
+ TestHelper.AssertImagesAreEqual(PipingFormsResources.PipingSoilProfileIcon, image);
+ }
+
+ [Test]
+ public void IsEnabled_ReferenceLineNull_ReturnFalse()
+ {
+ // Setup
+ var mocks = new MockRepository();
+ var assessmentSection = mocks.Stub();
+ assessmentSection.ReferenceLine = null;
+ mocks.ReplayAll();
+
+ var failureMechanism = new PipingFailureMechanism();
+
+ var context = new StochasticSoilModelCollectionContext(failureMechanism.StochasticSoilModels, failureMechanism, assessmentSection);
+
+ // Call
+ bool isEnabled = updateInfo.IsEnabled(context);
+
+ // Assert
+ Assert.IsFalse(isEnabled);
+ mocks.VerifyAll();
+ }
+
+ [Test]
+ public void IsEnabled_ReferenceLineSet_ReturnTrue()
+ {
+ // Setup
+ var mocks = new MockRepository();
+ var assessmentSection = mocks.Stub();
+ assessmentSection.ReferenceLine = new ReferenceLine();
+ mocks.ReplayAll();
+
+ var failureMechanism = new PipingFailureMechanism();
+
+ var context = new StochasticSoilModelCollectionContext(failureMechanism.StochasticSoilModels, failureMechanism, assessmentSection);
+
+ // Call
+ bool isEnabled = updateInfo.IsEnabled(context);
+
+ // Assert
+ Assert.IsTrue(isEnabled);
+ mocks.VerifyAll();
+ }
+
+ [Test]
+ public void FileFilter_Always_ReturnExpectedFileFilter()
+ {
+ // Call
+ FileFilterGenerator fileFilter = updateInfo.FileFilterGenerator;
+
+ // Assert
+ Assert.AreEqual("D-Soil Model bestand (*.soil)|*.soil", fileFilter.Filter);
+ }
+
+ [Test]
+ public void VerifyUpdates_Always_IsDefined()
+ {
+ // Call
+ Func