Index: Application/Ringtoets/test/Application.Ringtoets.Storage.Test/IntegrationTests/StorageSqLiteIntegrationTest.cs =================================================================== diff -u -r66b07e7599319ea71ff109d8303f74a4a2e5f71c -rc290911dd4647e3115e239c8baf814717c098a5a --- Application/Ringtoets/test/Application.Ringtoets.Storage.Test/IntegrationTests/StorageSqLiteIntegrationTest.cs (.../StorageSqLiteIntegrationTest.cs) (revision 66b07e7599319ea71ff109d8303f74a4a2e5f71c) +++ Application/Ringtoets/test/Application.Ringtoets.Storage.Test/IntegrationTests/StorageSqLiteIntegrationTest.cs (.../StorageSqLiteIntegrationTest.cs) (revision c290911dd4647e3115e239c8baf814717c098a5a) @@ -535,8 +535,8 @@ CollectionAssert.AreEqual(expectedReferenceLine.Points, actualReferenceLine.Points); } - private static void AssertStochasticSoilModels(ObservableUniqueItemCollectionWithSourcePath expectedModels, - ObservableUniqueItemCollectionWithSourcePath actualModels) + private static void AssertStochasticSoilModels(StochasticSoilModelCollection expectedModels, + StochasticSoilModelCollection actualModels) { // Precondition: Assert.Less(0, actualModels.Count); @@ -605,8 +605,8 @@ } } - private static void AssertSurfaceLines(ObservableUniqueItemCollectionWithSourcePath expectedSurfaceLines, - ObservableUniqueItemCollectionWithSourcePath actualSurfaceLines) + private static void AssertSurfaceLines(RingtoetsPipingSurfaceLineCollection expectedSurfaceLines, + RingtoetsPipingSurfaceLineCollection actualSurfaceLines) { // Precondition: Assert.Greater(expectedSurfaceLines.Count, 0); Index: Core/Common/src/Core.Common.Base/ObservableUniqueItemCollectionWithSourcePath.cs =================================================================== diff -u -r66b07e7599319ea71ff109d8303f74a4a2e5f71c -rc290911dd4647e3115e239c8baf814717c098a5a --- Core/Common/src/Core.Common.Base/ObservableUniqueItemCollectionWithSourcePath.cs (.../ObservableUniqueItemCollectionWithSourcePath.cs) (revision 66b07e7599319ea71ff109d8303f74a4a2e5f71c) +++ Core/Common/src/Core.Common.Base/ObservableUniqueItemCollectionWithSourcePath.cs (.../ObservableUniqueItemCollectionWithSourcePath.cs) (revision c290911dd4647e3115e239c8baf814717c098a5a) @@ -32,12 +32,45 @@ /// they were imported from. /// /// The type of elements in the collection. - public class ObservableUniqueItemCollectionWithSourcePath : Observable, IEnumerable + /// The unique feature on which the items are validated on. + public class ObservableUniqueItemCollectionWithSourcePath : Observable, IEnumerable where TObject : class + where TFeature : class { private readonly List collection = new List(); + private readonly Func getUniqueFeature; + private readonly string typeDescriptor; + private readonly string featureDescription; /// + /// Instantiates a + /// + /// A function to retrieve the unique feature of the items it stores. + /// The description of the item that is validated. + /// The description of the feature of the item to be validated on. + public ObservableUniqueItemCollectionWithSourcePath(Func getUniqueFeature, + string typeDescriptor, + string featureDescription) + { + if (getUniqueFeature == null) + { + throw new ArgumentNullException(nameof(getUniqueFeature)); + } + if (typeDescriptor == null) + { + throw new ArgumentNullException(nameof(typeDescriptor)); + } + if (featureDescription == null) + { + throw new ArgumentNullException(nameof(featureDescription)); + } + + this.getUniqueFeature = getUniqueFeature; + this.typeDescriptor = typeDescriptor; + this.featureDescription = featureDescription; + } + + /// /// Gets the element at index in the collection. /// /// The index. @@ -128,6 +161,16 @@ collection.AddRange(items); } + public IEnumerator GetEnumerator() + { + return collection.GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + private void InternalValidateItems(IEnumerable items) { if (items.Contains(null)) @@ -142,47 +185,37 @@ /// /// The items to validate. /// Throw an exception when validation fails. - protected virtual void ValidateItems(IEnumerable items) {} + private void ValidateItems(IEnumerable items) + { + ValidateListOnDuplicateFeature(items, getUniqueFeature, typeDescriptor, featureDescription); + } /// /// Validates the items of an based on their names. /// - /// The feautre that needs to be validated on. + /// The feautre that needs to be validated on. /// The collection that needs to be validated. /// The feature of the items contained by the collection /// that needs to be validated on. /// The description of the item which was validated. /// The description of the feature which was validated on. /// Thrown when any parameters are null. /// Thrown when a duplicate item was found. - protected void ValidateListOnDuplicateFeature(IEnumerable items, - Func getUniqueFeature, - string typeDescriptor, - string featureDescription) + private static void ValidateListOnDuplicateFeature(IEnumerable items, + Func getUniqueFeature, + string typeDescriptor, + string featureDescription) { - IEnumerable> duplicateItems = + IEnumerable> duplicateItems = items.GroupBy(getUniqueFeature) .Where(group => group.Count() > 1); if (duplicateItems.Any()) { var duplicateFeatures = string.Join(", ", duplicateItems.Select(group => group.First())); - string exceptionMessage = string.Format("{0} moeten een unieke {1} hebben. Gevonden dubbele elementen: {2}.", - typeDescriptor, - featureDescription, - duplicateFeatures); + string exceptionMessage = $"{typeDescriptor} moeten een unieke {featureDescription} hebben. Gevonden dubbele elementen: {duplicateFeatures}."; throw new ArgumentException(exceptionMessage); } } - - public IEnumerator GetEnumerator() - { - return collection.GetEnumerator(); - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetEnumerator(); - } } } \ No newline at end of file Index: Core/Common/test/Core.Common.Base.Test/ObservableUniqueItemCollectionWithSourcePathTest.cs =================================================================== diff -u -r66b07e7599319ea71ff109d8303f74a4a2e5f71c -rc290911dd4647e3115e239c8baf814717c098a5a --- Core/Common/test/Core.Common.Base.Test/ObservableUniqueItemCollectionWithSourcePathTest.cs (.../ObservableUniqueItemCollectionWithSourcePathTest.cs) (revision 66b07e7599319ea71ff109d8303f74a4a2e5f71c) +++ Core/Common/test/Core.Common.Base.Test/ObservableUniqueItemCollectionWithSourcePathTest.cs (.../ObservableUniqueItemCollectionWithSourcePathTest.cs) (revision c290911dd4647e3115e239c8baf814717c098a5a) @@ -30,13 +30,54 @@ [TestFixture] public class ObservableUniqueItemCollectionWithSourcePathTest { + private readonly Func getUniqueFeature = (item => item.Name); + private const string typeDescriptor = "TestItems"; + private const string featureDescription = "Feature"; + [Test] - public void DefaultConstructor_ReturnObservableCollectionWithSourcePath() + public void DefaultConstructor_getUniqueFeatureNull_ThrowsArgumentNullException() { // Call - var collection = new ObservableUniqueItemCollectionWithSourcePath(); + TestDelegate call = () => new ObservableUniqueItemCollectionWithSourcePath( + null, string.Empty, string.Empty); // Assert + string paramName = Assert.Throws(call).ParamName; + Assert.AreEqual("getUniqueFeature", paramName); + } + + [Test] + public void DefaultConstructor_TypeDescriptionNull_ThrowsArgumentNullException() + { + // Call + TestDelegate call = () => new ObservableUniqueItemCollectionWithSourcePath( + getUniqueFeature, null, string.Empty); + + // Assert + string paramName = Assert.Throws(call).ParamName; + Assert.AreEqual("typeDescriptor", paramName); + } + + [Test] + public void DefaultConstructor_FeatureDescriptionNull_ThrowsArgumentNullException() + { + // Call + TestDelegate call = () => new ObservableUniqueItemCollectionWithSourcePath( + getUniqueFeature, string.Empty, null); + + // Assert + string paramName = Assert.Throws(call).ParamName; + Assert.AreEqual("featureDescription", paramName); + } + + [Test] + public void DefaultConstructor_ReturnObservableUniqueItemCollectionWithSourcePath() + { + // Call + var collection = new ObservableUniqueItemCollectionWithSourcePath( + getUniqueFeature, typeDescriptor, featureDescription); + + // Assert Assert.IsInstanceOf(collection); Assert.IsNull(collection.SourcePath); Assert.AreEqual(0, collection.Count); @@ -47,7 +88,8 @@ public void AddRange_ItemsNull_ThrowArgumentNullException() { // Setup - var collection = new ObservableUniqueItemCollectionWithSourcePath(); + var collection = new ObservableUniqueItemCollectionWithSourcePath( + getUniqueFeature, typeDescriptor, featureDescription); // Call TestDelegate call = () => collection.AddRange(null, "path"); @@ -61,12 +103,13 @@ public void AddRange_ItemsHasNullElement_ThrowArgumentException() { // Setup - var collection = new ObservableUniqueItemCollectionWithSourcePath(); + var collection = new ObservableUniqueItemCollectionWithSourcePath( + getUniqueFeature, typeDescriptor, featureDescription); var items = new[] { - new object(), + new TestItem("Item A"), null, - new object() + new TestItem("Item B") }; // Call @@ -82,10 +125,11 @@ public void AddRange_FilePathNull_ThrowArgumentNullException() { // Setup - var collection = new ObservableUniqueItemCollectionWithSourcePath(); + var collection = new ObservableUniqueItemCollectionWithSourcePath( + getUniqueFeature, typeDescriptor, featureDescription); // Call - TestDelegate call = () => collection.AddRange(Enumerable.Empty(), null); + TestDelegate call = () => collection.AddRange(Enumerable.Empty(), null); // Assert string paramName = Assert.Throws(call).ParamName; @@ -96,12 +140,13 @@ public void AddRange_NotAnActualFilePath_ThrowArgumentNull() { // Setup - var collection = new ObservableUniqueItemCollectionWithSourcePath(); + var collection = new ObservableUniqueItemCollectionWithSourcePath( + getUniqueFeature, typeDescriptor, featureDescription); const string invalidFilePath = @" "; // Call - TestDelegate call = () => collection.AddRange(Enumerable.Empty(), invalidFilePath); + TestDelegate call = () => collection.AddRange(Enumerable.Empty(), invalidFilePath); // Assert string message = $"'{invalidFilePath}' is not a valid filepath."; @@ -113,8 +158,9 @@ public void AddRange_AddNewItem_CollectionContainsItem() { // Setup - var collection = new ObservableUniqueItemCollectionWithSourcePath(); - var item = new object(); + var collection = new ObservableUniqueItemCollectionWithSourcePath( + getUniqueFeature, typeDescriptor, featureDescription); + var item = new TestItem("Item A"); // Call const string filePath = "some/file/path"; @@ -132,13 +178,14 @@ public void AddRange_AddingNewItems_CollectionContainsExpectedElements() { // Setup - var collection = new ObservableUniqueItemCollectionWithSourcePath(); + var collection = new ObservableUniqueItemCollectionWithSourcePath( + getUniqueFeature, typeDescriptor, featureDescription); var expectedCollection = new[] { - new object(), - new object(), - new object(), - new object() + new TestItem("Item A"), + new TestItem("Item B"), + new TestItem("Item C"), + new TestItem("Item D") }; const string filePath = "some/file/path"; @@ -152,16 +199,66 @@ } [Test] + public void AddRange_AddDuplicateItems_ThrowsArgumentException() + { + // Setup + const string duplicateNameOne = "Duplicate name it is"; + + var itemsToAdd = new[] + { + new TestItem(duplicateNameOne), + new TestItem(duplicateNameOne) + }; + + var collection = new ObservableUniqueItemCollectionWithSourcePath( + getUniqueFeature, typeDescriptor, featureDescription); + + // Call + TestDelegate call = () => collection.AddRange(itemsToAdd, "some/path"); + + // Assert + string message = $"{typeDescriptor} moeten een unieke {featureDescription} hebben. Gevonden dubbele elementen: {duplicateNameOne}."; + TestHelper.AssertThrowsArgumentExceptionAndTestMessage(call, message); + } + + [Test] + public void AddRange_AddMultipleDuplicateItems_ThrowsArgumentException() + { + // Setup + const string duplicateNameOne = "Duplicate name it is"; + const string duplicateNameTwo = "Duplicate name again"; + + var itemsToAdd = new[] + { + new TestItem(duplicateNameOne), + new TestItem(duplicateNameOne), + new TestItem(duplicateNameTwo), + new TestItem(duplicateNameTwo) + }; + + var collection = new ObservableUniqueItemCollectionWithSourcePath( + getUniqueFeature, typeDescriptor, featureDescription); + + // Call + TestDelegate call = () => collection.AddRange(itemsToAdd, "some/path"); + + // Assert + string message = $"{typeDescriptor} moeten een unieke {featureDescription} hebben. Gevonden dubbele elementen: {duplicateNameOne}, {duplicateNameTwo}."; + TestHelper.AssertThrowsArgumentExceptionAndTestMessage(call, message); + } + + [Test] public void Count_CollectionFilledWithElements_ReturnsExpectedNumberOfElements() { // Setup - var collection = new ObservableUniqueItemCollectionWithSourcePath(); + var collection = new ObservableUniqueItemCollectionWithSourcePath( + getUniqueFeature, typeDescriptor, featureDescription); collection.AddRange(new[] { - new object(), - new object(), - new object(), - new object() + new TestItem("Item A"), + new TestItem("Item B"), + new TestItem("Item C"), + new TestItem("Item D") }, "path"); // Call @@ -177,7 +274,8 @@ public void Indexer_GetItemAtIndexOutOfRange_ThrowsArgumentOutOfRangeException(int invalidIndex) { // Setup - var collection = new ObservableUniqueItemCollectionWithSourcePath(); + var collection = new ObservableUniqueItemCollectionWithSourcePath( + getUniqueFeature, typeDescriptor, featureDescription); // Call TestDelegate call = () => @@ -193,14 +291,15 @@ public void Indexer_GetElementAtIndex_ReturnsExpectedElement() { // Setup - var elementToRetrieve = new object(); - var collection = new ObservableUniqueItemCollectionWithSourcePath(); + var elementToRetrieve = new TestItem("Item X"); + var collection = new ObservableUniqueItemCollectionWithSourcePath( + getUniqueFeature, typeDescriptor, featureDescription); collection.AddRange(new[] { - new object(), - new object(), - new object(), - new object(), + new TestItem("Item A"), + new TestItem("Item B"), + new TestItem("Item C"), + new TestItem("Item D"), elementToRetrieve }, "path"); @@ -215,15 +314,16 @@ public void Remove_ElementNotInList_ReturnsFalse() { // Setup - var element = new object(); + var element = new TestItem("Item X"); - var collection = new ObservableUniqueItemCollectionWithSourcePath(); + var collection = new ObservableUniqueItemCollectionWithSourcePath( + getUniqueFeature, typeDescriptor, featureDescription); var expectedCollection = new[] { - new object(), - new object(), - new object(), - new object() + new TestItem("Item A"), + new TestItem("Item B"), + new TestItem("Item C"), + new TestItem("Item D") }; collection.AddRange(expectedCollection, "path"); @@ -240,15 +340,16 @@ public void Remove_ElementInCollection_ReturnsTrue() { // Setup - var elementToBeRemoved = new object(); + var elementToBeRemoved = new TestItem("Item X"); - var collection = new ObservableUniqueItemCollectionWithSourcePath(); + var collection = new ObservableUniqueItemCollectionWithSourcePath( + getUniqueFeature, typeDescriptor, featureDescription); var expectedCollections = new[] { - new object(), - new object(), - new object(), - new object() + new TestItem("Item A"), + new TestItem("Item B"), + new TestItem("Item C"), + new TestItem("Item D") }; collection.AddRange(expectedCollections.Concat(new[] @@ -265,41 +366,12 @@ } [Test] - public void Remove_ElementToRemoveMultiplesInCollection_ReturnsTrueAndRemovesFirstOccurence() - { - // Setup - var elementToBeRemoved = new object(); - - var collection = new ObservableUniqueItemCollectionWithSourcePath(); - var removeElementCollection = new[] - { - elementToBeRemoved - }; - var expectedCollection = new[] - { - new object(), - new object(), - new object(), - new object(), - elementToBeRemoved - }; - - collection.AddRange(removeElementCollection.Concat(expectedCollection), "path"); - - // Call - bool removeSuccessful = collection.Remove(elementToBeRemoved); - - // Assert - Assert.IsTrue(removeSuccessful); - CollectionAssert.AreEqual(expectedCollection, collection); - } - - [Test] public void Remove_RemoveLastElement_ReturnsTrueAndClearSourcePath() { // Setup - var elementToBeRemoved = new object(); - var collection = new ObservableUniqueItemCollectionWithSourcePath(); + var elementToBeRemoved = new TestItem("Item X"); + var collection = new ObservableUniqueItemCollectionWithSourcePath( + getUniqueFeature, typeDescriptor, featureDescription); collection.AddRange(new[] { elementToBeRemoved @@ -320,13 +392,14 @@ public void Clear_CollectionFullyDefined_ClearsSourcePathAndCollection() { // Setup - var collection = new ObservableUniqueItemCollectionWithSourcePath(); + var collection = new ObservableUniqueItemCollectionWithSourcePath( + getUniqueFeature, typeDescriptor, featureDescription); var expectedObjectCollection = new[] { - new object(), - new object(), - new object(), - new object() + new TestItem("Item A"), + new TestItem("Item B"), + new TestItem("Item C"), + new TestItem("Item D") }; collection.AddRange(expectedObjectCollection, "path"); @@ -349,7 +422,8 @@ observer.Expect(o => o.UpdateObserver()); // Expect to be called once mocks.ReplayAll(); - var observableCollection = new ObservableUniqueItemCollectionWithSourcePath(); + var observableCollection = new ObservableUniqueItemCollectionWithSourcePath( + getUniqueFeature, typeDescriptor, featureDescription); observableCollection.Attach(observer); // Call @@ -367,7 +441,8 @@ var observer = mocks.StrictMock(); mocks.ReplayAll(); - var observableCollection = new ObservableUniqueItemCollectionWithSourcePath(); + var observableCollection = new ObservableUniqueItemCollectionWithSourcePath( + getUniqueFeature, typeDescriptor, featureDescription); observableCollection.Attach(observer); observableCollection.Detach(observer); @@ -383,7 +458,8 @@ { // Setup var mocks = new MockRepository(); - var observableCollection = new ObservableUniqueItemCollectionWithSourcePath(); + var observableCollection = new ObservableUniqueItemCollectionWithSourcePath( + getUniqueFeature, typeDescriptor, featureDescription); var observer1 = mocks.Stub(); var observer2 = mocks.Stub(); @@ -413,5 +489,20 @@ // Assert mocks.VerifyAll(); } + + private class TestItem + { + public string Name { get; } + + public TestItem(string name) + { + Name = name; + } + + public override string ToString() + { + return Name; + } + } } } \ No newline at end of file Index: Ringtoets/Piping/src/Ringtoets.Piping.Data/Properties/Resources.Designer.cs =================================================================== diff -u -r320fc1268c48766797d895a8f4ace546f35bf64c -rc290911dd4647e3115e239c8baf814717c098a5a --- Ringtoets/Piping/src/Ringtoets.Piping.Data/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 320fc1268c48766797d895a8f4ace546f35bf64c) +++ Ringtoets/Piping/src/Ringtoets.Piping.Data/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision c290911dd4647e3115e239c8baf814717c098a5a) @@ -190,6 +190,15 @@ } /// + /// Looks up a localized string similar to Profielschematisaties. + /// + public static string RingtoetsPipingSurfaceLineCollection_TypeDescriptor { + get { + return ResourceManager.GetString("PipingSurfaceLineCollection_TypeDescriptor", resourceCulture); + } + } + + /// /// Looks up a localized string similar to De geometrie bevat geen punt op locatie {0} om als '{1}' in te stellen.. /// public static string RingtoetsPipingSurfaceLine_SetCharacteristicPointAt_Geometry_does_not_contain_point_at_0_to_assign_as_characteristic_point_1_ { @@ -210,12 +219,30 @@ } /// + /// Looks up a localized string similar to Stochastische ondergrondmodellen. + /// + public static string StochasticSoilModelCollection_TypeDescriptor { + get { + return ResourceManager.GetString("StochasticSoilModelCollection_TypeDescriptor", resourceCulture); + } + } + + /// /// Looks up a localized string similar to Het aandeel van de ondergrondschematisatie in het stochastische ondergrondmodel moet in het bereik {0} liggen.. /// public static string StochasticSoilProfile_Probability_Should_be_in_range_0_ { get { return ResourceManager.GetString("StochasticSoilProfile_Probability_Should_be_in_range_0_", resourceCulture); } } + + /// + /// Looks up a localized string similar to naam. + /// + public static string UniqueFeature_Name_FeatureDescription { + get { + return ResourceManager.GetString("UniqueFeature_Name_FeatureDescription", resourceCulture); + } + } } } Index: Ringtoets/Piping/src/Ringtoets.Piping.Data/Properties/Resources.resx =================================================================== diff -u -r320fc1268c48766797d895a8f4ace546f35bf64c -rc290911dd4647e3115e239c8baf814717c098a5a --- Ringtoets/Piping/src/Ringtoets.Piping.Data/Properties/Resources.resx (.../Resources.resx) (revision 320fc1268c48766797d895a8f4ace546f35bf64c) +++ Ringtoets/Piping/src/Ringtoets.Piping.Data/Properties/Resources.resx (.../Resources.resx) (revision c290911dd4647e3115e239c8baf814717c098a5a) @@ -162,4 +162,13 @@ Het aandeel van de ondergrondschematisatie in het stochastische ondergrondmodel moet in het bereik {0} liggen. + + Profielschematisaties + + + Stochastische ondergrondmodellen + + + naam + \ No newline at end of file Index: Ringtoets/Piping/src/Ringtoets.Piping.Data/RingtoetsPipingSurfaceLineCollection.cs =================================================================== diff -u -r66b07e7599319ea71ff109d8303f74a4a2e5f71c -rc290911dd4647e3115e239c8baf814717c098a5a --- Ringtoets/Piping/src/Ringtoets.Piping.Data/RingtoetsPipingSurfaceLineCollection.cs (.../RingtoetsPipingSurfaceLineCollection.cs) (revision 66b07e7599319ea71ff109d8303f74a4a2e5f71c) +++ Ringtoets/Piping/src/Ringtoets.Piping.Data/RingtoetsPipingSurfaceLineCollection.cs (.../RingtoetsPipingSurfaceLineCollection.cs) (revision c290911dd4647e3115e239c8baf814717c098a5a) @@ -19,20 +19,19 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. -using System.Collections.Generic; using Core.Common.Base; using Ringtoets.Piping.Primitives; +using Ringtoets.Piping.Data.Properties; namespace Ringtoets.Piping.Data { /// /// Collection to store . /// - public class RingtoetsPipingSurfaceLineCollection : ObservableUniqueItemCollectionWithSourcePath + public class RingtoetsPipingSurfaceLineCollection : ObservableUniqueItemCollectionWithSourcePath { - protected override void ValidateItems(IEnumerable items) - { - ValidateListOnDuplicateFeature(items, line => line.Name, "Profielschematisaties", "naam"); - } + public RingtoetsPipingSurfaceLineCollection() : base(line => line.Name, + Resources.RingtoetsPipingSurfaceLineCollection_TypeDescriptor, + Resources.UniqueFeature_Name_FeatureDescription) {} } } \ No newline at end of file Index: Ringtoets/Piping/src/Ringtoets.Piping.Data/StochasticSoilModelCollection.cs =================================================================== diff -u -r66b07e7599319ea71ff109d8303f74a4a2e5f71c -rc290911dd4647e3115e239c8baf814717c098a5a --- Ringtoets/Piping/src/Ringtoets.Piping.Data/StochasticSoilModelCollection.cs (.../StochasticSoilModelCollection.cs) (revision 66b07e7599319ea71ff109d8303f74a4a2e5f71c) +++ Ringtoets/Piping/src/Ringtoets.Piping.Data/StochasticSoilModelCollection.cs (.../StochasticSoilModelCollection.cs) (revision c290911dd4647e3115e239c8baf814717c098a5a) @@ -19,19 +19,18 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. -using System.Collections.Generic; using Core.Common.Base; +using Ringtoets.Piping.Data.Properties; namespace Ringtoets.Piping.Data { /// /// A collection of . /// - public class StochasticSoilModelCollection : ObservableUniqueItemCollectionWithSourcePath + public class StochasticSoilModelCollection : ObservableUniqueItemCollectionWithSourcePath { - protected override void ValidateItems(IEnumerable items) - { - ValidateListOnDuplicateFeature(items, model => model.Name, "Ondergrondmodellen", "naam"); - } + public StochasticSoilModelCollection() : base(model => model.Name, + Resources.StochasticSoilModelCollection_TypeDescriptor, + Resources.UniqueFeature_Name_FeatureDescription) {} } } \ No newline at end of file Index: Ringtoets/Piping/src/Ringtoets.Piping.Forms/Properties/Resources.Designer.cs =================================================================== diff -u -r922e186b7941457f71de9b4909fa2490f36a1c63 -rc290911dd4647e3115e239c8baf814717c098a5a --- Ringtoets/Piping/src/Ringtoets.Piping.Forms/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 922e186b7941457f71de9b4909fa2490f36a1c63) +++ Ringtoets/Piping/src/Ringtoets.Piping.Forms/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision c290911dd4647e3115e239c8baf814717c098a5a) @@ -1303,15 +1303,6 @@ } /// - /// Looks up a localized string similar to Profielschematisaties. - /// - public static string PipingSurfaceLinesCollection_DisplayName { - get { - return ResourceManager.GetString("PipingSurfaceLinesCollection_DisplayName", resourceCulture); - } - } - - /// /// Looks up a localized string similar to Selecteer profielschematisaties. /// public static string PipingSurfaceLineSelectionDialog_Select_SurfaceLines { @@ -1573,15 +1564,6 @@ } /// - /// Looks up a localized string similar to Stochastische ondergrondmodellen. - /// - public static string StochasticSoilModelCollection_DisplayName { - get { - return ResourceManager.GetString("StochasticSoilModelCollection_DisplayName", resourceCulture); - } - } - - /// /// Looks up a localized string similar to De locatie van het bestand waaruit de stochastische ondergrondmodellen zijn geïmporteerd.. /// public static string StochasticSoilModelCollection_SourcePath_Description { Index: Ringtoets/Piping/src/Ringtoets.Piping.Forms/Properties/Resources.resx =================================================================== diff -u -r922e186b7941457f71de9b4909fa2490f36a1c63 -rc290911dd4647e3115e239c8baf814717c098a5a --- Ringtoets/Piping/src/Ringtoets.Piping.Forms/Properties/Resources.resx (.../Resources.resx) (revision 922e186b7941457f71de9b4909fa2490f36a1c63) +++ Ringtoets/Piping/src/Ringtoets.Piping.Forms/Properties/Resources.resx (.../Resources.resx) (revision c290911dd4647e3115e239c8baf814717c098a5a) @@ -243,9 +243,6 @@ Veiligheidsfactor [-] - - Profielschematisaties - ..\Resources\u48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a @@ -556,9 +553,6 @@ Aandeel van schematisatie in het stochastische ondergrondmodel [%] - - Stochastische ondergrondmodellen - Kans op heave [1/jaar] Index: Ringtoets/Piping/src/Ringtoets.Piping.Forms/PropertyClasses/RingtoetsPipingSurfaceLineCollectionProperties.cs =================================================================== diff -u -r66b07e7599319ea71ff109d8303f74a4a2e5f71c -rc290911dd4647e3115e239c8baf814717c098a5a --- Ringtoets/Piping/src/Ringtoets.Piping.Forms/PropertyClasses/RingtoetsPipingSurfaceLineCollectionProperties.cs (.../RingtoetsPipingSurfaceLineCollectionProperties.cs) (revision 66b07e7599319ea71ff109d8303f74a4a2e5f71c) +++ Ringtoets/Piping/src/Ringtoets.Piping.Forms/PropertyClasses/RingtoetsPipingSurfaceLineCollectionProperties.cs (.../RingtoetsPipingSurfaceLineCollectionProperties.cs) (revision c290911dd4647e3115e239c8baf814717c098a5a) @@ -20,27 +20,26 @@ // All rights reserved. using System; -using Core.Common.Base; using Core.Common.Gui.PropertyBag; using Core.Common.Utils.Attributes; -using Ringtoets.Piping.Primitives; +using Ringtoets.Piping.Data; using Ringtoets.Piping.Forms.Properties; using RingtoetsCommonFormsResources = Ringtoets.Common.Forms.Properties.Resources; namespace Ringtoets.Piping.Forms.PropertyClasses { /// - /// ViewModel of of for properties panel. + /// ViewModel of for properties panel. /// - public class RingtoetsPipingSurfaceLineCollectionProperties : ObjectProperties> + public class RingtoetsPipingSurfaceLineCollectionProperties : ObjectProperties { /// /// Creates a new instance of . /// /// The collection for which the properties are shown. /// Thrown when /// is null. - public RingtoetsPipingSurfaceLineCollectionProperties(ObservableUniqueItemCollectionWithSourcePath collection) + public RingtoetsPipingSurfaceLineCollectionProperties(RingtoetsPipingSurfaceLineCollection collection) { if (collection == null) { Index: Ringtoets/Piping/src/Ringtoets.Piping.Forms/PropertyClasses/StochasticSoilModelCollectionProperties.cs =================================================================== diff -u -r66b07e7599319ea71ff109d8303f74a4a2e5f71c -rc290911dd4647e3115e239c8baf814717c098a5a --- Ringtoets/Piping/src/Ringtoets.Piping.Forms/PropertyClasses/StochasticSoilModelCollectionProperties.cs (.../StochasticSoilModelCollectionProperties.cs) (revision 66b07e7599319ea71ff109d8303f74a4a2e5f71c) +++ Ringtoets/Piping/src/Ringtoets.Piping.Forms/PropertyClasses/StochasticSoilModelCollectionProperties.cs (.../StochasticSoilModelCollectionProperties.cs) (revision c290911dd4647e3115e239c8baf814717c098a5a) @@ -20,7 +20,6 @@ // All rights reserved. using System; -using Core.Common.Base; using Core.Common.Gui.PropertyBag; using Core.Common.Utils.Attributes; using Ringtoets.Piping.Data; @@ -30,17 +29,17 @@ namespace Ringtoets.Piping.Forms.PropertyClasses { /// - /// ViewModel of of for properties panel. + /// ViewModel of for properties panel. /// - public class StochasticSoilModelCollectionProperties : ObjectProperties> + public class StochasticSoilModelCollectionProperties : ObjectProperties { /// /// Creates a new instance of . /// /// The collection for which the properties are shown. /// Thrown when /// is null. - public StochasticSoilModelCollectionProperties(ObservableUniqueItemCollectionWithSourcePath collection) + public StochasticSoilModelCollectionProperties(StochasticSoilModelCollection collection) { if (collection == null) { Index: Ringtoets/Piping/src/Ringtoets.Piping.Forms/Views/PipingFailureMechanismView.cs =================================================================== diff -u -r66b07e7599319ea71ff109d8303f74a4a2e5f71c -rc290911dd4647e3115e239c8baf814717c098a5a --- Ringtoets/Piping/src/Ringtoets.Piping.Forms/Views/PipingFailureMechanismView.cs (.../PipingFailureMechanismView.cs) (revision 66b07e7599319ea71ff109d8303f74a4a2e5f71c) +++ Ringtoets/Piping/src/Ringtoets.Piping.Forms/Views/PipingFailureMechanismView.cs (.../PipingFailureMechanismView.cs) (revision c290911dd4647e3115e239c8baf814717c098a5a) @@ -32,7 +32,6 @@ using Ringtoets.Common.Forms.Views; using Ringtoets.Piping.Data; using Ringtoets.Piping.Forms.PresentationObjects; -using Ringtoets.Piping.Primitives; using PipingDataResources = Ringtoets.Piping.Data.Properties.Resources; namespace Ringtoets.Piping.Forms.Views @@ -197,8 +196,8 @@ { ReferenceLine referenceLine = data.Parent.ReferenceLine; IEnumerable failureMechanismSections = data.WrappedData.Sections; - ObservableUniqueItemCollectionWithSourcePath stochasticSoilModels = data.WrappedData.StochasticSoilModels; - ObservableUniqueItemCollectionWithSourcePath ringtoetsPipingSurfaceLines = data.WrappedData.SurfaceLines; + StochasticSoilModelCollection stochasticSoilModels = data.WrappedData.StochasticSoilModels; + RingtoetsPipingSurfaceLineCollection ringtoetsPipingSurfaceLines = data.WrappedData.SurfaceLines; HydraulicBoundaryDatabase hydraulicBoundaryDatabase = data.Parent.HydraulicBoundaryDatabase; IEnumerable calculations = data.WrappedData.CalculationsGroup.GetCalculations().Cast(); Index: Ringtoets/Piping/src/Ringtoets.Piping.Forms/Views/PipingMapDataFactory.cs =================================================================== diff -u -r4838f004647741cf5409023313b884bd0a610c16 -rc290911dd4647e3115e239c8baf814717c098a5a --- Ringtoets/Piping/src/Ringtoets.Piping.Forms/Views/PipingMapDataFactory.cs (.../PipingMapDataFactory.cs) (revision 4838f004647741cf5409023313b884bd0a610c16) +++ Ringtoets/Piping/src/Ringtoets.Piping.Forms/Views/PipingMapDataFactory.cs (.../PipingMapDataFactory.cs) (revision c290911dd4647e3115e239c8baf814717c098a5a) @@ -24,8 +24,8 @@ using Core.Components.Gis.Data; using Core.Components.Gis.Style; using Ringtoets.Piping.Data; -using Ringtoets.Piping.Forms.Properties; using Ringtoets.Piping.Primitives; +using PipingDataResources = Ringtoets.Piping.Data.Properties.Resources; using RingtoetsCommonFormsResources = Ringtoets.Common.Forms.Properties.Resources; namespace Ringtoets.Piping.Forms.Views @@ -41,7 +41,7 @@ /// The created . public static MapLineData CreateSurfaceLinesMapData() { - return new MapLineData(Resources.PipingSurfaceLinesCollection_DisplayName) + return new MapLineData(PipingDataResources.RingtoetsPipingSurfaceLineCollection_TypeDescriptor) { Style = new LineStyle(Color.DarkSeaGreen, 2, DashStyle.Solid), SelectedMetaDataAttribute = RingtoetsCommonFormsResources.MetaData_Name @@ -54,7 +54,7 @@ /// The created . public static MapLineData CreateStochasticSoilModelsMapData() { - return new MapLineData(Resources.StochasticSoilModelCollection_DisplayName) + return new MapLineData(PipingDataResources.StochasticSoilModelCollection_TypeDescriptor) { Style = new LineStyle(Color.FromArgb(70, Color.SaddleBrown), 5, DashStyle.Solid), SelectedMetaDataAttribute = RingtoetsCommonFormsResources.MetaData_Name Index: Ringtoets/Piping/src/Ringtoets.Piping.Plugin/PipingPlugin.cs =================================================================== diff -u -r8eb717ca45b6518cccfef85e481e0da52ce1df4e -rc290911dd4647e3115e239c8baf814717c098a5a --- Ringtoets/Piping/src/Ringtoets.Piping.Plugin/PipingPlugin.cs (.../PipingPlugin.cs) (revision 8eb717ca45b6518cccfef85e481e0da52ce1df4e) +++ Ringtoets/Piping/src/Ringtoets.Piping.Plugin/PipingPlugin.cs (.../PipingPlugin.cs) (revision c290911dd4647e3115e239c8baf814717c098a5a) @@ -51,6 +51,7 @@ using Ringtoets.Piping.Service; using RingtoetsCommonFormsResources = Ringtoets.Common.Forms.Properties.Resources; using RingtoetsCommonDataResources = Ringtoets.Common.Data.Properties.Resources; +using PipingDataResources = Ringtoets.Piping.Data.Properties.Resources; using PipingFormsResources = Ringtoets.Piping.Forms.Properties.Resources; namespace Ringtoets.Piping.Plugin @@ -96,7 +97,7 @@ { yield return new ImportInfo { - Name = PipingFormsResources.PipingSurfaceLinesCollection_DisplayName, + Name = PipingDataResources.RingtoetsPipingSurfaceLineCollection_TypeDescriptor, Category = RingtoetsCommonFormsResources.Ringtoets_Category, Image = PipingFormsResources.PipingSurfaceLineIcon, FileFilter = RingtoetsPipingSurfaceLineFileFilter, @@ -106,7 +107,7 @@ yield return new ImportInfo { - Name = PipingFormsResources.StochasticSoilModelCollection_DisplayName, + Name = PipingDataResources.StochasticSoilModelCollection_TypeDescriptor, Category = RingtoetsCommonFormsResources.Ringtoets_Category, Image = PipingFormsResources.PipingSoilProfileIcon, FileFilter = StochasticSoilModelFileFilter, @@ -134,7 +135,7 @@ { yield return new UpdateInfo { - Name = PipingFormsResources.PipingSurfaceLinesCollection_DisplayName, + Name = PipingDataResources.RingtoetsPipingSurfaceLineCollection_TypeDescriptor, Category = RingtoetsCommonFormsResources.Ringtoets_Category, Image = PipingFormsResources.PipingSurfaceLineIcon, FileFilter = RingtoetsPipingSurfaceLineFileFilter, @@ -144,7 +145,7 @@ yield return new UpdateInfo { - Name = PipingFormsResources.StochasticSoilModelCollection_DisplayName, + Name = PipingDataResources.StochasticSoilModelCollection_TypeDescriptor, Category = RingtoetsCommonFormsResources.Ringtoets_Category, Image = PipingFormsResources.PipingSoilProfileIcon, FileFilter = StochasticSoilModelFileFilter, @@ -155,32 +156,6 @@ }; } - private static StochasticSoilModelImporter StochasticSoilModelImporter(StochasticSoilModelCollectionContext context, string filePath, IStochasticSoilModelUpdateModelStrategy updateStrategy) - { - return new StochasticSoilModelImporter(context.WrappedData, - filePath, - updateStrategy); - } - - private static bool StochasticSoilModelImporterEnabled(StochasticSoilModelCollectionContext context) - { - return context.AssessmentSection.ReferenceLine != null; - } - - private static FileFilterGenerator StochasticSoilModelFileFilter - { - get - { - return new FileFilterGenerator(Resources.Soil_file_Extension, Resources.Soil_file_Description); - } - } - - private bool VerifyStochasticSoilModelUpdates(StochasticSoilModelCollectionContext context) - { - var changeHandler = new StochasticSoilModelChangeHandler(context.FailureMechanism, new DialogBasedInquiryHelper(Gui.MainWindow)); - return !changeHandler.RequireConfirmation() || changeHandler.InquireConfirmation(); - } - public override IEnumerable GetViewInfos() { yield return new ViewInfo @@ -277,7 +252,7 @@ yield return new TreeNodeInfo { - Text = ringtoetsPipingSurfaceLine => PipingFormsResources.PipingSurfaceLinesCollection_DisplayName, + Text = ringtoetsPipingSurfaceLine => PipingDataResources.RingtoetsPipingSurfaceLineCollection_TypeDescriptor, Image = ringtoetsPipingSurfaceLine => RingtoetsCommonFormsResources.GeneralFolderIcon, ForeColor = ringtoetsPipingSurfaceLine => ringtoetsPipingSurfaceLine.WrappedData.Any() ? Color.FromKnownColor(KnownColor.ControlText) : Color.FromKnownColor(KnownColor.GrayText), ChildNodeObjects = ringtoetsPipingSurfaceLine => ringtoetsPipingSurfaceLine.WrappedData.Cast().ToArray(), @@ -299,7 +274,7 @@ yield return new TreeNodeInfo { - Text = stochasticSoilModelContext => PipingFormsResources.StochasticSoilModelCollection_DisplayName, + Text = stochasticSoilModelContext => PipingDataResources.StochasticSoilModelCollection_TypeDescriptor, Image = stochasticSoilModelContext => RingtoetsCommonFormsResources.GeneralFolderIcon, ForeColor = stochasticSoilModelContext => stochasticSoilModelContext.WrappedData.Any() ? Color.FromKnownColor(KnownColor.ControlText) : Color.FromKnownColor(KnownColor.GrayText), @@ -358,6 +333,32 @@ }; } + private static FileFilterGenerator StochasticSoilModelFileFilter + { + get + { + return new FileFilterGenerator(Resources.Soil_file_Extension, Resources.Soil_file_Description); + } + } + + private static StochasticSoilModelImporter StochasticSoilModelImporter(StochasticSoilModelCollectionContext context, string filePath, IStochasticSoilModelUpdateModelStrategy updateStrategy) + { + return new StochasticSoilModelImporter(context.WrappedData, + filePath, + updateStrategy); + } + + private static bool StochasticSoilModelImporterEnabled(StochasticSoilModelCollectionContext context) + { + return context.AssessmentSection.ReferenceLine != null; + } + + private bool VerifyStochasticSoilModelUpdates(StochasticSoilModelCollectionContext context) + { + var changeHandler = new StochasticSoilModelChangeHandler(context.FailureMechanism, new DialogBasedInquiryHelper(Gui.MainWindow)); + return !changeHandler.RequireConfirmation() || changeHandler.InquireConfirmation(); + } + #region PipingFailureMechanismView ViewInfo private static bool ClosePipingFailureMechanismViewForData(PipingFailureMechanismView view, object o) @@ -990,7 +991,7 @@ { return new FileFilterGenerator( RingtoetsCommonFormsResources.DataTypeDisplayName_csv_file_filter_Extension, - $"{PipingFormsResources.PipingSurfaceLinesCollection_DisplayName} {RingtoetsCommonFormsResources.DataTypeDisplayName_csv_file_filter_Description}"); + $"{PipingDataResources.RingtoetsPipingSurfaceLineCollection_TypeDescriptor} {RingtoetsCommonFormsResources.DataTypeDisplayName_csv_file_filter_Description}"); } } Index: Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/RingtoetsPipingSurfaceLineCollectionTest.cs =================================================================== diff -u -r66b07e7599319ea71ff109d8303f74a4a2e5f71c -rc290911dd4647e3115e239c8baf814717c098a5a --- Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/RingtoetsPipingSurfaceLineCollectionTest.cs (.../RingtoetsPipingSurfaceLineCollectionTest.cs) (revision 66b07e7599319ea71ff109d8303f74a4a2e5f71c) +++ Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/RingtoetsPipingSurfaceLineCollectionTest.cs (.../RingtoetsPipingSurfaceLineCollectionTest.cs) (revision c290911dd4647e3115e239c8baf814717c098a5a) @@ -37,7 +37,7 @@ var collection = new RingtoetsPipingSurfaceLineCollection(); // Assert - Assert.IsInstanceOf>(collection); + Assert.IsInstanceOf>(collection); } [Test] Index: Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/StochasticSoilModelCollectionTest.cs =================================================================== diff -u -r66b07e7599319ea71ff109d8303f74a4a2e5f71c -rc290911dd4647e3115e239c8baf814717c098a5a --- Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/StochasticSoilModelCollectionTest.cs (.../StochasticSoilModelCollectionTest.cs) (revision 66b07e7599319ea71ff109d8303f74a4a2e5f71c) +++ Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/StochasticSoilModelCollectionTest.cs (.../StochasticSoilModelCollectionTest.cs) (revision c290911dd4647e3115e239c8baf814717c098a5a) @@ -36,7 +36,7 @@ var collection = new StochasticSoilModelCollection(); // Assert - Assert.IsInstanceOf>(collection); + Assert.IsInstanceOf>(collection); } [Test] @@ -76,7 +76,7 @@ TestDelegate call = () => collection.AddRange(modelsToAdd, "valid/file/path"); // Assert - string message = $"Ondergrondmodellen moeten een unieke naam hebben. Gevonden dubbele elementen: {someName}."; + string message = $"Stochastische ondergrondmodellen moeten een unieke naam hebben. Gevonden dubbele elementen: {someName}."; TestHelper.AssertThrowsArgumentExceptionAndTestMessage(call, message); } @@ -100,7 +100,7 @@ TestDelegate call = () => collection.AddRange(modelsToAdd, "valid/file/path"); // Assert - string message = $"Ondergrondmodellen moeten een unieke naam hebben. Gevonden dubbele elementen: {someName}, {someOtherName}."; + string message = $"Stochastische ondergrondmodellen moeten een unieke naam hebben. Gevonden dubbele elementen: {someName}, {someOtherName}."; TestHelper.AssertThrowsArgumentExceptionAndTestMessage(call, message); } } Index: Ringtoets/Piping/test/Ringtoets.Piping.Data.TestUtil.Test/TestPipingFailureMechanismTest.cs =================================================================== diff -u -r66b07e7599319ea71ff109d8303f74a4a2e5f71c -rc290911dd4647e3115e239c8baf814717c098a5a --- Ringtoets/Piping/test/Ringtoets.Piping.Data.TestUtil.Test/TestPipingFailureMechanismTest.cs (.../TestPipingFailureMechanismTest.cs) (revision 66b07e7599319ea71ff109d8303f74a4a2e5f71c) +++ Ringtoets/Piping/test/Ringtoets.Piping.Data.TestUtil.Test/TestPipingFailureMechanismTest.cs (.../TestPipingFailureMechanismTest.cs) (revision c290911dd4647e3115e239c8baf814717c098a5a) @@ -21,7 +21,6 @@ using System.Collections.Generic; using System.Linq; -using Core.Common.Base; using Core.Common.Base.Geometry; using NUnit.Framework; using Ringtoets.Common.Data.FailureMechanism; @@ -52,7 +51,7 @@ // Assert Assert.AreEqual(24, failureMechanism.Contribution); - ObservableUniqueItemCollectionWithSourcePath surfaceLines = failureMechanism.SurfaceLines; + RingtoetsPipingSurfaceLineCollection surfaceLines = failureMechanism.SurfaceLines; Assert.AreEqual("path/to/surfaceLines", surfaceLines.SourcePath); Assert.AreEqual(1, surfaceLines.Count); RingtoetsPipingSurfaceLine[] surfaceLineArray = surfaceLines.ToArray(); Index: Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/PropertyClasses/RingtoetsPipingSurfaceLineCollectionPropertiesTest.cs =================================================================== diff -u -r66b07e7599319ea71ff109d8303f74a4a2e5f71c -rc290911dd4647e3115e239c8baf814717c098a5a --- Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/PropertyClasses/RingtoetsPipingSurfaceLineCollectionPropertiesTest.cs (.../RingtoetsPipingSurfaceLineCollectionPropertiesTest.cs) (revision 66b07e7599319ea71ff109d8303f74a4a2e5f71c) +++ Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/PropertyClasses/RingtoetsPipingSurfaceLineCollectionPropertiesTest.cs (.../RingtoetsPipingSurfaceLineCollectionPropertiesTest.cs) (revision c290911dd4647e3115e239c8baf814717c098a5a) @@ -22,10 +22,10 @@ using System; using System.ComponentModel; using System.Linq; -using Core.Common.Base; using Core.Common.Gui.PropertyBag; using Core.Common.TestUtil; using NUnit.Framework; +using Ringtoets.Piping.Data; using Ringtoets.Piping.Forms.PropertyClasses; using Ringtoets.Piping.Primitives; @@ -50,14 +50,14 @@ { // Setup var someFilePath = "location/to/a/file"; - var collection = new ObservableUniqueItemCollectionWithSourcePath(); + var collection = new RingtoetsPipingSurfaceLineCollection(); collection.AddRange(Enumerable.Empty(), someFilePath); // Call var properties = new RingtoetsPipingSurfaceLineCollectionProperties(collection); // Assert - Assert.IsInstanceOf>>(properties); + Assert.IsInstanceOf>(properties); Assert.AreSame(collection, properties.Data); Assert.AreEqual(someFilePath, properties.SourcePath); } @@ -66,7 +66,7 @@ public void Constructor_WithData_PropertiesHaveExpectedAttributesValues() { // Setup - var collection = new ObservableUniqueItemCollectionWithSourcePath(); + var collection = new RingtoetsPipingSurfaceLineCollection(); // Call var properties = new RingtoetsPipingSurfaceLineCollectionProperties(collection); Index: Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/PropertyClasses/StochasticSoilModelCollectionPropertiesTest.cs =================================================================== diff -u -r66b07e7599319ea71ff109d8303f74a4a2e5f71c -rc290911dd4647e3115e239c8baf814717c098a5a --- Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/PropertyClasses/StochasticSoilModelCollectionPropertiesTest.cs (.../StochasticSoilModelCollectionPropertiesTest.cs) (revision 66b07e7599319ea71ff109d8303f74a4a2e5f71c) +++ Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/PropertyClasses/StochasticSoilModelCollectionPropertiesTest.cs (.../StochasticSoilModelCollectionPropertiesTest.cs) (revision c290911dd4647e3115e239c8baf814717c098a5a) @@ -22,7 +22,6 @@ using System; using System.ComponentModel; using System.Linq; -using Core.Common.Base; using Core.Common.Gui.PropertyBag; using Core.Common.TestUtil; using NUnit.Framework; @@ -50,14 +49,14 @@ { // Setup var someFilePath = "location/to/a/file"; - var collection = new ObservableUniqueItemCollectionWithSourcePath(); + var collection = new StochasticSoilModelCollection(); collection.AddRange(Enumerable.Empty(), someFilePath); // Call var properties = new StochasticSoilModelCollectionProperties(collection); // Assert - Assert.IsInstanceOf>>(properties); + Assert.IsInstanceOf>(properties); Assert.AreSame(collection, properties.Data); Assert.AreEqual(someFilePath, properties.SourcePath); } @@ -66,7 +65,7 @@ public void Constructor_WithData_PropertiesHaveExpectedAttributesValues() { // Setup - var collection = new ObservableUniqueItemCollectionWithSourcePath(); + var collection = new StochasticSoilModelCollection(); // Call var properties = new StochasticSoilModelCollectionProperties(collection); Index: Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/Views/PipingMapDataFactoryTest.cs =================================================================== diff -u -r0b7a1c98a784ad9ac3eff8c0e8f1fae117ab47f0 -rc290911dd4647e3115e239c8baf814717c098a5a --- Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/Views/PipingMapDataFactoryTest.cs (.../PipingMapDataFactoryTest.cs) (revision 0b7a1c98a784ad9ac3eff8c0e8f1fae117ab47f0) +++ Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/Views/PipingMapDataFactoryTest.cs (.../PipingMapDataFactoryTest.cs) (revision c290911dd4647e3115e239c8baf814717c098a5a) @@ -24,9 +24,8 @@ using Core.Components.Gis.Data; using Core.Components.Gis.Style; using NUnit.Framework; -using Ringtoets.Piping.Forms.Properties; using Ringtoets.Piping.Forms.Views; -using RingtoetsCommonFormsResources = Ringtoets.Common.Forms.Properties.Resources; +using PipingDataResources = Ringtoets.Piping.Data.Properties.Resources; namespace Ringtoets.Piping.Forms.Test.Views { @@ -41,7 +40,7 @@ // Assert Assert.IsEmpty(data.Features); - Assert.AreEqual(Resources.PipingSurfaceLinesCollection_DisplayName, data.Name); + Assert.AreEqual(PipingDataResources.RingtoetsPipingSurfaceLineCollection_TypeDescriptor, data.Name); AssertEqualStyle(data.Style, Color.DarkSeaGreen, 2, DashStyle.Solid); Assert.AreEqual("Naam", data.SelectedMetaDataAttribute); } @@ -54,7 +53,7 @@ // Assert Assert.IsEmpty(data.Features); - Assert.AreEqual(Resources.StochasticSoilModelCollection_DisplayName, data.Name); + Assert.AreEqual(PipingDataResources.StochasticSoilModelCollection_TypeDescriptor, data.Name); AssertEqualStyle(data.Style, Color.FromArgb(70, Color.SaddleBrown), 5, DashStyle.Solid); Assert.AreEqual("Naam", data.SelectedMetaDataAttribute); } Index: Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/FileImporter/StochasticSoilModelReplaceDataStrategyTest.cs =================================================================== diff -u -r66b07e7599319ea71ff109d8303f74a4a2e5f71c -rc290911dd4647e3115e239c8baf814717c098a5a --- Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/FileImporter/StochasticSoilModelReplaceDataStrategyTest.cs (.../StochasticSoilModelReplaceDataStrategyTest.cs) (revision 66b07e7599319ea71ff109d8303f74a4a2e5f71c) +++ Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/FileImporter/StochasticSoilModelReplaceDataStrategyTest.cs (.../StochasticSoilModelReplaceDataStrategyTest.cs) (revision c290911dd4647e3115e239c8baf814717c098a5a) @@ -225,7 +225,7 @@ // Assert var exception = Assert.Throws(test); - Assert.AreEqual("Ondergrondmodellen moeten een unieke naam hebben. Gevonden dubbele elementen: B.", exception.Message); + Assert.AreEqual("Stochastische ondergrondmodellen moeten een unieke naam hebben. Gevonden dubbele elementen: B.", exception.Message); Assert.IsInstanceOf(exception.InnerException); } } Index: Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/FileImporter/StochasticSoilModelUpdateDataStrategyTest.cs =================================================================== diff -u -r66b07e7599319ea71ff109d8303f74a4a2e5f71c -rc290911dd4647e3115e239c8baf814717c098a5a --- Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/FileImporter/StochasticSoilModelUpdateDataStrategyTest.cs (.../StochasticSoilModelUpdateDataStrategyTest.cs) (revision 66b07e7599319ea71ff109d8303f74a4a2e5f71c) +++ Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/FileImporter/StochasticSoilModelUpdateDataStrategyTest.cs (.../StochasticSoilModelUpdateDataStrategyTest.cs) (revision c290911dd4647e3115e239c8baf814717c098a5a) @@ -149,7 +149,7 @@ // Assert var exception = Assert.Throws(test); - Assert.AreEqual("Ondergrondmodellen moeten een unieke naam hebben. Gevonden dubbele elementen: non-unique name.", exception.Message); + Assert.AreEqual("Stochastische ondergrondmodellen moeten een unieke naam hebben. Gevonden dubbele elementen: non-unique name.", exception.Message); Assert.IsInstanceOf(exception.InnerException); } Index: Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/TreeNodeInfos/RingtoetsPipingSurfaceLineCollectionTreeNodeInfoTest.cs =================================================================== diff -u -r425a1030cf1f383e0a8f5cbd712c52c5cc2d3369 -rc290911dd4647e3115e239c8baf814717c098a5a --- Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/TreeNodeInfos/RingtoetsPipingSurfaceLineCollectionTreeNodeInfoTest.cs (.../RingtoetsPipingSurfaceLineCollectionTreeNodeInfoTest.cs) (revision 425a1030cf1f383e0a8f5cbd712c52c5cc2d3369) +++ Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/TreeNodeInfos/RingtoetsPipingSurfaceLineCollectionTreeNodeInfoTest.cs (.../RingtoetsPipingSurfaceLineCollectionTreeNodeInfoTest.cs) (revision c290911dd4647e3115e239c8baf814717c098a5a) @@ -100,7 +100,7 @@ var text = info.Text(ringtoetsPipingSurfaceLines); // Assert - Assert.AreEqual(Resources.PipingSurfaceLinesCollection_DisplayName, text); + Assert.AreEqual("Profielschematisaties", text); } [Test] Index: Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/TreeNodeInfos/StochasticSoilModelCollectionContextTreeNodeInfoTest.cs =================================================================== diff -u -r01b4452324f921248824277a5441667b822a5662 -rc290911dd4647e3115e239c8baf814717c098a5a --- Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/TreeNodeInfos/StochasticSoilModelCollectionContextTreeNodeInfoTest.cs (.../StochasticSoilModelCollectionContextTreeNodeInfoTest.cs) (revision 01b4452324f921248824277a5441667b822a5662) +++ Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/TreeNodeInfos/StochasticSoilModelCollectionContextTreeNodeInfoTest.cs (.../StochasticSoilModelCollectionContextTreeNodeInfoTest.cs) (revision c290911dd4647e3115e239c8baf814717c098a5a) @@ -116,7 +116,7 @@ string text = info.Text(stochasticSoilModelCollectionContext); // Assert - Assert.AreEqual(Resources.StochasticSoilModelCollection_DisplayName, text); + Assert.AreEqual("Stochastische ondergrondmodellen", text); } [Test]