Index: Application/Ringtoets/src/Application.Ringtoets.Storage/Converters/FailureMechanismPlaceholderConverter.cs =================================================================== diff -u -r164e03c3a4957d7a0dd4012f146b0ca139a7a4cc -rfec99b77571cc0cf37b60f5ca257394714fde1d7 --- Application/Ringtoets/src/Application.Ringtoets.Storage/Converters/FailureMechanismPlaceholderConverter.cs (.../FailureMechanismPlaceholderConverter.cs) (revision 164e03c3a4957d7a0dd4012f146b0ca139a7a4cc) +++ Application/Ringtoets/src/Application.Ringtoets.Storage/Converters/FailureMechanismPlaceholderConverter.cs (.../FailureMechanismPlaceholderConverter.cs) (revision fec99b77571cc0cf37b60f5ca257394714fde1d7) @@ -20,7 +20,6 @@ // All rights reserved. using Application.Ringtoets.Storage.DbContext; - using Ringtoets.Integration.Data.Placeholders; namespace Application.Ringtoets.Storage.Converters Index: Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Converters/FailureMechanismPlaceholderConverterTest.cs =================================================================== diff -u -r164e03c3a4957d7a0dd4012f146b0ca139a7a4cc -rfec99b77571cc0cf37b60f5ca257394714fde1d7 --- Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Converters/FailureMechanismPlaceholderConverterTest.cs (.../FailureMechanismPlaceholderConverterTest.cs) (revision 164e03c3a4957d7a0dd4012f146b0ca139a7a4cc) +++ Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Converters/FailureMechanismPlaceholderConverterTest.cs (.../FailureMechanismPlaceholderConverterTest.cs) (revision fec99b77571cc0cf37b60f5ca257394714fde1d7) @@ -1,8 +1,27 @@ -using Application.Ringtoets.Storage.Converters; -using Application.Ringtoets.Storage.DbContext; +// 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 Application.Ringtoets.Storage.Converters; +using Application.Ringtoets.Storage.DbContext; using NUnit.Framework; - using Ringtoets.Integration.Data.Placeholders; namespace Application.Ringtoets.Storage.Test.Converters @@ -31,9 +50,9 @@ var entity = new FailureMechanismEntity { - FailureMechanismType = (short)type, + FailureMechanismType = (short) type, FailureMechanismEntityId = id, - IsRelevant = isRelevant ? (byte)1 : (byte)0 + IsRelevant = isRelevant ? (byte) 1 : (byte) 0 }; var converter = new FailureMechanismPlaceholderConverter(type); @@ -69,10 +88,10 @@ // Assert Assert.AreEqual(id, entity.FailureMechanismEntityId); - Assert.AreEqual((short)type, entity.FailureMechanismType); + Assert.AreEqual((short) type, entity.FailureMechanismType); var expectedIsRelevantValue = isRelevant ? - (byte)1 : - (byte)0; + (byte) 1 : + (byte) 0; Assert.AreEqual(expectedIsRelevantValue, entity.IsRelevant); } } Index: Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Persistors/FailureMechanismPlaceholderPersistorTest.cs =================================================================== diff -u -r164e03c3a4957d7a0dd4012f146b0ca139a7a4cc -rfec99b77571cc0cf37b60f5ca257394714fde1d7 --- Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Persistors/FailureMechanismPlaceholderPersistorTest.cs (.../FailureMechanismPlaceholderPersistorTest.cs) (revision 164e03c3a4957d7a0dd4012f146b0ca139a7a4cc) +++ Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Persistors/FailureMechanismPlaceholderPersistorTest.cs (.../FailureMechanismPlaceholderPersistorTest.cs) (revision fec99b77571cc0cf37b60f5ca257394714fde1d7) @@ -1,12 +1,29 @@ -using System.Collections.Generic; +// 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 Application.Ringtoets.Storage.DbContext; using Application.Ringtoets.Storage.Persistors; - using NUnit.Framework; - using Rhino.Mocks; - using Ringtoets.Integration.Data.Placeholders; namespace Application.Ringtoets.Storage.Test.Persistors @@ -46,9 +63,9 @@ var failureMechanism = new FailureMechanismPlaceholder("A"); var entity = new FailureMechanismEntity { - FailureMechanismType = (short)type, + FailureMechanismType = (short) type, FailureMechanismEntityId = id, - IsRelevant = isRelevant ? (byte)1 : (byte)0 + IsRelevant = isRelevant ? (byte) 1 : (byte) 0 }; // Call @@ -81,7 +98,7 @@ // Precondition Assert.AreEqual(0, failureMechanism.StorageId, - "StorageId should be 0 to denote the failure mechanism as unsaved."); + "StorageId should be 0 to denote the failure mechanism as unsaved."); // Call persistor.UpdateModel(parentNavigationProperty, failureMechanism); @@ -90,8 +107,8 @@ Assert.AreEqual(1, parentNavigationProperty.Count); FailureMechanismEntity entity = parentNavigationProperty[0]; - Assert.AreEqual((short)type, entity.FailureMechanismType); - var expectedIsRelevantValue = isRelevant ? (byte)1 : (byte)0; + Assert.AreEqual((short) type, entity.FailureMechanismType); + var expectedIsRelevantValue = isRelevant ? (byte) 1 : (byte) 0; Assert.AreEqual(expectedIsRelevantValue, entity.IsRelevant); } @@ -110,7 +127,7 @@ FailureMechanismEntity alreadyExistingEntity = new FailureMechanismEntity { FailureMechanismEntityId = id, - FailureMechanismType = (short)type + FailureMechanismType = (short) type }; var parentNavigationProperty = new List { @@ -131,8 +148,8 @@ // Assert Assert.AreEqual(1, parentNavigationProperty.Count); - Assert.AreEqual((short)type, alreadyExistingEntity.FailureMechanismType); - var expectedIsRelevantValue = isRelevant ? (byte)1 : (byte)0; + Assert.AreEqual((short) type, alreadyExistingEntity.FailureMechanismType); + var expectedIsRelevantValue = isRelevant ? (byte) 1 : (byte) 0; Assert.AreEqual(expectedIsRelevantValue, alreadyExistingEntity.IsRelevant); } Index: Ringtoets/Common/src/Ringtoets.Common.Data/Contribution/OtherFailureMechanism.cs =================================================================== diff -u -r887b289acf19a81f62d78f371ab70c3f82812b95 -rfec99b77571cc0cf37b60f5ca257394714fde1d7 --- Ringtoets/Common/src/Ringtoets.Common.Data/Contribution/OtherFailureMechanism.cs (.../OtherFailureMechanism.cs) (revision 887b289acf19a81f62d78f371ab70c3f82812b95) +++ Ringtoets/Common/src/Ringtoets.Common.Data/Contribution/OtherFailureMechanism.cs (.../OtherFailureMechanism.cs) (revision fec99b77571cc0cf37b60f5ca257394714fde1d7) @@ -35,7 +35,7 @@ /// /// Creates a new instance of . /// - public OtherFailureMechanism() : base(Resources.OtherFailureMechanism_DisplayName) {} + public OtherFailureMechanism() : base(Resources.OtherFailureMechanism_DisplayName, Resources.OtherFailureMechanism_DisplayCode) {} public override IEnumerable Calculations { Index: Ringtoets/Common/src/Ringtoets.Common.Data/FailureMechanism/FailureMechanismBase.cs =================================================================== diff -u -r887b289acf19a81f62d78f371ab70c3f82812b95 -rfec99b77571cc0cf37b60f5ca257394714fde1d7 --- Ringtoets/Common/src/Ringtoets.Common.Data/FailureMechanism/FailureMechanismBase.cs (.../FailureMechanismBase.cs) (revision 887b289acf19a81f62d78f371ab70c3f82812b95) +++ Ringtoets/Common/src/Ringtoets.Common.Data/FailureMechanism/FailureMechanismBase.cs (.../FailureMechanismBase.cs) (revision fec99b77571cc0cf37b60f5ca257394714fde1d7) @@ -42,9 +42,11 @@ /// Initializes a new instance of the class. /// /// The name of the failure mechanism. - protected FailureMechanismBase(string failureMechanismName) + /// The code of the failure mechanism. + protected FailureMechanismBase(string failureMechanismName, string failureMechanismCode) { Name = failureMechanismName; + Code = failureMechanismCode; sections = new List(); sectionResults = new List(); IsRelevant = true; @@ -81,6 +83,8 @@ public string Name { get; private set; } + public string Code { get; private set; } + public abstract IEnumerable Calculations { get; } public IEnumerable Sections Index: Ringtoets/Common/src/Ringtoets.Common.Data/FailureMechanism/IFailureMechanism.cs =================================================================== diff -u -r887b289acf19a81f62d78f371ab70c3f82812b95 -rfec99b77571cc0cf37b60f5ca257394714fde1d7 --- Ringtoets/Common/src/Ringtoets.Common.Data/FailureMechanism/IFailureMechanism.cs (.../IFailureMechanism.cs) (revision 887b289acf19a81f62d78f371ab70c3f82812b95) +++ Ringtoets/Common/src/Ringtoets.Common.Data/FailureMechanism/IFailureMechanism.cs (.../IFailureMechanism.cs) (revision fec99b77571cc0cf37b60f5ca257394714fde1d7) @@ -45,6 +45,11 @@ string Name { get; } /// + /// Gets the code of the . + /// + string Code { get; } + + /// /// Gets or sets a value indicating whether this failure mechanism is relevant. /// bool IsRelevant { get; set; } Index: Ringtoets/Common/src/Ringtoets.Common.Data/Properties/Resources.Designer.cs =================================================================== diff -u -r915d8a66e5d294a18f9452775406e36a3f8fbdc0 -rfec99b77571cc0cf37b60f5ca257394714fde1d7 --- Ringtoets/Common/src/Ringtoets.Common.Data/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 915d8a66e5d294a18f9452775406e36a3f8fbdc0) +++ Ringtoets/Common/src/Ringtoets.Common.Data/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision fec99b77571cc0cf37b60f5ca257394714fde1d7) @@ -198,6 +198,15 @@ } /// + /// Looks up a localized string similar to NWOoc. + /// + public static string OtherFailureMechanism_DisplayCode { + get { + return ResourceManager.GetString("OtherFailureMechanism_DisplayCode", resourceCulture); + } + } + + /// /// Looks up a localized string similar to Overig. /// public static string OtherFailureMechanism_DisplayName { Index: Ringtoets/Common/src/Ringtoets.Common.Data/Properties/Resources.resx =================================================================== diff -u -r915d8a66e5d294a18f9452775406e36a3f8fbdc0 -rfec99b77571cc0cf37b60f5ca257394714fde1d7 --- Ringtoets/Common/src/Ringtoets.Common.Data/Properties/Resources.resx (.../Resources.resx) (revision 915d8a66e5d294a18f9452775406e36a3f8fbdc0) +++ Ringtoets/Common/src/Ringtoets.Common.Data/Properties/Resources.resx (.../Resources.resx) (revision fec99b77571cc0cf37b60f5ca257394714fde1d7) @@ -177,4 +177,7 @@ Kan de naam van deze groep niet aanpassen, omdat 'IsNameEditable' op 'false' staat. + + NWOoc + \ No newline at end of file Index: Ringtoets/Common/test/Ringtoets.Common.Data.Test/Contribution/OtherFailureMechanismTest.cs =================================================================== diff -u -r8c60e937f4b8009fea80f3702879e100fe03b63f -rfec99b77571cc0cf37b60f5ca257394714fde1d7 --- Ringtoets/Common/test/Ringtoets.Common.Data.Test/Contribution/OtherFailureMechanismTest.cs (.../OtherFailureMechanismTest.cs) (revision 8c60e937f4b8009fea80f3702879e100fe03b63f) +++ Ringtoets/Common/test/Ringtoets.Common.Data.Test/Contribution/OtherFailureMechanismTest.cs (.../OtherFailureMechanismTest.cs) (revision fec99b77571cc0cf37b60f5ca257394714fde1d7) @@ -20,7 +20,6 @@ // All rights reserved. using NUnit.Framework; - using Ringtoets.Common.Data.Contribution; using Ringtoets.Common.Data.FailureMechanism; @@ -37,6 +36,7 @@ // Assert Assert.AreEqual("Overig", result.Name); + Assert.AreEqual("NWOoc", result.Code); Assert.IsInstanceOf(result); CollectionAssert.IsEmpty(result.Calculations); } Index: Ringtoets/Common/test/Ringtoets.Common.Data.Test/FailureMechanism/FailureMechanismBaseTest.cs =================================================================== diff -u -r887b289acf19a81f62d78f371ab70c3f82812b95 -rfec99b77571cc0cf37b60f5ca257394714fde1d7 --- Ringtoets/Common/test/Ringtoets.Common.Data.Test/FailureMechanism/FailureMechanismBaseTest.cs (.../FailureMechanismBaseTest.cs) (revision 887b289acf19a81f62d78f371ab70c3f82812b95) +++ Ringtoets/Common/test/Ringtoets.Common.Data.Test/FailureMechanism/FailureMechanismBaseTest.cs (.../FailureMechanismBaseTest.cs) (revision fec99b77571cc0cf37b60f5ca257394714fde1d7) @@ -40,16 +40,18 @@ { // Setup const string name = ""; + const string code = ""; // Call - var failureMechanism = new SimpleFailureMechanismBase(name); + var failureMechanism = new SimpleFailureMechanismBase(name, code); // Assert Assert.IsInstanceOf(failureMechanism); Assert.IsInstanceOf(failureMechanism); Assert.IsInstanceOf(failureMechanism); Assert.AreEqual(0, failureMechanism.Contribution); Assert.AreEqual(name, failureMechanism.Name); + Assert.AreEqual(code, failureMechanism.Code); Assert.AreEqual(0, failureMechanism.StorageId); Assert.IsTrue(failureMechanism.IsRelevant); CollectionAssert.IsEmpty(failureMechanism.Sections); @@ -61,7 +63,7 @@ public void IsRelevant_SetNewValue_GetNewlySetValue(bool relevant) { // Setup - var failureMechanism = new SimpleFailureMechanismBase("A"); + var failureMechanism = new SimpleFailureMechanismBase("A", string.Empty); // Call failureMechanism.IsRelevant = relevant; @@ -74,11 +76,11 @@ [TestCase(101)] [TestCase(-1e-6)] [TestCase(-1)] - [TestCase(100+1e-6)] + [TestCase(100 + 1e-6)] public void Contribution_ValueOutsideValidRegion_ThrowsArgumentException(double value) { // Setup - var failureMechanism = new SimpleFailureMechanismBase(""); + var failureMechanism = new SimpleFailureMechanismBase(string.Empty, string.Empty); // Call TestDelegate test = () => failureMechanism.Contribution = value; @@ -94,7 +96,7 @@ public void Contribution_ValueIntsideValidRegion_DoesNotThrow(double value) { // Setup - var failureMechanism = new SimpleFailureMechanismBase(""); + var failureMechanism = new SimpleFailureMechanismBase(string.Empty, string.Empty); // Call TestDelegate test = () => failureMechanism.Contribution = value; @@ -107,7 +109,7 @@ public void AddSection_SectionIsNull_ThrowArgumentNullException() { // Setup - var failureMechanism = new SimpleFailureMechanismBase(""); + var failureMechanism = new SimpleFailureMechanismBase(string.Empty, string.Empty); // Call TestDelegate call = () => failureMechanism.AddSection(null); @@ -120,7 +122,7 @@ public void AddSection_FirstSectionAdded_SectionAddedToSections() { // Setup - var failureMechanism = new SimpleFailureMechanismBase(""); + var failureMechanism = new SimpleFailureMechanismBase(string.Empty, string.Empty); var section = new FailureMechanismSection("A", new[] { @@ -132,14 +134,17 @@ failureMechanism.AddSection(section); // Assert - CollectionAssert.AreEqual(new[]{section}, failureMechanism.Sections); + CollectionAssert.AreEqual(new[] + { + section + }, failureMechanism.Sections); } [Test] public void AddSection_SecondSectionEndConnectingToStartOfFirst_Section2InsertedBeforeSection1() { // Setup - var failureMechanism = new SimpleFailureMechanismBase(""); + var failureMechanism = new SimpleFailureMechanismBase(string.Empty, string.Empty); const int matchingX = 1; const int matchingY = 2; @@ -160,14 +165,18 @@ failureMechanism.AddSection(section2); // Assert - CollectionAssert.AreEqual(new[] { section2, section1 }, failureMechanism.Sections); + CollectionAssert.AreEqual(new[] + { + section2, + section1 + }, failureMechanism.Sections); } [Test] public void AddSection_SecondSectionStartConnectingToEndOfFirst_Section2AddedAfterSection1() { // Setup - var failureMechanism = new SimpleFailureMechanismBase(""); + var failureMechanism = new SimpleFailureMechanismBase(string.Empty, string.Empty); const int matchingX = 1; const int matchingY = 2; @@ -176,7 +185,6 @@ { new Point2D(3, 4), new Point2D(matchingX, matchingY) - }); var section2 = new FailureMechanismSection("B", new[] { @@ -189,20 +197,23 @@ failureMechanism.AddSection(section2); // Assert - CollectionAssert.AreEqual(new[] { section1, section2 }, failureMechanism.Sections); + CollectionAssert.AreEqual(new[] + { + section1, + section2 + }, failureMechanism.Sections); } [Test] public void AddSection_SecondSectionDoesNotConnectToFirst_ThrowArgumentException() { // Setup - var failureMechanism = new SimpleFailureMechanismBase(""); + var failureMechanism = new SimpleFailureMechanismBase(string.Empty, string.Empty); var section1 = new FailureMechanismSection("A", new[] { new Point2D(1, 2), new Point2D(3, 4) - }); var section2 = new FailureMechanismSection("B", new[] { @@ -224,7 +235,7 @@ public void AddSection_SectionValid_SectionAddedSectionResults() { // Setup - var failureMechanism = new SimpleFailureMechanismBase(""); + var failureMechanism = new SimpleFailureMechanismBase(string.Empty, string.Empty); var section = new FailureMechanismSection("A", new[] { @@ -246,7 +257,7 @@ public void PipingFailureMechanismSectionResults_Always_ReturnsPipingFailureMechanismSectionResults() { // Setup - var failureMechanism = new SimpleFailureMechanismBase(""); + var failureMechanism = new SimpleFailureMechanismBase(string.Empty, string.Empty); var section = new FailureMechanismSection("A", new[] { @@ -267,7 +278,11 @@ var data = failureMechanism.SectionResults.ToList(); // Assert - CollectionAssert.AreEqual(new[] { section, section2 }, data.Select(d => d.Section)); + CollectionAssert.AreEqual(new[] + { + section, + section2 + }, data.Select(d => d.Section)); } [Test] @@ -280,7 +295,7 @@ new Point2D(3.3, 4.4) }); - var failureMechanism = new SimpleFailureMechanismBase("A"); + var failureMechanism = new SimpleFailureMechanismBase("A", string.Empty); failureMechanism.AddSection(section); // Call @@ -292,6 +307,8 @@ private class SimpleFailureMechanismBase : FailureMechanismBase { + public SimpleFailureMechanismBase(string failureMechanismName, string failureMechanismCode) : base(failureMechanismName, failureMechanismCode) {} + public override IEnumerable Calculations { get @@ -301,8 +318,6 @@ } public override ICalculationGroup CalculationsGroup { get; protected set; } - - public SimpleFailureMechanismBase(string failureMechanismName) : base(failureMechanismName) {} } } } \ No newline at end of file Index: Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Views/FailureMechanismResultViewTest.cs =================================================================== diff -u -red71d00e40e0171a4d8b8335bbf577206b288e6b -rfec99b77571cc0cf37b60f5ca257394714fde1d7 --- Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Views/FailureMechanismResultViewTest.cs (.../FailureMechanismResultViewTest.cs) (revision ed71d00e40e0171a4d8b8335bbf577206b288e6b) +++ Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Views/FailureMechanismResultViewTest.cs (.../FailureMechanismResultViewTest.cs) (revision fec99b77571cc0cf37b60f5ca257394714fde1d7) @@ -598,7 +598,7 @@ private class SimpleFailureMechanism : FailureMechanismBase { - public SimpleFailureMechanism() : base("Stubbed name") {} + public SimpleFailureMechanism() : base("Stubbed name", "Stubbed code") {} public override IEnumerable Calculations { Index: Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Data/GrassCoverErosionInwardsFailureMechanism.cs =================================================================== diff -u -r887b289acf19a81f62d78f371ab70c3f82812b95 -rfec99b77571cc0cf37b60f5ca257394714fde1d7 --- Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Data/GrassCoverErosionInwardsFailureMechanism.cs (.../GrassCoverErosionInwardsFailureMechanism.cs) (revision 887b289acf19a81f62d78f371ab70c3f82812b95) +++ Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Data/GrassCoverErosionInwardsFailureMechanism.cs (.../GrassCoverErosionInwardsFailureMechanism.cs) (revision fec99b77571cc0cf37b60f5ca257394714fde1d7) @@ -35,7 +35,7 @@ /// Initializes a new instance of the class. /// public GrassCoverErosionInwardsFailureMechanism() - : base(Resources.GrassCoverErosionInwardsFailureMechanism_DisplayName) + : base(Resources.GrassCoverErosionInwardsFailureMechanism_DisplayName, Resources.GrassCoverErosionInwardsFailureMechanism_DisplayCode) { CalculationsGroup = new CalculationGroup(Resources.GrassCoverErosionInwardsFailureMechanism_Calculations_DisplayName, false); } Index: Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Data/Properties/Resources.Designer.cs =================================================================== diff -u -rfaa4f56b7eac1c69190e6c97464b8cfad6299f6d -rfec99b77571cc0cf37b60f5ca257394714fde1d7 --- Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Data/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision faa4f56b7eac1c69190e6c97464b8cfad6299f6d) +++ Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Data/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision fec99b77571cc0cf37b60f5ca257394714fde1d7) @@ -79,6 +79,15 @@ } /// + /// Looks up a localized string similar to GEKB. + /// + public static string GrassCoverErosionInwardsFailureMechanism_DisplayCode { + get { + return ResourceManager.GetString("GrassCoverErosionInwardsFailureMechanism_DisplayCode", resourceCulture); + } + } + + /// /// Looks up a localized string similar to Dijken - Grasbekleding erosie kruin en binnentalud. /// public static string GrassCoverErosionInwardsFailureMechanism_DisplayName { Index: Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Data/Properties/Resources.resx =================================================================== diff -u -rfaa4f56b7eac1c69190e6c97464b8cfad6299f6d -rfec99b77571cc0cf37b60f5ca257394714fde1d7 --- Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Data/Properties/Resources.resx (.../Resources.resx) (revision faa4f56b7eac1c69190e6c97464b8cfad6299f6d) +++ Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Data/Properties/Resources.resx (.../Resources.resx) (revision fec99b77571cc0cf37b60f5ca257394714fde1d7) @@ -126,4 +126,7 @@ Berekeningen + + GEKB + \ No newline at end of file Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Data.Test/GrassCoverErosionInwardsFailureMechanismTest.cs =================================================================== diff -u -rfaa4f56b7eac1c69190e6c97464b8cfad6299f6d -rfec99b77571cc0cf37b60f5ca257394714fde1d7 --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Data.Test/GrassCoverErosionInwardsFailureMechanismTest.cs (.../GrassCoverErosionInwardsFailureMechanismTest.cs) (revision faa4f56b7eac1c69190e6c97464b8cfad6299f6d) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Data.Test/GrassCoverErosionInwardsFailureMechanismTest.cs (.../GrassCoverErosionInwardsFailureMechanismTest.cs) (revision fec99b77571cc0cf37b60f5ca257394714fde1d7) @@ -48,6 +48,7 @@ // assert Assert.IsInstanceOf(grassCoverErosionInwardsFailureMechanism); Assert.AreEqual(Resources.GrassCoverErosionInwardsFailureMechanism_DisplayName, grassCoverErosionInwardsFailureMechanism.Name); + Assert.AreEqual(Resources.GrassCoverErosionInwardsFailureMechanism_DisplayCode, grassCoverErosionInwardsFailureMechanism.Code); CollectionAssert.IsEmpty(grassCoverErosionInwardsFailureMechanism.Calculations); Assert.AreEqual("Berekeningen", grassCoverErosionInwardsFailureMechanism.CalculationsGroup.Name); Assert.IsEmpty(grassCoverErosionInwardsFailureMechanism.CalculationsGroup.Children); Index: Ringtoets/Integration/src/Ringtoets.Integration.Data/Placeholders/FailureMechanismPlaceholder.cs =================================================================== diff -u -r887b289acf19a81f62d78f371ab70c3f82812b95 -rfec99b77571cc0cf37b60f5ca257394714fde1d7 --- Ringtoets/Integration/src/Ringtoets.Integration.Data/Placeholders/FailureMechanismPlaceholder.cs (.../FailureMechanismPlaceholder.cs) (revision 887b289acf19a81f62d78f371ab70c3f82812b95) +++ Ringtoets/Integration/src/Ringtoets.Integration.Data/Placeholders/FailureMechanismPlaceholder.cs (.../FailureMechanismPlaceholder.cs) (revision fec99b77571cc0cf37b60f5ca257394714fde1d7) @@ -36,7 +36,8 @@ /// Initializes a new instance of the class. /// /// The placeholder's name. - public FailureMechanismPlaceholder(string name) : base(name) + public FailureMechanismPlaceholder(string name) + : base(name, string.Empty) { Locations = new InputPlaceholder(RingtoetsCommonDataResources.FailureMechanism_Locations_DisplayName); BoundaryConditions = new InputPlaceholder(RingtoetsCommonDataResources.FailureMechanism_BoundaryConditions_DisplayName); Index: Ringtoets/Integration/test/Ringtoets.Integration.Data.Test/Placeholders/FailureMechanismPlaceholderTest.cs =================================================================== diff -u -rc4d2af65ad23757fb3bd11f93458839bc1787ded -rfec99b77571cc0cf37b60f5ca257394714fde1d7 --- Ringtoets/Integration/test/Ringtoets.Integration.Data.Test/Placeholders/FailureMechanismPlaceholderTest.cs (.../FailureMechanismPlaceholderTest.cs) (revision c4d2af65ad23757fb3bd11f93458839bc1787ded) +++ Ringtoets/Integration/test/Ringtoets.Integration.Data.Test/Placeholders/FailureMechanismPlaceholderTest.cs (.../FailureMechanismPlaceholderTest.cs) (revision fec99b77571cc0cf37b60f5ca257394714fde1d7) @@ -1,6 +1,25 @@ -using NUnit.Framework; +// 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 Ringtoets.Common.Data; +using NUnit.Framework; using Ringtoets.Common.Data.FailureMechanism; using Ringtoets.Integration.Data.Placeholders; @@ -13,7 +32,7 @@ public void DefaultConstructor_ExpectedValues() { // Setup - const string expectedName = "test"; + const string expectedName = "testName"; // Call var failureMechanism = new FailureMechanismPlaceholder(expectedName); Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PresentationObjects/FailureMechanismPlaceholderContextTest.cs =================================================================== diff -u -rc4d2af65ad23757fb3bd11f93458839bc1787ded -rfec99b77571cc0cf37b60f5ca257394714fde1d7 --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PresentationObjects/FailureMechanismPlaceholderContextTest.cs (.../FailureMechanismPlaceholderContextTest.cs) (revision c4d2af65ad23757fb3bd11f93458839bc1787ded) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PresentationObjects/FailureMechanismPlaceholderContextTest.cs (.../FailureMechanismPlaceholderContextTest.cs) (revision fec99b77571cc0cf37b60f5ca257394714fde1d7) @@ -1,8 +1,26 @@ -using NUnit.Framework; +// 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 NUnit.Framework; using Rhino.Mocks; - -using Ringtoets.Common.Data; using Ringtoets.Common.Data.AssessmentSection; using Ringtoets.Common.Forms.PresentationObjects; using Ringtoets.Integration.Data.Placeholders; Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/TreeNodeInfos/AssessmentSectionTreeNodeInfoTest.cs =================================================================== diff -u -r04b631b486b742c5339deb1d5504bb13ab5e248d -rfec99b77571cc0cf37b60f5ca257394714fde1d7 --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/TreeNodeInfos/AssessmentSectionTreeNodeInfoTest.cs (.../AssessmentSectionTreeNodeInfoTest.cs) (revision 04b631b486b742c5339deb1d5504bb13ab5e248d) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/TreeNodeInfos/AssessmentSectionTreeNodeInfoTest.cs (.../AssessmentSectionTreeNodeInfoTest.cs) (revision fec99b77571cc0cf37b60f5ca257394714fde1d7) @@ -176,7 +176,7 @@ Assert.AreSame(assessmentSection.HydraulicBoundaryDatabase, context.Parent.HydraulicBoundaryDatabase); Assert.AreSame(assessmentSection, context.Parent); - var commentContext = (CommentContext)objects[3]; + var commentContext = (CommentContext) objects[3]; Assert.AreSame(assessmentSection, commentContext.CommentContainer); var pipingFailureMechanismContext = (PipingFailureMechanismContext) objects[4]; Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/TreeNodeInfos/FailureMechanismPlaceholderTreeNodeInfoTest.cs =================================================================== diff -u -r684b8c0ca681ea2da3cc988bd60e9223037e5a16 -rfec99b77571cc0cf37b60f5ca257394714fde1d7 --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/TreeNodeInfos/FailureMechanismPlaceholderTreeNodeInfoTest.cs (.../FailureMechanismPlaceholderTreeNodeInfoTest.cs) (revision 684b8c0ca681ea2da3cc988bd60e9223037e5a16) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/TreeNodeInfos/FailureMechanismPlaceholderTreeNodeInfoTest.cs (.../FailureMechanismPlaceholderTreeNodeInfoTest.cs) (revision fec99b77571cc0cf37b60f5ca257394714fde1d7) @@ -1,6 +1,26 @@ -using System.Drawing; -using System.Linq; +// Copyright (C) Stichting Deltares 2016. All rights reserved. +// +// This file is part of Ringtoets. +// +// Ringtoets is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. +using System.Drawing; +using System.Linq; using Core.Common.Base.Geometry; using Core.Common.Controls.TreeView; using Core.Common.Gui; @@ -9,7 +29,6 @@ using Core.Common.TestUtil; using NUnit.Framework; using Rhino.Mocks; - using Ringtoets.Common.Data; using Ringtoets.Common.Data.AssessmentSection; using Ringtoets.Common.Data.FailureMechanism; @@ -116,7 +135,7 @@ // Assert Assert.AreEqual(Color.FromKnownColor(KnownColor.ControlText), textColor); - + mocks.VerifyAll(); } } @@ -234,7 +253,6 @@ gui.Stub(g => g.ProjectOpened += null).IgnoreArguments(); gui.Stub(g => g.ProjectOpened -= null).IgnoreArguments(); - mocks.ReplayAll(); using (var plugin = new RingtoetsGuiPlugin()) Index: Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/FileImporters/FailureMechanismSectionsImporterTest.cs =================================================================== diff -u -r887b289acf19a81f62d78f371ab70c3f82812b95 -rfec99b77571cc0cf37b60f5ca257394714fde1d7 --- Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/FileImporters/FailureMechanismSectionsImporterTest.cs (.../FailureMechanismSectionsImporterTest.cs) (revision 887b289acf19a81f62d78f371ab70c3f82812b95) +++ Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/FileImporters/FailureMechanismSectionsImporterTest.cs (.../FailureMechanismSectionsImporterTest.cs) (revision fec99b77571cc0cf37b60f5ca257394714fde1d7) @@ -635,7 +635,7 @@ private class Simple : FailureMechanismBase { - public Simple() : base("Stubbed name") {} + public Simple() : base("Stubbed name","Stubbed code") {} public override IEnumerable Calculations { Index: Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/ViewInfos/FailureMechanismResultViewInfoTest.cs =================================================================== diff -u -r887b289acf19a81f62d78f371ab70c3f82812b95 -rfec99b77571cc0cf37b60f5ca257394714fde1d7 --- Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/ViewInfos/FailureMechanismResultViewInfoTest.cs (.../FailureMechanismResultViewInfoTest.cs) (revision 887b289acf19a81f62d78f371ab70c3f82812b95) +++ Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/ViewInfos/FailureMechanismResultViewInfoTest.cs (.../FailureMechanismResultViewInfoTest.cs) (revision fec99b77571cc0cf37b60f5ca257394714fde1d7) @@ -223,7 +223,7 @@ private class Simple : FailureMechanismBase { - public Simple() : base("simple failure mechanism") {} + public Simple() : base("simple failure mechanism", "simple code") {} public override IEnumerable Calculations { Index: Ringtoets/Piping/src/Ringtoets.Piping.Data/PipingFailureMechanism.cs =================================================================== diff -u -r887b289acf19a81f62d78f371ab70c3f82812b95 -rfec99b77571cc0cf37b60f5ca257394714fde1d7 --- Ringtoets/Piping/src/Ringtoets.Piping.Data/PipingFailureMechanism.cs (.../PipingFailureMechanism.cs) (revision 887b289acf19a81f62d78f371ab70c3f82812b95) +++ Ringtoets/Piping/src/Ringtoets.Piping.Data/PipingFailureMechanism.cs (.../PipingFailureMechanism.cs) (revision fec99b77571cc0cf37b60f5ca257394714fde1d7) @@ -39,7 +39,7 @@ /// Initializes a new instance of the class. /// public PipingFailureMechanism() - : base(PipingDataResources.PipingFailureMechanism_DisplayName) + : base(PipingDataResources.PipingFailureMechanism_DisplayName, PipingDataResources.PipingFailureMechanism_DisplayCode) { SemiProbabilisticInput = new SemiProbabilisticPipingInput(); GeneralInput = new GeneralPipingInput(); Index: Ringtoets/Piping/src/Ringtoets.Piping.Data/Properties/Resources.Designer.cs =================================================================== diff -u -r915d8a66e5d294a18f9452775406e36a3f8fbdc0 -rfec99b77571cc0cf37b60f5ca257394714fde1d7 --- Ringtoets/Piping/src/Ringtoets.Piping.Data/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 915d8a66e5d294a18f9452775406e36a3f8fbdc0) +++ Ringtoets/Piping/src/Ringtoets.Piping.Data/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision fec99b77571cc0cf37b60f5ca257394714fde1d7) @@ -160,6 +160,15 @@ } /// + /// Looks up a localized string similar to STPH. + /// + public static string PipingFailureMechanism_DisplayCode { + get { + return ResourceManager.GetString("PipingFailureMechanism_DisplayCode", resourceCulture); + } + } + + /// /// Looks up a localized string similar to Dijken - Piping. /// public static string PipingFailureMechanism_DisplayName { Index: Ringtoets/Piping/src/Ringtoets.Piping.Data/Properties/Resources.resx =================================================================== diff -u -r915d8a66e5d294a18f9452775406e36a3f8fbdc0 -rfec99b77571cc0cf37b60f5ca257394714fde1d7 --- Ringtoets/Piping/src/Ringtoets.Piping.Data/Properties/Resources.resx (.../Resources.resx) (revision 915d8a66e5d294a18f9452775406e36a3f8fbdc0) +++ Ringtoets/Piping/src/Ringtoets.Piping.Data/Properties/Resources.resx (.../Resources.resx) (revision fec99b77571cc0cf37b60f5ca257394714fde1d7) @@ -183,4 +183,7 @@ Level {0} is below the bottom of the soil profile {1}. + + STPH + \ No newline at end of file Index: Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/PipingFailureMechanismTest.cs =================================================================== diff -u -r915d8a66e5d294a18f9452775406e36a3f8fbdc0 -rfec99b77571cc0cf37b60f5ca257394714fde1d7 --- Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/PipingFailureMechanismTest.cs (.../PipingFailureMechanismTest.cs) (revision 915d8a66e5d294a18f9452775406e36a3f8fbdc0) +++ Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/PipingFailureMechanismTest.cs (.../PipingFailureMechanismTest.cs) (revision fec99b77571cc0cf37b60f5ca257394714fde1d7) @@ -25,6 +25,7 @@ using Rhino.Mocks; using Ringtoets.Common.Data.Calculation; using Ringtoets.Common.Data.FailureMechanism; +using Ringtoets.Piping.Data.Properties; using Ringtoets.Piping.Primitives; namespace Ringtoets.Piping.Data.Test @@ -43,11 +44,13 @@ [Test] public void DefaultConstructor_ExpectedValues() { - // call + // Call var piping = new PipingFailureMechanism(); - // assert + // Assert Assert.IsInstanceOf(piping); + Assert.AreEqual(Resources.PipingFailureMechanism_DisplayName, piping.Name); + Assert.AreEqual(Resources.PipingFailureMechanism_DisplayCode, piping.Code); Assert.IsInstanceOf(piping.GeneralInput); CollectionAssert.IsEmpty(piping.Sections); CollectionAssert.IsEmpty(piping.SurfaceLines); @@ -56,6 +59,7 @@ Assert.IsInstanceOf>(piping.StochasticSoilModels); Assert.AreEqual("Berekeningen", piping.CalculationsGroup.Name); Assert.IsEmpty(piping.CalculationsGroup.Children); + mockRepository.VerifyAll(); } [Test] @@ -144,11 +148,13 @@ { // Setup var observer = mockRepository.StrictMock(); + mockRepository.ReplayAll(); var pipingFailureMechanism = new PipingFailureMechanism(); // Call & Assert pipingFailureMechanism.Detach(observer); + mockRepository.VerifyAll(); } [Test]