Fisheye: Tag 25d9f184b0a7bf99101d2ec0b1089ba2aeed9080 refers to a dead (removed) revision in file `Ringtoets/Integration/src/Ringtoets.Integration.Forms/PresentationObjects/HydraulicBoundaryLocationProperties.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/PropertyClasses/HydraulicBoundaryLocationProperties.cs =================================================================== diff -u --- Ringtoets/Integration/src/Ringtoets.Integration.Forms/PropertyClasses/HydraulicBoundaryLocationProperties.cs (revision 0) +++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/PropertyClasses/HydraulicBoundaryLocationProperties.cs (revision 25d9f184b0a7bf99101d2ec0b1089ba2aeed9080) @@ -0,0 +1,110 @@ +// 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.ComponentModel; +using System.Globalization; +using Core.Common.Base.Geometry; +using Core.Common.Gui.Attributes; +using Core.Common.Gui.PropertyBag; +using Core.Common.Utils.Attributes; +using Ringtoets.HydraRing.Data; +using Ringtoets.Integration.Forms.Properties; + +namespace Ringtoets.Integration.Forms.PropertyClasses +{ + /// + /// ViewModel of for properties panel. + /// + [TypeConverter(typeof(ExpandableObjectConverter))] + public class HydraulicBoundaryLocationProperties : ObjectProperties + { + /// + /// New instance of . + /// + /// whose data will be used for the properties panel. + public HydraulicBoundaryLocationProperties(HydraulicBoundaryLocation hydraulicBoundaryLocation) + { + data = hydraulicBoundaryLocation; + } + + /// + /// Gets the Id from the . + /// + [PropertyOrder(1)] + [ResourcesDisplayName(typeof(Resources), "HydraulicBoundaryDatabase_Locations_Id_DisplayName")] + [ResourcesDescription(typeof(Resources), "HydraulicBoundaryDatabase_Locations_Id_Description")] + public long Id + { + get + { + return data.Id; + } + } + + /// + /// Gets the Name from the . + /// + [PropertyOrder(2)] + [ResourcesDisplayName(typeof(Resources), "HydraulicBoundaryDatabase_Locations_Name_DisplayName")] + [ResourcesDescription(typeof(Resources), "HydraulicBoundaryDatabase_Locations_Name_Description")] + public string Name + { + get + { + return data.Name; + } + } + + /// + /// Gets the Location from the . + /// + [PropertyOrder(3)] + [ResourcesDisplayName(typeof(Resources), "HydraulicBoundaryDatabase_Locations_Coordinates_DisplayName")] + [ResourcesDescription(typeof(Resources), "HydraulicBoundaryDatabase_Locations_Coordinates_Description")] + public Point2D Location + { + get + { + return data.Location; + } + } + + /// + /// Gets the DesignWaterLevel from the . + /// + [PropertyOrder(4)] + [ResourcesDisplayName(typeof(Resources), "HydraulicBoundaryDatabase_Locations_DesignWaterLevel_DisplayName")] + [ResourcesDescription(typeof(Resources), "HydraulicBoundaryDatabase_Locations_DesignWaterLevel_Description")] + public string DesignWaterLevel + { + get + { + return double.IsNaN(data.DesignWaterLevel) ? "" : data.DesignWaterLevel.ToString("F2", CultureInfo.InvariantCulture); + } + } + + public override string ToString() + { + return String.Format("{0} {1}", Name, Location); + } + } +} \ No newline at end of file Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/Ringtoets.Integration.Forms.csproj =================================================================== diff -u -r44055100aa3c3f382227becdaeae7d97c75d386c -r25d9f184b0a7bf99101d2ec0b1089ba2aeed9080 --- Ringtoets/Integration/src/Ringtoets.Integration.Forms/Ringtoets.Integration.Forms.csproj (.../Ringtoets.Integration.Forms.csproj) (revision 44055100aa3c3f382227becdaeae7d97c75d386c) +++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/Ringtoets.Integration.Forms.csproj (.../Ringtoets.Integration.Forms.csproj) (revision 25d9f184b0a7bf99101d2ec0b1089ba2aeed9080) @@ -44,7 +44,7 @@ - + True Fisheye: Tag 25d9f184b0a7bf99101d2ec0b1089ba2aeed9080 refers to a dead (removed) revision in file `Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PresentationObjects/HydraulicBoundaryLocationPropertiesTest.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PropertyClasses/HydraulicBoundaryLocationPropertiesTest.cs =================================================================== diff -u --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PropertyClasses/HydraulicBoundaryLocationPropertiesTest.cs (revision 0) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PropertyClasses/HydraulicBoundaryLocationPropertiesTest.cs (revision 25d9f184b0a7bf99101d2ec0b1089ba2aeed9080) @@ -0,0 +1,174 @@ +// 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.ComponentModel; +using System.Globalization; +using Core.Common.Base.Geometry; +using Core.Common.Gui.PropertyBag; +using NUnit.Framework; +using Rhino.Mocks; +using Ringtoets.HydraRing.Data; +using Ringtoets.Integration.Forms.PropertyClasses; + +namespace Ringtoets.Integration.Forms.Test.PropertyClasses +{ + [TestFixture] + public class HydraulicBoundaryLocationPropertiesTest + { + [Test] + public void Constructor_DefaultArgumentValues_DoesNotThrowException() + { + // Setup + var mockRepository = new MockRepository(); + object[] hydraulicBoundaryLocationArguments = + { + 0, + "", + 0.0, + 0.0 + }; + var hydraulicBoundaryLocationMock = mockRepository.StrictMock(hydraulicBoundaryLocationArguments); + mockRepository.ReplayAll(); + + // Call + TestDelegate test = () => new HydraulicBoundaryLocationProperties(hydraulicBoundaryLocationMock); + + // Assert + Assert.DoesNotThrow(test); + mockRepository.VerifyAll(); + } + + [Test] + public void GetProperties_ValidData_ReturnsExpectedValues() + { + // Setup + long id = 1234L; + double x = 567.0; + double y = 890.0; + Point2D coordinates = new Point2D(x, y); + string name = ""; + double designWaterLevel = 5.123456; + string expectedDesignWaterLevel = designWaterLevel.ToString("F2", CultureInfo.InvariantCulture); + + var mockRepository = new MockRepository(); + var hydraulicBoundaryLocationMock = mockRepository.StrictMock(id, name, x, y); + hydraulicBoundaryLocationMock.DesignWaterLevel = designWaterLevel; + mockRepository.ReplayAll(); + + // Call + HydraulicBoundaryLocationProperties hydraulicBoundaryLocationProperties = new HydraulicBoundaryLocationProperties(hydraulicBoundaryLocationMock); + + // Assert + Assert.AreEqual(id, hydraulicBoundaryLocationProperties.Id); + Assert.AreEqual(name, hydraulicBoundaryLocationProperties.Name); + Assert.AreEqual(expectedDesignWaterLevel, hydraulicBoundaryLocationProperties.DesignWaterLevel); + Assert.AreEqual(coordinates, hydraulicBoundaryLocationProperties.Location); + mockRepository.VerifyAll(); + } + + [Test] + [TestCase("")] + [TestCase("some name")] + public void ToString_WithName_ReturnsName(string name) + { + // Setup + long id = 1234L; + double x = 567.0; + double y = 890.0; + var mockRepository = new MockRepository(); + object[] hydraulicBoundaryLocationArguments = + { + id, + name, + x, + y + }; + var hydraulicBoundaryLocationMock = mockRepository.StrictMock(hydraulicBoundaryLocationArguments); + mockRepository.ReplayAll(); + + var expectedString = string.Format("{0} {1}", name, new Point2D(x, y)); + + // Call + HydraulicBoundaryLocationProperties hydraulicBoundaryLocationProperties = new HydraulicBoundaryLocationProperties(hydraulicBoundaryLocationMock); + + // Assert + Assert.AreEqual(expectedString, hydraulicBoundaryLocationProperties.ToString()); + } + + [Test] + public void PropertyAttributes_ReturnExpectedValues() + { + // Setup + var mockRepository = new MockRepository(); + var hydraulicBoundaryLocationMock = mockRepository.StrictMock(0, "", 0.0, 0.0); + mockRepository.ReplayAll(); + + var hydraulicBoundaryLocationProperties = new HydraulicBoundaryLocationProperties(hydraulicBoundaryLocationMock); + + var dynamicPropertyBag = new DynamicPropertyBag(hydraulicBoundaryLocationProperties); + const string expectedIdDisplayName = "Id"; + const string expectedNameDisplayName = "Naam"; + const string expectedLocationDisplayName = "Coördinaten"; + const string expectedDesignWaterLevelDisplayName = "Toetspeil [m+NAP]"; + const string expectedIdDescription = "Id van de hydraulische randvoorwaarden locatie in de database."; + const string expectedNameDescriptione = "Naam van de hydraulische randvoorwaarden locatie."; + const string expectedLocationDescriptione = "Coördinaten van de hydraulische randvoorwaarden locatie."; + const string expectedDesignWaterLevelDescription = "Berekend toetspeil."; + + // Call + TypeConverter classTypeConverter = TypeDescriptor.GetConverter(hydraulicBoundaryLocationProperties, true); + PropertyDescriptorCollection dynamicProperties = dynamicPropertyBag.GetProperties(); + PropertyDescriptor idProperty = dynamicProperties[0]; + PropertyDescriptor nameProperty = dynamicProperties[1]; + PropertyDescriptor locationProperty = dynamicProperties[2]; + PropertyDescriptor designWaterLevelProperty = dynamicProperties[3]; + + // Assert + Assert.IsInstanceOf(classTypeConverter); + + Assert.IsNotNull(idProperty); + Assert.IsTrue(idProperty.IsReadOnly); + Assert.IsTrue(idProperty.IsBrowsable); + Assert.AreEqual(expectedIdDisplayName, idProperty.DisplayName); + Assert.AreEqual(expectedIdDescription, idProperty.Description); + + Assert.IsNotNull(nameProperty); + Assert.IsTrue(nameProperty.IsReadOnly); + Assert.IsTrue(nameProperty.IsBrowsable); + Assert.AreEqual(expectedNameDisplayName, nameProperty.DisplayName); + Assert.AreEqual(expectedNameDescriptione, nameProperty.Description); + + Assert.IsNotNull(locationProperty); + Assert.IsTrue(locationProperty.IsReadOnly); + Assert.IsTrue(locationProperty.IsBrowsable); + Assert.AreEqual(expectedLocationDisplayName, locationProperty.DisplayName); + Assert.AreEqual(expectedLocationDescriptione, locationProperty.Description); + + Assert.IsNotNull(designWaterLevelProperty); + Assert.IsTrue(designWaterLevelProperty.IsReadOnly); + Assert.IsTrue(designWaterLevelProperty.IsBrowsable); + Assert.AreEqual(expectedDesignWaterLevelDisplayName, designWaterLevelProperty.DisplayName); + Assert.AreEqual(expectedDesignWaterLevelDescription, designWaterLevelProperty.Description); + + mockRepository.VerifyAll(); + } + } +} \ No newline at end of file Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Ringtoets.Integration.Forms.Test.csproj =================================================================== diff -u -rb0f76088ee6509fe4195af4e06fba7ca59b361f2 -r25d9f184b0a7bf99101d2ec0b1089ba2aeed9080 --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Ringtoets.Integration.Forms.Test.csproj (.../Ringtoets.Integration.Forms.Test.csproj) (revision b0f76088ee6509fe4195af4e06fba7ca59b361f2) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Ringtoets.Integration.Forms.Test.csproj (.../Ringtoets.Integration.Forms.Test.csproj) (revision 25d9f184b0a7bf99101d2ec0b1089ba2aeed9080) @@ -60,7 +60,7 @@ - + Index: Ringtoets/Piping/src/Ringtoets.Piping.Forms/Properties/Resources.Designer.cs =================================================================== diff -u -rafe14593a2731eb3faea1c738d172197b977f58b -r25d9f184b0a7bf99101d2ec0b1089ba2aeed9080 --- Ringtoets/Piping/src/Ringtoets.Piping.Forms/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision afe14593a2731eb3faea1c738d172197b977f58b) +++ Ringtoets/Piping/src/Ringtoets.Piping.Forms/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 25d9f184b0a7bf99101d2ec0b1089ba2aeed9080) @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.18444 +// Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -1446,60 +1446,6 @@ } /// - /// Looks up a localized string similar to Het niveau van de onderkant van dit profiel.. - /// - public static string PipingSoilProfile_Bottom_Description { - get { - return ResourceManager.GetString("PipingSoilProfile_Bottom_Description", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Bodemniveau. - /// - public static string PipingSoilProfile_Bottom_DisplayName { - get { - return ResourceManager.GetString("PipingSoilProfile_Bottom_DisplayName", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to De naam van de ondergrondschematisering.. - /// - public static string PipingSoilProfile_Name_Description { - get { - return ResourceManager.GetString("PipingSoilProfile_Name_Description", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Naam. - /// - public static string PipingSoilProfile_Name_DisplayName { - get { - return ResourceManager.GetString("PipingSoilProfile_Name_DisplayName", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to De niveaus van de bovenkant van de lagen binnen dit profiel.. - /// - public static string PipingSoilProfile_Tops_Description { - get { - return ResourceManager.GetString("PipingSoilProfile_Tops_Description", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Topniveaus. - /// - public static string PipingSoilProfile_Tops_DisplayName { - get { - return ResourceManager.GetString("PipingSoilProfile_Tops_DisplayName", resourceCulture); - } - } - - /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// public static System.Drawing.Bitmap PipingSoilProfileIcon { @@ -1510,24 +1456,6 @@ } /// - /// Looks up a localized string similar to Ondergrondschematisering. - /// - public static string PipingSoilProfileProperties_DisplayName { - get { - return ResourceManager.GetString("PipingSoilProfileProperties_DisplayName", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Ondergrondschematiseringen. - /// - public static string PipingSoilProfilesCollection_DisplayName { - get { - return ResourceManager.GetString("PipingSoilProfilesCollection_DisplayName", resourceCulture); - } - } - - /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// public static System.Drawing.Bitmap PipingSurfaceLineIcon { @@ -1716,5 +1644,213 @@ return ResourceManager.GetString("ShiftedLognormalDistribution_ShortName", resourceCulture); } } + + /// + /// Looks up a localized string similar to Geometrie uit de database.. + /// + public static string StochasticSoilModel_Geometry_Description { + get { + return ResourceManager.GetString("StochasticSoilModel_Geometry_Description", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Geometrie. + /// + public static string StochasticSoilModel_Geometry_DisplayName { + get { + return ResourceManager.GetString("StochasticSoilModel_Geometry_DisplayName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Id van het stochastisch ondergrondmodel in de database.. + /// + public static string StochasticSoilModel_Id_Description { + get { + return ResourceManager.GetString("StochasticSoilModel_Id_Description", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Id. + /// + public static string StochasticSoilModel_Id_DisplayName { + get { + return ResourceManager.GetString("StochasticSoilModel_Id_DisplayName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Naam van het stochastisch ondergrondmodel.. + /// + public static string StochasticSoilModel_Name_Description { + get { + return ResourceManager.GetString("StochasticSoilModel_Name_Description", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Naam. + /// + public static string StochasticSoilModel_Name_DisplayName { + get { + return ResourceManager.GetString("StochasticSoilModel_Name_DisplayName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Naam van het stochastisch ondergrondmodel segment.. + /// + public static string StochasticSoilModel_SegmentName_Description { + get { + return ResourceManager.GetString("StochasticSoilModel_SegmentName_Description", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Segment naam. + /// + public static string StochasticSoilModel_SegmentName_DisplayName { + get { + return ResourceManager.GetString("StochasticSoilModel_SegmentName_DisplayName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Stochastisch ondergrondmodellen uit de database.. + /// + public static string StochasticSoilModel_StochasticSoilProfiles_Description { + get { + return ResourceManager.GetString("StochasticSoilModel_StochasticSoilProfiles_Description", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Stochastisch ondergrondmodellen. + /// + public static string StochasticSoilModel_StochasticSoilProfiles_DisplayName { + get { + return ResourceManager.GetString("StochasticSoilModel_StochasticSoilProfiles_DisplayName", resourceCulture); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + public static System.Drawing.Bitmap StochasticSoilModelIcon { + get { + object obj = ResourceManager.GetObject("StochasticSoilModelIcon", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized string similar to Het niveau van de onderkant van dit profiel.. + /// + public static string StochasticSoilProfile_Bottom_Description { + get { + return ResourceManager.GetString("StochasticSoilProfile_Bottom_Description", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Bodemniveau. + /// + public static string StochasticSoilProfile_Bottom_DisplayName { + get { + return ResourceManager.GetString("StochasticSoilProfile_Bottom_DisplayName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to De naam van de ondergrondschematisering.. + /// + public static string StochasticSoilProfile_Name_Description { + get { + return ResourceManager.GetString("StochasticSoilProfile_Name_Description", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Naam. + /// + public static string StochasticSoilProfile_Name_DisplayName { + get { + return ResourceManager.GetString("StochasticSoilProfile_Name_DisplayName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Het aandeel in het scenario.. + /// + public static string StochasticSoilProfile_Probability_Description { + get { + return ResourceManager.GetString("StochasticSoilProfile_Probability_Description", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Aandeel in scenario [%]. + /// + public static string StochasticSoilProfile_Probability_DisplayName { + get { + return ResourceManager.GetString("StochasticSoilProfile_Probability_DisplayName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to De niveaus van de bovenkant van de lagen binnen dit profiel.. + /// + public static string StochasticSoilProfile_Tops_Description { + get { + return ResourceManager.GetString("StochasticSoilProfile_Tops_Description", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Topniveaus. + /// + public static string StochasticSoilProfile_Tops_DisplayName { + get { + return ResourceManager.GetString("StochasticSoilProfile_Tops_DisplayName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Het type van de ondergrondschematisering.. + /// + public static string StochasticSoilProfile_Type_Description { + get { + return ResourceManager.GetString("StochasticSoilProfile_Type_Description", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Type. + /// + public static string StochasticSoilProfile_Type_DisplayName { + get { + return ResourceManager.GetString("StochasticSoilProfile_Type_DisplayName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Ondergrondschematiseringen. + /// + public static string StochasticSoilProfileCollection_DisplayName { + get { + return ResourceManager.GetString("StochasticSoilProfileCollection_DisplayName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Ondergrondschematisering. + /// + public static string StochasticSoilProfileProperties_DisplayName { + get { + return ResourceManager.GetString("StochasticSoilProfileProperties_DisplayName", resourceCulture); + } + } } } Index: Ringtoets/Piping/src/Ringtoets.Piping.Forms/Properties/Resources.resx =================================================================== diff -u -rafe14593a2731eb3faea1c738d172197b977f58b -r25d9f184b0a7bf99101d2ec0b1089ba2aeed9080 --- Ringtoets/Piping/src/Ringtoets.Piping.Forms/Properties/Resources.resx (.../Resources.resx) (revision afe14593a2731eb3faea1c738d172197b977f58b) +++ Ringtoets/Piping/src/Ringtoets.Piping.Forms/Properties/Resources.resx (.../Resources.resx) (revision 25d9f184b0a7bf99101d2ec0b1089ba2aeed9080) @@ -286,7 +286,7 @@ Importeer nieuwe profielmetingen van een *.csv bestand. - + Ondergrondschematiseringen @@ -325,25 +325,25 @@ Naam - + Het niveau van de onderkant van dit profiel. - + Bodemniveau - + De naam van de ondergrondschematisering. - + Naam - + Ondergrondschematisering - + De niveaus van de bovenkant van de lagen binnen dit profiel. - + Topniveaus @@ -667,4 +667,49 @@ Verzadigd gewicht deklaag [kN/m³] + + ..\Resources\shovel.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + Het aandeel in het scenario. + + + Aandeel in scenario [%] + + + Het type van de ondergrondschematisering. + + + Type + + + Geometrie uit de database. + + + Geometrie + + + Id van het stochastisch ondergrondmodel in de database. + + + Id + + + Naam van het stochastisch ondergrondmodel. + + + Naam + + + Naam van het stochastisch ondergrondmodel segment. + + + Segment naam + + + Stochastisch ondergrondmodellen uit de database. + + + Stochastisch ondergrondmodellen + \ No newline at end of file Fisheye: Tag 25d9f184b0a7bf99101d2ec0b1089ba2aeed9080 refers to a dead (removed) revision in file `Ringtoets/Piping/src/Ringtoets.Piping.Forms/PropertyClasses/PipingSoilProfileProperties.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/Piping/src/Ringtoets.Piping.Forms/PropertyClasses/StochasticSoilModelProperties.cs =================================================================== diff -u --- Ringtoets/Piping/src/Ringtoets.Piping.Forms/PropertyClasses/StochasticSoilModelProperties.cs (revision 0) +++ Ringtoets/Piping/src/Ringtoets.Piping.Forms/PropertyClasses/StochasticSoilModelProperties.cs (revision 25d9f184b0a7bf99101d2ec0b1089ba2aeed9080) @@ -0,0 +1,122 @@ +// 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.ComponentModel; +using System.Linq; +using Core.Common.Base.Geometry; +using Core.Common.Gui.Attributes; +using Core.Common.Gui.Converters; +using Core.Common.Gui.PropertyBag; +using Core.Common.Utils.Attributes; +using Ringtoets.Piping.Data; +using Ringtoets.Piping.Forms.Properties; + +namespace Ringtoets.Piping.Forms.PropertyClasses +{ + /// + /// ViewModel of for properties panel. + /// + [TypeConverter(typeof(ExpandableObjectConverter))] + public class StochasticSoilModelProperties : ObjectProperties + { + /// + /// Gets the id from the . + /// + [PropertyOrder(1)] + [ResourcesCategory(typeof(Resources), "Categories_General")] + [ResourcesDisplayName(typeof(Resources), "StochasticSoilModel_Id_DisplayName")] + [ResourcesDescription(typeof(Resources), "StochasticSoilModel_Id_Description")] + public long Id + { + get + { + return data.Id; + } + } + + /// + /// Gets the name from the . + /// + [PropertyOrder(2)] + [ResourcesCategory(typeof(Resources), "Categories_General")] + [ResourcesDisplayName(typeof(Resources), "StochasticSoilModel_Name_DisplayName")] + [ResourcesDescription(typeof(Resources), "StochasticSoilModel_Name_Description")] + public string Name + { + get + { + return data.Name; + } + } + + /// + /// Gets the name of the segment from the . + /// + [PropertyOrder(3)] + [ResourcesCategory(typeof(Resources), "Categories_General")] + [ResourcesDisplayName(typeof(Resources), "StochasticSoilModel_SegmentName_DisplayName")] + [ResourcesDescription(typeof(Resources), "StochasticSoilModel_SegmentName_Description")] + public string SegmentName + { + get + { + return data.SegmentName; + } + } + + /// + /// Gets the geometry points from the . + /// + [PropertyOrder(4)] + [TypeConverter(typeof(ExpandableArrayConverter))] + [ResourcesCategory(typeof(Resources), "Categories_General")] + [ResourcesDisplayName(typeof(Resources), "StochasticSoilModel_Geometry_DisplayName")] + [ResourcesDescription(typeof(Resources), "StochasticSoilModel_Geometry_Description")] + public Point2D[] Geometry + { + get + { + return data.Geometry.ToArray(); + } + } + + /// + /// Gets the from the . + /// + [PropertyOrder(5)] + [TypeConverter(typeof(ExpandableArrayConverter))] + [ResourcesCategory(typeof(Resources), "Categories_General")] + [ResourcesDisplayName(typeof(Resources), "StochasticSoilModel_StochasticSoilProfiles_DisplayName")] + [ResourcesDescription(typeof(Resources), "StochasticSoilModel_StochasticSoilProfiles_Description")] + public StochasticSoilProfileProperties[] StochasticSoilProfiles + { + get + { + return data.StochasticSoilProfiles.Count > 0 + ? data.StochasticSoilProfiles.Select(ssp => new StochasticSoilProfileProperties + { + Data = ssp + }).ToArray() + : new StochasticSoilProfileProperties[0]; + } + } + } +} \ No newline at end of file Index: Ringtoets/Piping/src/Ringtoets.Piping.Forms/PropertyClasses/StochasticSoilProfileProperties.cs =================================================================== diff -u --- Ringtoets/Piping/src/Ringtoets.Piping.Forms/PropertyClasses/StochasticSoilProfileProperties.cs (revision 0) +++ Ringtoets/Piping/src/Ringtoets.Piping.Forms/PropertyClasses/StochasticSoilProfileProperties.cs (revision 25d9f184b0a7bf99101d2ec0b1089ba2aeed9080) @@ -0,0 +1,124 @@ +// 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.ComponentModel; +using System.Linq; +using Core.Common.Gui.Attributes; +using Core.Common.Gui.Converters; +using Core.Common.Gui.PropertyBag; +using Core.Common.Utils.Attributes; +using Ringtoets.Piping.Data; +using Ringtoets.Piping.Forms.Properties; + +namespace Ringtoets.Piping.Forms.PropertyClasses +{ + /// + /// ViewModel of for properties panel. + /// + [ResourcesDisplayName(typeof(Resources), "StochasticSoilProfileProperties_DisplayName")] + [TypeConverter(typeof(ExpandableObjectConverter))] + public class StochasticSoilProfileProperties : ObjectProperties + { + /// + /// Gets the name from the . + /// + [PropertyOrder(1)] + [ResourcesCategory(typeof(Resources), "Categories_General")] + [ResourcesDisplayName(typeof(Resources), "StochasticSoilProfile_Name_DisplayName")] + [ResourcesDescription(typeof(Resources), "StochasticSoilProfile_Name_Description")] + public string Name + { + get + { + return (data.SoilProfile != null) ? data.SoilProfile.Name : String.Empty; + } + } + + /// + /// Gets the probability from the . + /// + [PropertyOrder(2)] + [ResourcesCategory(typeof(Resources), "Categories_General")] + [ResourcesDisplayName(typeof(Resources), "StochasticSoilProfile_Probability_DisplayName")] + [ResourcesDescription(typeof(Resources), "StochasticSoilProfile_Probability_Description")] + public double Probability + { + get + { + return data.Probability*100; + } + } + + /// + /// Gets the top levels from the + /// in the . + /// + [PropertyOrder(3)] + [TypeConverter(typeof(ExpandableArrayConverter))] + [ResourcesCategory(typeof(Resources), "Categories_General")] + [ResourcesDisplayName(typeof(Resources), "StochasticSoilProfile_Tops_DisplayName")] + [ResourcesDescription(typeof(Resources), "StochasticSoilProfile_Tops_Description")] + public double[] TopLevels + { + get + { + return (data.SoilProfile != null) ? data.SoilProfile.Layers.Select(l => l.Top).ToArray() : new double[0]; + } + } + + /// + /// Gets the bottom from the + /// in the . + /// + [PropertyOrder(4)] + [ResourcesCategory(typeof(Resources), "Categories_General")] + [ResourcesDisplayName(typeof(Resources), "StochasticSoilProfile_Bottom_DisplayName")] + [ResourcesDescription(typeof(Resources), "StochasticSoilProfile_Bottom_Description")] + public double Bottom + { + get + { + return (data.SoilProfile != null) ? data.SoilProfile.Bottom : double.NaN; + } + } + + /// + /// Gets the type from the . + /// + [PropertyOrder(5)] + [ResourcesCategory(typeof(Resources), "Categories_General")] + [ResourcesDisplayName(typeof(Resources), "StochasticSoilProfile_Type_DisplayName")] + [ResourcesDescription(typeof(Resources), "StochasticSoilProfile_Type_Description")] + public string Type + { + get + { + return (data.SoilProfileType == SoilProfileType.SoilProfile1D) ? "1D profiel" : "2D profiel"; + } + } + + public override string ToString() + { + return Name; + } + } +} \ No newline at end of file Index: Ringtoets/Piping/src/Ringtoets.Piping.Forms/Resources/shovel.png =================================================================== diff -u Binary files differ Index: Ringtoets/Piping/src/Ringtoets.Piping.Forms/Ringtoets.Piping.Forms.csproj =================================================================== diff -u -rcaa64ef94fa8e30074f269de2fe0aad3c482c690 -r25d9f184b0a7bf99101d2ec0b1089ba2aeed9080 --- Ringtoets/Piping/src/Ringtoets.Piping.Forms/Ringtoets.Piping.Forms.csproj (.../Ringtoets.Piping.Forms.csproj) (revision caa64ef94fa8e30074f269de2fe0aad3c482c690) +++ Ringtoets/Piping/src/Ringtoets.Piping.Forms/Ringtoets.Piping.Forms.csproj (.../Ringtoets.Piping.Forms.csproj) (revision 25d9f184b0a7bf99101d2ec0b1089ba2aeed9080) @@ -74,8 +74,9 @@ - + + @@ -221,7 +222,9 @@ - + + + Index: Ringtoets/Piping/src/Ringtoets.Piping.Plugin/FileImporter/PipingSoilProfilesImporter.cs =================================================================== diff -u -r1ef390986aef1eb1b580ff23adb64f5582b9a35d -r25d9f184b0a7bf99101d2ec0b1089ba2aeed9080 --- Ringtoets/Piping/src/Ringtoets.Piping.Plugin/FileImporter/PipingSoilProfilesImporter.cs (.../PipingSoilProfilesImporter.cs) (revision 1ef390986aef1eb1b580ff23adb64f5582b9a35d) +++ Ringtoets/Piping/src/Ringtoets.Piping.Plugin/FileImporter/PipingSoilProfilesImporter.cs (.../PipingSoilProfilesImporter.cs) (revision 25d9f184b0a7bf99101d2ec0b1089ba2aeed9080) @@ -50,7 +50,7 @@ { get { - return PipingFormsResources.PipingSoilProfilesCollection_DisplayName; + return PipingFormsResources.StochasticSoilProfileCollection_DisplayName; } } @@ -75,7 +75,7 @@ get { return String.Format("{0} {1} (*.soil)|*.soil", - PipingFormsResources.PipingSoilProfilesCollection_DisplayName, RingtoetsPluginResources.Soil_file_name); + PipingFormsResources.StochasticSoilProfileCollection_DisplayName, RingtoetsPluginResources.Soil_file_name); } } Index: Ringtoets/Piping/src/Ringtoets.Piping.Plugin/PipingGuiPlugin.cs =================================================================== diff -u -r246217c799d79397354f304b4df013ef67bae07a -r25d9f184b0a7bf99101d2ec0b1089ba2aeed9080 --- Ringtoets/Piping/src/Ringtoets.Piping.Plugin/PipingGuiPlugin.cs (.../PipingGuiPlugin.cs) (revision 246217c799d79397354f304b4df013ef67bae07a) +++ Ringtoets/Piping/src/Ringtoets.Piping.Plugin/PipingGuiPlugin.cs (.../PipingGuiPlugin.cs) (revision 25d9f184b0a7bf99101d2ec0b1089ba2aeed9080) @@ -64,7 +64,8 @@ yield return new PropertyInfo(); yield return new PropertyInfo(); yield return new PropertyInfo(); - yield return new PropertyInfo(); + yield return new PropertyInfo(); + yield return new PropertyInfo(); } public override IEnumerable GetViewInfos() @@ -170,11 +171,11 @@ yield return new TreeNodeInfo { - Text = stochasticSoilModelContext => PipingFormsResources.PipingSoilProfilesCollection_DisplayName, + Text = stochasticSoilModelContext => PipingFormsResources.StochasticSoilProfileCollection_DisplayName, Image = stochasticSoilModelContext => PipingFormsResources.FolderIcon, ForeColor = stochasticSoilModelContext => stochasticSoilModelContext.FailureMechanism.StochasticSoilModels.Any() ? Color.FromKnownColor(KnownColor.ControlText) : Color.FromKnownColor(KnownColor.GrayText), - ChildNodeObjects = stochasticSoilModelContext => stochasticSoilModelContext.FailureMechanism.SoilProfiles.Cast().ToArray(), + ChildNodeObjects = stochasticSoilModelContext => stochasticSoilModelContext.FailureMechanism.StochasticSoilModels.Cast().ToArray(), ContextMenuStrip = (nodeData, parentData, treeViewControl) => Gui.Get(nodeData, treeViewControl) .AddImportItem() .AddExportItem() @@ -184,9 +185,19 @@ .Build() }; - yield return new TreeNodeInfo + yield return new TreeNodeInfo { - Text = pipingSoilProfile => pipingSoilProfile.Name, + Text = stochasticSoilModel => stochasticSoilModel.Name, + Image = stochasticSoilModel => PipingFormsResources.StochasticSoilModelIcon, + ChildNodeObjects = stochasticSoilModel => stochasticSoilModel.StochasticSoilProfiles.Cast().ToArray(), + ContextMenuStrip = (nodeData, parentData, treeViewControl) => Gui.Get(nodeData, treeViewControl) + .AddPropertiesItem() + .Build() + }; + + yield return new TreeNodeInfo + { + Text = pipingSoilProfile => (pipingSoilProfile.SoilProfile != null) ? pipingSoilProfile.SoilProfile.Name : "Profile", Image = pipingSoilProfile => PipingFormsResources.PipingSoilProfileIcon, ContextMenuStrip = (nodeData, parentData, treeViewControl) => Gui.Get(nodeData, treeViewControl) .AddPropertiesItem() Fisheye: Tag 25d9f184b0a7bf99101d2ec0b1089ba2aeed9080 refers to a dead (removed) revision in file `Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/PropertyClasses/PipingSoilProfilePropertiesTest.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/PropertyClasses/StochasticSoilModelPropertiesTest.cs =================================================================== diff -u --- Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/PropertyClasses/StochasticSoilModelPropertiesTest.cs (revision 0) +++ Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/PropertyClasses/StochasticSoilModelPropertiesTest.cs (revision 25d9f184b0a7bf99101d2ec0b1089ba2aeed9080) @@ -0,0 +1,78 @@ +// 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.Collections.Generic; +using Core.Common.Base.Geometry; +using Core.Common.Gui.PropertyBag; +using NUnit.Framework; +using Ringtoets.Piping.Data; +using Ringtoets.Piping.Forms.PropertyClasses; +using Ringtoets.Piping.Primitives; + +namespace Ringtoets.Piping.Forms.Test.PropertyClasses +{ + [TestFixture] + public class StochasticSoilModelPropertiesTest + { + [Test] + public void DefaultConstructor_ExpectedValues() + { + // Call + var properties = new StochasticSoilModelProperties(); + + // Assert + Assert.IsInstanceOf>(properties); + Assert.IsNull(properties.Data); + } + + [Test] + public void GetProperties_WithData_ReturnExpectedValues() + { + // Setup + StochasticSoilModel stochasticSoilModel = new StochasticSoilModel(1324, "Name", "SegmentName"); + stochasticSoilModel.Geometry.Add(new Point2D(1.0, 2.0)); + var pipingSoilProfile = new PipingSoilProfile("PipingSoilProfile", 0, new List + { + new PipingSoilLayer(10) + }, 0); + var stochasticSoilProfile = new StochasticSoilProfile(1.0, SoilProfileType.SoilProfile1D, 1) + { + SoilProfile = pipingSoilProfile + }; + stochasticSoilModel.StochasticSoilProfiles.Add(stochasticSoilProfile); + + // Call + var properties = new StochasticSoilModelProperties + { + Data = stochasticSoilModel + }; + + // Assert + Assert.AreEqual(stochasticSoilModel.Name, properties.Name); + Assert.AreEqual(stochasticSoilModel.SegmentName, properties.SegmentName); + Assert.AreEqual(stochasticSoilModel.Id, properties.Id); + Assert.AreEqual(stochasticSoilModel.Geometry[0], properties.Geometry[0]); + + Assert.IsInstanceOf(properties.StochasticSoilProfiles); + Assert.AreEqual(1, properties.StochasticSoilProfiles.Length); + } + } +} \ No newline at end of file Index: Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/PropertyClasses/StochasticSoilProfilePropertiesTest.cs =================================================================== diff -u --- Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/PropertyClasses/StochasticSoilProfilePropertiesTest.cs (revision 0) +++ Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/PropertyClasses/StochasticSoilProfilePropertiesTest.cs (revision 25d9f184b0a7bf99101d2ec0b1089ba2aeed9080) @@ -0,0 +1,81 @@ +// 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.Collections.Generic; +using System.Linq; +using Core.Common.Gui.PropertyBag; +using NUnit.Framework; +using Ringtoets.Piping.Data; +using Ringtoets.Piping.Forms.PropertyClasses; +using Ringtoets.Piping.Primitives; + +namespace Ringtoets.Piping.Forms.Test.PropertyClasses +{ + [TestFixture] + public class StochasticSoilProfilePropertiesTest + { + [Test] + public void DefaultConstructor_ExpectedValues() + { + // Call + var properties = new StochasticSoilProfileProperties(); + + // 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) + { + IsAquifer = true + } + }; + + var soilProfile = new PipingSoilProfile(expectedName, -5.0, layers, 0); + var stochasticSoilProfile = new StochasticSoilProfile(1.0, SoilProfileType.SoilProfile1D, 1234L) + { + SoilProfile = soilProfile + }; + + // Call + var properties = new StochasticSoilProfileProperties + { + Data = stochasticSoilProfile + }; + + // Assert + Assert.AreEqual(expectedName, properties.Name); + Assert.AreEqual(expectedName, properties.ToString()); + CollectionAssert.AreEqual(soilProfile.Layers.Select(l => l.Top), properties.TopLevels); + Assert.AreEqual(soilProfile.Bottom, properties.Bottom); + Assert.AreEqual(stochasticSoilProfile.Probability*100, properties.Probability); + Assert.AreEqual("1D profiel", properties.Type); + } + } +} \ No newline at end of file Index: Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/Ringtoets.Piping.Forms.Test.csproj =================================================================== diff -u -rcaa64ef94fa8e30074f269de2fe0aad3c482c690 -r25d9f184b0a7bf99101d2ec0b1089ba2aeed9080 --- Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/Ringtoets.Piping.Forms.Test.csproj (.../Ringtoets.Piping.Forms.Test.csproj) (revision caa64ef94fa8e30074f269de2fe0aad3c482c690) +++ Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/Ringtoets.Piping.Forms.Test.csproj (.../Ringtoets.Piping.Forms.Test.csproj) (revision 25d9f184b0a7bf99101d2ec0b1089ba2aeed9080) @@ -65,6 +65,7 @@ + @@ -78,14 +79,14 @@ - + - + Fisheye: Tag 25d9f184b0a7bf99101d2ec0b1089ba2aeed9080 refers to a dead (removed) revision in file `Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/TreeNodeInfos/PipingSoilProfileTreeNodeInfoTest.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/TreeNodeInfos/StochasticSoilModelContextTreeNodeInfoTest.cs =================================================================== diff -u -r0c4e4faf0839d9ad90af4ff556357fc27c1f333a -r25d9f184b0a7bf99101d2ec0b1089ba2aeed9080 --- Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/TreeNodeInfos/StochasticSoilModelContextTreeNodeInfoTest.cs (.../StochasticSoilModelContextTreeNodeInfoTest.cs) (revision 0c4e4faf0839d9ad90af4ff556357fc27c1f333a) +++ Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/TreeNodeInfos/StochasticSoilModelContextTreeNodeInfoTest.cs (.../StochasticSoilModelContextTreeNodeInfoTest.cs) (revision 25d9f184b0a7bf99101d2ec0b1089ba2aeed9080) @@ -84,7 +84,7 @@ var text = info.Text(stochasticSoilModelContextMock); // Assert - Assert.AreEqual(Resources.PipingSoilProfilesCollection_DisplayName, text); + Assert.AreEqual(Resources.StochasticSoilProfileCollection_DisplayName, text); mocks.VerifyAll(); } @@ -148,11 +148,11 @@ public void ChildNodeObjects_Always_ReturnsChildsOnData() { // Setup - var pipingSoilProfile1 = new PipingSoilProfile("", 0, new List + var pipingSoilProfile1 = new PipingSoilProfile("pipingSoilProfile1", 0, new List { new PipingSoilLayer(10) }, 0); - var pipingSoilProfile2 = new PipingSoilProfile("", 0, new List + var pipingSoilProfile2 = new PipingSoilProfile("pipingSoilProfile2", 0, new List { new PipingSoilLayer(10) }, 0); @@ -182,8 +182,7 @@ // Assert CollectionAssert.AreEqual(new[] { - pipingSoilProfile1, - pipingSoilProfile2 + stochasticSoilModel }, objects); mocks.VerifyAll(); Index: Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/TreeNodeInfos/StochasticSoilProfileTreeNodeInfoTest.cs =================================================================== diff -u --- Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/TreeNodeInfos/StochasticSoilProfileTreeNodeInfoTest.cs (revision 0) +++ Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/TreeNodeInfos/StochasticSoilProfileTreeNodeInfoTest.cs (revision 25d9f184b0a7bf99101d2ec0b1089ba2aeed9080) @@ -0,0 +1,120 @@ +using System.Linq; +using Core.Common.Controls.TreeView; +using Core.Common.Gui; +using Core.Common.Gui.ContextMenu; +using Core.Common.TestUtil; +using NUnit.Framework; +using Rhino.Mocks; +using Ringtoets.Piping.Data; +using Ringtoets.Piping.Forms.Properties; +using Ringtoets.Piping.Plugin; +using Ringtoets.Piping.Primitives; + +namespace Ringtoets.Piping.Forms.Test.TreeNodeInfos +{ + [TestFixture] + public class StochasticSoilProfileTreeNodeInfoTest + { + private MockRepository mocks; + private PipingGuiPlugin plugin; + private TreeNodeInfo info; + + [SetUp] + public void SetUp() + { + mocks = new MockRepository(); + plugin = new PipingGuiPlugin(); + info = plugin.GetTreeNodeInfos().First(tni => tni.TagType == typeof(StochasticSoilProfile)); + } + + [Test] + public void Initialized_Always_ExpectedPropertiesSet() + { + // Assert + Assert.AreEqual(typeof(StochasticSoilProfile), info.TagType); + Assert.IsNull(info.ForeColor); + Assert.IsNull(info.EnsureVisibleOnCreate); + Assert.IsNull(info.ChildNodeObjects); + Assert.IsNull(info.CanRename); + Assert.IsNull(info.OnNodeRenamed); + Assert.IsNull(info.CanRemove); + Assert.IsNull(info.OnNodeRemoved); + Assert.IsNull(info.CanCheck); + Assert.IsNull(info.IsChecked); + Assert.IsNull(info.OnNodeChecked); + Assert.IsNull(info.CanDrag); + Assert.IsNull(info.CanDrop); + Assert.IsNull(info.CanInsert); + Assert.IsNull(info.OnDrop); + } + + [Test] + public void Text_Always_ReturnsName() + { + // Setup + var testName = "ttt"; + var pipingSoilLayer = mocks.StrictMock(10); + var pipingSoilProfile = mocks.StrictMock(testName, 0, new[] + { + pipingSoilLayer + }, 0); + var stochasticSoilProfile = mocks.StrictMock(10.0, SoilProfileType.SoilProfile1D, 1234L); + stochasticSoilProfile.SoilProfile = pipingSoilProfile; + mocks.ReplayAll(); + + // Call + var text = info.Text(stochasticSoilProfile); + + // Assert + Assert.AreEqual(testName, text); + + mocks.VerifyAll(); + } + + [Test] + public void Image_Always_ReturnsSetImage() + { + // Setup + var pipingSoilLayer = mocks.StrictMock(10); + var pipingSoilProfile = mocks.StrictMock("", 0, new[] + { + pipingSoilLayer + }, 0); + var stochasticSoilProfile = mocks.StrictMock(10.0, SoilProfileType.SoilProfile1D, 1234L); + stochasticSoilProfile.SoilProfile = pipingSoilProfile; + mocks.ReplayAll(); + + // Call + var image = info.Image(stochasticSoilProfile); + + // Assert + TestHelper.AssertImagesAreEqual(Resources.PipingSoilProfileIcon, image); + + mocks.VerifyAll(); + } + + [Test] + public void ContextMenuStrip_Always_CallsBuilder() + { + // Setup + var gui = mocks.StrictMultiMock(); + var treeViewControl = mocks.StrictMock(); + var menuBuilderMock = mocks.StrictMock(); + + gui.Expect(g => g.Get(null, treeViewControl)).Return(menuBuilderMock); + + menuBuilderMock.Expect(mb => mb.AddPropertiesItem()).Return(menuBuilderMock); + menuBuilderMock.Expect(mb => mb.Build()).Return(null); + + mocks.ReplayAll(); + + plugin.Gui = gui; + + // Call + info.ContextMenuStrip(null, null, treeViewControl); + + // Assert + mocks.VerifyAll(); + } + } +} \ No newline at end of file Index: Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/FileImporter/PipingSoilProfilesImporterTest.cs =================================================================== diff -u -r1ef390986aef1eb1b580ff23adb64f5582b9a35d -r25d9f184b0a7bf99101d2ec0b1089ba2aeed9080 --- Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/FileImporter/PipingSoilProfilesImporterTest.cs (.../PipingSoilProfilesImporterTest.cs) (revision 1ef390986aef1eb1b580ff23adb64f5582b9a35d) +++ Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/FileImporter/PipingSoilProfilesImporterTest.cs (.../PipingSoilProfilesImporterTest.cs) (revision 25d9f184b0a7bf99101d2ec0b1089ba2aeed9080) @@ -38,14 +38,14 @@ { // Prepare var expectedFileFilter = String.Format("{0} {1} (*.soil)|*.soil", - PipingFormsResources.PipingSoilProfilesCollection_DisplayName, ApplicationResources.Soil_file_name); + PipingFormsResources.StochasticSoilProfileCollection_DisplayName, ApplicationResources.Soil_file_name); // Call var importer = new PipingSoilProfilesImporter(); // Assert Assert.IsInstanceOf>(importer); - Assert.AreEqual(PipingFormsResources.PipingSoilProfilesCollection_DisplayName, importer.Name); + Assert.AreEqual(PipingFormsResources.StochasticSoilProfileCollection_DisplayName, importer.Name); Assert.AreEqual(RingtoetsFormsResources.Ringtoets_Category, importer.Category); Assert.AreEqual(16, importer.Image.Width); Assert.AreEqual(16, importer.Image.Height); Index: Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/PipingGuiPluginTest.cs =================================================================== diff -u -r2ee142712e588101a958207e041c3e9342e5a7fa -r25d9f184b0a7bf99101d2ec0b1089ba2aeed9080 --- Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/PipingGuiPluginTest.cs (.../PipingGuiPluginTest.cs) (revision 2ee142712e588101a958207e041c3e9342e5a7fa) +++ Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/PipingGuiPluginTest.cs (.../PipingGuiPluginTest.cs) (revision 25d9f184b0a7bf99101d2ec0b1089ba2aeed9080) @@ -66,7 +66,7 @@ PropertyInfo[] propertyInfos = guiPlugin.GetPropertyInfos().ToArray(); // assert - Assert.AreEqual(7, propertyInfos.Length); + Assert.AreEqual(8, propertyInfos.Length); var pipingFailureMechanismContextProperties = propertyInfos.Single(pi => pi.DataType == typeof(PipingFailureMechanismContext)); Assert.AreEqual(typeof(PipingFailureMechanismContextProperties), pipingFailureMechanismContextProperties.PropertyObjectType); @@ -104,12 +104,18 @@ Assert.IsNull(pipingSurfaceLineProperties.GetObjectPropertiesData); Assert.IsNull(pipingSurfaceLineProperties.AfterCreate); - var pipingSoilProfileProperties = propertyInfos.Single(pi => pi.DataType == typeof(PipingSoilProfile)); - Assert.AreEqual(typeof(PipingSoilProfileProperties), pipingSoilProfileProperties.PropertyObjectType); - Assert.IsNull(pipingSoilProfileProperties.AdditionalDataCheck); - Assert.IsNull(pipingSoilProfileProperties.GetObjectPropertiesData); - Assert.IsNull(pipingSoilProfileProperties.AfterCreate); + var stochasticSoilModelProperties = propertyInfos.Single(pi => pi.DataType == typeof(StochasticSoilModel)); + Assert.AreEqual(typeof(StochasticSoilModelProperties), stochasticSoilModelProperties.PropertyObjectType); + Assert.IsNull(stochasticSoilModelProperties.AdditionalDataCheck); + Assert.IsNull(stochasticSoilModelProperties.GetObjectPropertiesData); + Assert.IsNull(stochasticSoilModelProperties.AfterCreate); + var stochasticSoilProfileProperties = propertyInfos.Single(pi => pi.DataType == typeof(StochasticSoilProfile)); + Assert.AreEqual(typeof(StochasticSoilProfileProperties), stochasticSoilProfileProperties.PropertyObjectType); + Assert.IsNull(stochasticSoilProfileProperties.AdditionalDataCheck); + Assert.IsNull(stochasticSoilProfileProperties.GetObjectPropertiesData); + Assert.IsNull(stochasticSoilProfileProperties.AfterCreate); + mocks.VerifyAll(); } } @@ -137,11 +143,12 @@ TreeNodeInfo[] treeNodeInfos = guiPlugin.GetTreeNodeInfos().ToArray(); // assert - Assert.AreEqual(11, treeNodeInfos.Length); + Assert.AreEqual(12, treeNodeInfos.Length); Assert.IsTrue(treeNodeInfos.Any(tni => tni.TagType == typeof(RingtoetsPipingSurfaceLinesContext))); Assert.IsTrue(treeNodeInfos.Any(tni => tni.TagType == typeof(RingtoetsPipingSurfaceLine))); Assert.IsTrue(treeNodeInfos.Any(tni => tni.TagType == typeof(StochasticSoilModelContext))); - Assert.IsTrue(treeNodeInfos.Any(tni => tni.TagType == typeof(PipingSoilProfile))); + Assert.IsTrue(treeNodeInfos.Any(tni => tni.TagType == typeof(StochasticSoilModel))); + Assert.IsTrue(treeNodeInfos.Any(tni => tni.TagType == typeof(StochasticSoilProfile))); Assert.IsTrue(treeNodeInfos.Any(tni => tni.TagType == typeof(PipingCalculationContext))); Assert.IsTrue(treeNodeInfos.Any(tni => tni.TagType == typeof(PipingCalculationGroupContext))); Assert.IsTrue(treeNodeInfos.Any(tni => tni.TagType == typeof(PipingInputContext)));