Index: src/Plugins/Ringtoets/Piping/src/Ringtoets.Piping.Data/PipingFailureMechanism.cs =================================================================== diff -u -rdf0cc3cc798c0d57715d9dbe78b71387066913b5 -rb02b755bf5d7a52b44deb11bdb9b1e70789306a0 --- src/Plugins/Ringtoets/Piping/src/Ringtoets.Piping.Data/PipingFailureMechanism.cs (.../PipingFailureMechanism.cs) (revision df0cc3cc798c0d57715d9dbe78b71387066913b5) +++ src/Plugins/Ringtoets/Piping/src/Ringtoets.Piping.Data/PipingFailureMechanism.cs (.../PipingFailureMechanism.cs) (revision b02b755bf5d7a52b44deb11bdb9b1e70789306a0) @@ -19,7 +19,7 @@ public PipingFailureMechanism() { SurfaceLines = new ObservableList(); - SoilProfiles = Enumerable.Empty(); + SoilProfiles = new ObservableList(); Calculations = new List { new PipingData() }; } Index: src/Plugins/Ringtoets/Piping/src/Ringtoets.Piping.Forms/NodePresenters/PipingSoilProfileCollectionNodePresenter.cs =================================================================== diff -u -r300a33d9acf653458b834b296becbf9ae552de8e -rb02b755bf5d7a52b44deb11bdb9b1e70789306a0 --- src/Plugins/Ringtoets/Piping/src/Ringtoets.Piping.Forms/NodePresenters/PipingSoilProfileCollectionNodePresenter.cs (.../PipingSoilProfileCollectionNodePresenter.cs) (revision 300a33d9acf653458b834b296becbf9ae552de8e) +++ src/Plugins/Ringtoets/Piping/src/Ringtoets.Piping.Forms/NodePresenters/PipingSoilProfileCollectionNodePresenter.cs (.../PipingSoilProfileCollectionNodePresenter.cs) (revision b02b755bf5d7a52b44deb11bdb9b1e70789306a0) @@ -3,12 +3,11 @@ using System.Collections.Generic; using System.ComponentModel; using System.Drawing; +using System.Linq; using System.Windows.Forms; using DelftTools.Controls; using DelftTools.Utils.Collections; - using Ringtoets.Piping.Data; - using Ringtoets.Piping.Forms.Extensions; using Ringtoets.Piping.Forms.Properties; @@ -38,9 +37,11 @@ public void UpdateNode(ITreeNode parentNode, ITreeNode node, object nodeData) { + var pipingSoilProfiles = (IEnumerable) nodeData; node.Text = Resources.PipingSoilProfilesCollectionName; - node.ForegroundColor = Color.FromKnownColor(KnownColor.GrayText); node.Image = Resources.FolderIcon; + + node.ForegroundColor = GetTextColor(pipingSoilProfiles); } public IEnumerable GetChildNodeObjects(object parentNodeData, ITreeNode node) @@ -112,8 +113,14 @@ throw new InvalidOperationException(String.Format("Cannot delete node of type {0}.", GetType().Name)); } + private static Color GetTextColor(object nodeData) + { + var pipingSoilProfiles = (IEnumerable) nodeData; + return Color.FromKnownColor(pipingSoilProfiles.Any() ? KnownColor.Black : KnownColor.GrayText); + } + private ContextMenuStrip CreateContextMenu() - { + { var strip = new ContextMenuStrip(); if (ImportSoilProfilesAction != null) { Index: src/Plugins/Ringtoets/Piping/src/Ringtoets.Piping.Forms/NodePresenters/PipingSoilProfileNodePresenter.cs =================================================================== diff -u --- src/Plugins/Ringtoets/Piping/src/Ringtoets.Piping.Forms/NodePresenters/PipingSoilProfileNodePresenter.cs (revision 0) +++ src/Plugins/Ringtoets/Piping/src/Ringtoets.Piping.Forms/NodePresenters/PipingSoilProfileNodePresenter.cs (revision b02b755bf5d7a52b44deb11bdb9b1e70789306a0) @@ -0,0 +1,15 @@ +using DelftTools.Controls; +using Ringtoets.Piping.Data; +using Ringtoets.Piping.Forms.Properties; + +namespace Ringtoets.Piping.Forms.NodePresenters +{ + public class PipingSoilProfileNodePresenter : PipingNodePresenterBase + { + protected override void UpdateNode(ITreeNode parentNode, ITreeNode node, PipingSoilProfile nodeData) + { + node.Text = nodeData.Name; + node.Image = Resources.PipingSoilProfileIcon; + } + } +} \ No newline at end of file Index: src/Plugins/Ringtoets/Piping/src/Ringtoets.Piping.Forms/Properties/Resources.Designer.cs =================================================================== diff -u -r308703c02f5602704483e204ad9a475d90eece69 -rb02b755bf5d7a52b44deb11bdb9b1e70789306a0 --- src/Plugins/Ringtoets/Piping/src/Ringtoets.Piping.Forms/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 308703c02f5602704483e204ad9a475d90eece69) +++ src/Plugins/Ringtoets/Piping/src/Ringtoets.Piping.Forms/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision b02b755bf5d7a52b44deb11bdb9b1e70789306a0) @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.18444 +// Runtime Version:4.0.30319.34209 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -739,6 +739,24 @@ } /// + /// Looks up a localized string similar to Het niveau van de onderkant van dit profiel.. + /// + public static string PipingSoilProfileBottomDescription { + get { + return ResourceManager.GetString("PipingSoilProfileBottomDescription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Bodemniveau. + /// + public static string PipingSoilProfileBottomDisplayName { + get { + return ResourceManager.GetString("PipingSoilProfileBottomDisplayName", resourceCulture); + } + } + + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// public static System.Drawing.Bitmap PipingSoilProfileIcon { @@ -749,6 +767,33 @@ } /// + /// Looks up a localized string similar to De naam van het ondergrondprofiel.. + /// + public static string PipingSoilProfileNameDescription { + get { + return ResourceManager.GetString("PipingSoilProfileNameDescription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Naam. + /// + public static string PipingSoilProfileNameDisplayName { + get { + return ResourceManager.GetString("PipingSoilProfileNameDisplayName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Ondergrondprofiel. + /// + public static string PipingSoilProfilePropertiesDisplayName { + get { + return ResourceManager.GetString("PipingSoilProfilePropertiesDisplayName", resourceCulture); + } + } + + /// /// Looks up a localized string similar to Ondergrondprofielen. /// public static string PipingSoilProfilesCollectionName { @@ -758,6 +803,24 @@ } /// + /// Looks up a localized string similar to De niveaus van de bovenkant van de lagen binnen dit profiel.. + /// + public static string PipingSoilProfileTopsDescription { + get { + return ResourceManager.GetString("PipingSoilProfileTopsDescription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Topniveaus. + /// + public static string PipingSoilProfileTopsDisplayName { + get { + return ResourceManager.GetString("PipingSoilProfileTopsDisplayName", resourceCulture); + } + } + + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// public static System.Drawing.Bitmap PipingSurfaceLineIcon { Index: src/Plugins/Ringtoets/Piping/src/Ringtoets.Piping.Forms/Properties/Resources.resx =================================================================== diff -u -r308703c02f5602704483e204ad9a475d90eece69 -rb02b755bf5d7a52b44deb11bdb9b1e70789306a0 --- src/Plugins/Ringtoets/Piping/src/Ringtoets.Piping.Forms/Properties/Resources.resx (.../Resources.resx) (revision 308703c02f5602704483e204ad9a475d90eece69) +++ src/Plugins/Ringtoets/Piping/src/Ringtoets.Piping.Forms/Properties/Resources.resx (.../Resources.resx) (revision b02b755bf5d7a52b44deb11bdb9b1e70789306a0) @@ -391,4 +391,25 @@ Naam + + Het niveau van de onderkant van dit profiel. + + + Bodemniveau + + + De naam van het ondergrondprofiel. + + + Naam + + + Ondergrondprofiel + + + De niveaus van de bovenkant van de lagen binnen dit profiel. + + + Topniveaus + \ No newline at end of file Index: src/Plugins/Ringtoets/Piping/src/Ringtoets.Piping.Forms/PropertyClasses/PipingSoilProfileProperties.cs =================================================================== diff -u --- src/Plugins/Ringtoets/Piping/src/Ringtoets.Piping.Forms/PropertyClasses/PipingSoilProfileProperties.cs (revision 0) +++ src/Plugins/Ringtoets/Piping/src/Ringtoets.Piping.Forms/PropertyClasses/PipingSoilProfileProperties.cs (revision b02b755bf5d7a52b44deb11bdb9b1e70789306a0) @@ -0,0 +1,50 @@ +using System.Linq; +using DelftTools.Shell.Gui; +using DelftTools.Utils; +using Ringtoets.Piping.Data; +using Ringtoets.Piping.Forms.Properties; +using TypeConverter = System.ComponentModel.TypeConverterAttribute; + +namespace Ringtoets.Piping.Forms.PropertyClasses +{ + /// + /// ViewModel of for properties panel. + /// + [ResourcesDisplayName(typeof(Resources), "PipingSoilProfilePropertiesDisplayName")] + public class PipingSoilProfileProperties : ObjectProperties + { + [ResourcesCategory(typeof(Resources), "Categories_General")] + [ResourcesDisplayName(typeof(Resources), "PipingSoilProfileNameDisplayName")] + [ResourcesDescription(typeof(Resources), "PipingSoilProfileNameDescription")] + public string Name + { + get + { + return data.Name; + } + } + + [TypeConverter(typeof(ExpandableArrayConverter))] + [ResourcesCategory(typeof(Resources), "Categories_General")] + [ResourcesDisplayName(typeof(Resources), "PipingSoilProfileTopsDisplayName")] + [ResourcesDescription(typeof(Resources), "PipingSoilProfileTopsDescription")] + public double[] TopLevels + { + get + { + return data.Layers.Select(l => l.Top).ToArray(); + } + } + + [ResourcesCategory(typeof(Resources), "Categories_General")] + [ResourcesDisplayName(typeof(Resources), "PipingSoilProfileBottomDisplayName")] + [ResourcesDescription(typeof(Resources), "PipingSoilProfileBottomDescription")] + public double Bottom + { + get + { + return data.Bottom; + } + } + } +} \ No newline at end of file Index: src/Plugins/Ringtoets/Piping/src/Ringtoets.Piping.Forms/Ringtoets.Piping.Forms.csproj =================================================================== diff -u -r464b6d664be0b6c7cef0b141f40f51bcef2217ac -rb02b755bf5d7a52b44deb11bdb9b1e70789306a0 --- src/Plugins/Ringtoets/Piping/src/Ringtoets.Piping.Forms/Ringtoets.Piping.Forms.csproj (.../Ringtoets.Piping.Forms.csproj) (revision 464b6d664be0b6c7cef0b141f40f51bcef2217ac) +++ src/Plugins/Ringtoets/Piping/src/Ringtoets.Piping.Forms/Ringtoets.Piping.Forms.csproj (.../Ringtoets.Piping.Forms.csproj) (revision b02b755bf5d7a52b44deb11bdb9b1e70789306a0) @@ -60,6 +60,7 @@ + @@ -72,6 +73,7 @@ + Index: src/Plugins/Ringtoets/Piping/src/Ringtoets.Piping.Plugin/FileImporter/PipingSoilProfilesImporter.cs =================================================================== diff -u -r300a33d9acf653458b834b296becbf9ae552de8e -rb02b755bf5d7a52b44deb11bdb9b1e70789306a0 --- src/Plugins/Ringtoets/Piping/src/Ringtoets.Piping.Plugin/FileImporter/PipingSoilProfilesImporter.cs (.../PipingSoilProfilesImporter.cs) (revision 300a33d9acf653458b834b296becbf9ae552de8e) +++ src/Plugins/Ringtoets/Piping/src/Ringtoets.Piping.Plugin/FileImporter/PipingSoilProfilesImporter.cs (.../PipingSoilProfilesImporter.cs) (revision b02b755bf5d7a52b44deb11bdb9b1e70789306a0) @@ -3,9 +3,9 @@ using System.Drawing; using DelftTools.Shell.Core; - +using log4net; using Ringtoets.Piping.Data; - +using Ringtoets.Piping.IO; using WtiFormsResources = Ringtoets.Piping.Forms.Properties.Resources; using ApplicationResources = Ringtoets.Piping.Plugin.Properties.Resources; @@ -16,6 +16,8 @@ /// public class PipingSoilProfilesImporter : IFileImporter { + private readonly ILog log = LogManager.GetLogger(typeof(PipingSoilProfilesImporter)); + public string Name { get @@ -87,7 +89,65 @@ public object ImportItem(string path, object target = null) { + NotifyProgress(ApplicationResources.PipingSoilProfilesImporter_ReadingDatabase, 1, 2); + + var importResult = ReadSoilProfiles(path); + + if (!ShouldCancel) + { + AddImportedDataToModel(target, importResult); + } + else + { + HandleUserCancellingImport(); + } + return target; } + + private void AddImportedDataToModel(object target, IEnumerable importedSoilProfiles) + { + NotifyProgress(ApplicationResources.PipingSoilProfilesImporter_AddingImportedDataToModel, 2, 2); + + var targetCollection = (ICollection)target; + foreach (var soilProfile in importedSoilProfiles) + { + targetCollection.Add(soilProfile); + } + + var observableTarget = targetCollection as IObservable; + if (observableTarget != null) + { + observableTarget.NotifyObservers(); + } + } + + private IEnumerable ReadSoilProfiles(string path) + { + using (var soilProfileReader = new PipingSoilProfileReader(path)) + { + try + { + return soilProfileReader.Read(); + } + catch + { + return null; + } + } + } + + private void NotifyProgress(string currentStepName, int currentStep, int totalNumberOfSteps) + { + if (ProgressChanged != null) + { + ProgressChanged(currentStepName, currentStep, totalNumberOfSteps); + } + } + + private void HandleUserCancellingImport() + { + log.Info(ApplicationResources.PipingSoilProfilesImporter_ImportItem_ImportCancelled); + } } } \ No newline at end of file Index: src/Plugins/Ringtoets/Piping/src/Ringtoets.Piping.Plugin/Properties/Resources.Designer.cs =================================================================== diff -u -rbf4322caa6a74c61bf905b8156f6110aa07f9afc -rb02b755bf5d7a52b44deb11bdb9b1e70789306a0 --- src/Plugins/Ringtoets/Piping/src/Ringtoets.Piping.Plugin/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision bf4322caa6a74c61bf905b8156f6110aa07f9afc) +++ src/Plugins/Ringtoets/Piping/src/Ringtoets.Piping.Plugin/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision b02b755bf5d7a52b44deb11bdb9b1e70789306a0) @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.18444 +// Runtime Version:4.0.30319.34209 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -72,6 +72,33 @@ /// /// Looks up a localized string similar to Geïmporteerde data toevoegen aan faalmechanisme.... /// + public static string PipingSoilProfilesImporter_AddingImportedDataToModel { + get { + return ResourceManager.GetString("PipingSoilProfilesImporter_AddingImportedDataToModel", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Grondprofielen importeren afgebroken. Geen data ingelezen.. + /// + public static string PipingSoilProfilesImporter_ImportItem_ImportCancelled { + get { + return ResourceManager.GetString("PipingSoilProfilesImporter_ImportItem_ImportCancelled", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Inlezen van de D-SoilModel database.... + /// + public static string PipingSoilProfilesImporter_ReadingDatabase { + get { + return ResourceManager.GetString("PipingSoilProfilesImporter_ReadingDatabase", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Geïmporteerde data toevoegen aan faalmechanisme.... + /// public static string PipingSurfaceLinesCsvImporter_AddingImportedDataToModel { get { return ResourceManager.GetString("PipingSurfaceLinesCsvImporter_AddingImportedDataToModel", resourceCulture); @@ -88,7 +115,7 @@ } /// - /// Looks up a localized string similar to Dwarsdoorsneden importeren afgebroken; Geen data ingelezen.. + /// Looks up a localized string similar to Dwarsdoorsneden importeren afgebroken. Geen data ingelezen.. /// public static string PipingSurfaceLinesCsvImporter_ImportItem_ImportCancelled { get { Index: src/Plugins/Ringtoets/Piping/src/Ringtoets.Piping.Plugin/Properties/Resources.resx =================================================================== diff -u -rd80c8343ac1824759a0c42c3347c3900b67004b1 -rb02b755bf5d7a52b44deb11bdb9b1e70789306a0 --- src/Plugins/Ringtoets/Piping/src/Ringtoets.Piping.Plugin/Properties/Resources.resx (.../Resources.resx) (revision d80c8343ac1824759a0c42c3347c3900b67004b1) +++ src/Plugins/Ringtoets/Piping/src/Ringtoets.Piping.Plugin/Properties/Resources.resx (.../Resources.resx) (revision b02b755bf5d7a52b44deb11bdb9b1e70789306a0) @@ -145,7 +145,7 @@ Geïmporteerde data toevoegen aan faalmechanisme... - Dwarsdoorsneden importeren afgebroken; Geen data ingelezen. + Dwarsdoorsneden importeren afgebroken. Geen data ingelezen. Inlezen {0}... @@ -156,4 +156,13 @@ Er is een leesfout opgetreden bij dwarsdoorsnede {1} van bestand '{0}' en is overgeslagen: {2} + + Geïmporteerde data toevoegen aan faalmechanisme... + + + Grondprofielen importeren afgebroken. Geen data ingelezen. + + + Inlezen van de D-SoilModel database... + \ No newline at end of file Index: src/Plugins/Ringtoets/Piping/src/Ringtoets.Piping.Plugin/WtiGuiPlugin.cs =================================================================== diff -u -r300a33d9acf653458b834b296becbf9ae552de8e -rb02b755bf5d7a52b44deb11bdb9b1e70789306a0 --- src/Plugins/Ringtoets/Piping/src/Ringtoets.Piping.Plugin/WtiGuiPlugin.cs (.../WtiGuiPlugin.cs) (revision 300a33d9acf653458b834b296becbf9ae552de8e) +++ src/Plugins/Ringtoets/Piping/src/Ringtoets.Piping.Plugin/WtiGuiPlugin.cs (.../WtiGuiPlugin.cs) (revision b02b755bf5d7a52b44deb11bdb9b1e70789306a0) @@ -76,6 +76,7 @@ { ObjectType = typeof(RingtoetsPipingSurfaceLine), PropertyType = typeof(PipingSurfaceLineProperties) }; + yield return new PropertyInfo(); } public override IEnumerable GetProjectTreeViewNodePresenters() @@ -92,6 +93,7 @@ { ImportSoilProfilesAction = Gui.CommandHandler.ImportToGuiSelection }; + yield return new PipingSoilProfileNodePresenter(); yield return new PipingOutputNodePresenter(); } } Index: src/Plugins/Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/NodePresenters/PipingSoilProfileCollectionNodePresenterTest.cs =================================================================== diff -u -r300a33d9acf653458b834b296becbf9ae552de8e -rb02b755bf5d7a52b44deb11bdb9b1e70789306a0 --- src/Plugins/Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/NodePresenters/PipingSoilProfileCollectionNodePresenterTest.cs (.../PipingSoilProfileCollectionNodePresenterTest.cs) (revision 300a33d9acf653458b834b296becbf9ae552de8e) +++ src/Plugins/Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/NodePresenters/PipingSoilProfileCollectionNodePresenterTest.cs (.../PipingSoilProfileCollectionNodePresenterTest.cs) (revision b02b755bf5d7a52b44deb11bdb9b1e70789306a0) @@ -41,7 +41,7 @@ var nodePresenter = new PipingSoilProfileCollectionNodePresenter(); - IEnumerable soilProfilesCollection = Enumerable.Empty(); + IEnumerable soilProfilesCollection = new PipingSoilProfile[0]; // Call nodePresenter.UpdateNode(null, soilProfileCollectionNodeStub, soilProfilesCollection); Index: src/Plugins/Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/NodePresenters/PipingSoilProfileNodePresenterTest.cs =================================================================== diff -u --- src/Plugins/Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/NodePresenters/PipingSoilProfileNodePresenterTest.cs (revision 0) +++ src/Plugins/Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/NodePresenters/PipingSoilProfileNodePresenterTest.cs (revision b02b755bf5d7a52b44deb11bdb9b1e70789306a0) @@ -0,0 +1,56 @@ +using System; +using System.Collections.Generic; +using DelftTools.Controls; +using NUnit.Framework; +using Rhino.Mocks; +using Ringtoets.Piping.Data; +using Ringtoets.Piping.Forms.NodePresenters; + +namespace Ringtoets.Piping.Forms.Test.NodePresenters +{ + [TestFixture] + public class PipingSoilProfileNodePresenterTest + { + + [Test] + public void DefaultConstructor_ExpectedValues() + { + // Call + var nodePresenter = new PipingSoilProfileNodePresenter(); + + // Assert + Assert.IsInstanceOf>(nodePresenter); + Assert.IsInstanceOf(nodePresenter); + } + + [Test] + public void UpdateNode_NodeWithData_InitializeNode() + { + // Setup + var mocks = new MockRepository(); + var parentNodeMock = mocks.StrictMock(); + var dataNodeMock = mocks.Stub(); + mocks.ReplayAll(); + + const string name = ""; + var random = new Random(22); + double bottom = random.NextDouble(); + IEnumerable layers = new[] + { + new PipingSoilLayer(random.NextDouble()) + }; + var soilProfile = new PipingSoilProfile(name, bottom, layers); + + var nodePresenter = new PipingSoilProfileNodePresenter(); + + // Call + nodePresenter.UpdateNode(parentNodeMock, dataNodeMock, soilProfile); + + // Assert + Assert.AreEqual(name, dataNodeMock.Text); + Assert.AreEqual(16, dataNodeMock.Image.Height); + Assert.AreEqual(16, dataNodeMock.Image.Width); + mocks.VerifyAll(); + } + } +} \ No newline at end of file Index: src/Plugins/Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/PropertyClasses/PipingSoilProfilePropertiesTest.cs =================================================================== diff -u --- src/Plugins/Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/PropertyClasses/PipingSoilProfilePropertiesTest.cs (revision 0) +++ src/Plugins/Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/PropertyClasses/PipingSoilProfilePropertiesTest.cs (revision b02b755bf5d7a52b44deb11bdb9b1e70789306a0) @@ -0,0 +1,47 @@ +using System.Collections.Generic; +using System.Linq; +using DelftTools.Shell.Gui; +using NUnit.Framework; +using Ringtoets.Piping.Data; +using Ringtoets.Piping.Forms.PropertyClasses; + +namespace Ringtoets.Piping.Forms.Test.PropertyClasses +{ + [TestFixture] + public class PipingSoilProfilePropertiesTest + { + [Test] + public void DefaultConstructor_ExpectedValues() + { + // Call + var properties = new PipingSoilProfileProperties(); + + // Assert + Assert.IsInstanceOf>(properties); + Assert.IsNull(properties.Data); + } + + [Test] + public void GetProperties_WithData_ReturnExpectedValues() + { + // Setup + const string expectedName = ""; + IEnumerable layers = new [] + { + new PipingSoilLayer(-2), + new PipingSoilLayer(-4) + }; + var soilProfile = new PipingSoilProfile(expectedName, -5.0, layers); + + var properties = new PipingSoilProfileProperties + { + Data = soilProfile + }; + + // Call & Assert + Assert.AreEqual(expectedName, properties.Name); + CollectionAssert.AreEqual(soilProfile.Layers.Select(l => l.Top), properties.TopLevels); + Assert.AreEqual(soilProfile.Bottom, properties.Bottom); + } + } +} \ No newline at end of file Index: src/Plugins/Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/Ringtoets.Piping.Forms.Test.csproj =================================================================== diff -u -r300a33d9acf653458b834b296becbf9ae552de8e -rb02b755bf5d7a52b44deb11bdb9b1e70789306a0 --- src/Plugins/Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/Ringtoets.Piping.Forms.Test.csproj (.../Ringtoets.Piping.Forms.Test.csproj) (revision 300a33d9acf653458b834b296becbf9ae552de8e) +++ src/Plugins/Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/Ringtoets.Piping.Forms.Test.csproj (.../Ringtoets.Piping.Forms.Test.csproj) (revision b02b755bf5d7a52b44deb11bdb9b1e70789306a0) @@ -52,6 +52,7 @@ + @@ -60,6 +61,7 @@ +