Index: Ringtoets/AssemblyTool/src/Ringtoets.AssemblyTool.Data/AssessmentSectionAssemblyCategoryGroup.cs =================================================================== diff -u -rb46cba3269d292e5ca3374ec0f75810686cf3ec6 -r04bef178c846add660097aeab97e3d35aefd939b --- Ringtoets/AssemblyTool/src/Ringtoets.AssemblyTool.Data/AssessmentSectionAssemblyCategoryGroup.cs (.../AssessmentSectionAssemblyCategoryGroup.cs) (revision b46cba3269d292e5ca3374ec0f75810686cf3ec6) +++ Ringtoets/AssemblyTool/src/Ringtoets.AssemblyTool.Data/AssessmentSectionAssemblyCategoryGroup.cs (.../AssessmentSectionAssemblyCategoryGroup.cs) (revision 04bef178c846add660097aeab97e3d35aefd939b) @@ -19,17 +19,29 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. +using Core.Common.Util.Attributes; +using Ringtoets.AssemblyTool.Data.Properties; + namespace Ringtoets.AssemblyTool.Data { /// /// Enum defining the assembly categories for an assessment section. /// public enum AssessmentSectionAssemblyCategoryGroup { + [ResourcesDisplayName(typeof(Resources), nameof(Resources.AssessmentSectionAssemblyCategoryGroup_APlus_DisplayName))] APlus = 1, + + [ResourcesDisplayName(typeof(Resources), nameof(Resources.AssessmentSectionAssemblyCategoryGroup_A_DisplayName))] A = 2, + + [ResourcesDisplayName(typeof(Resources), nameof(Resources.AssessmentSectionAssemblyCategoryGroup_B_DisplayName))] B = 3, + + [ResourcesDisplayName(typeof(Resources), nameof(Resources.AssessmentSectionAssemblyCategoryGroup_C_DisplayName))] C = 4, + + [ResourcesDisplayName(typeof(Resources), nameof(Resources.AssessmentSectionAssemblyCategoryGroup_D_DisplayName))] D = 5 } } \ No newline at end of file Index: Ringtoets/AssemblyTool/src/Ringtoets.AssemblyTool.Data/Properties/Resources.Designer.cs =================================================================== diff -u --- Ringtoets/AssemblyTool/src/Ringtoets.AssemblyTool.Data/Properties/Resources.Designer.cs (revision 0) +++ Ringtoets/AssemblyTool/src/Ringtoets.AssemblyTool.Data/Properties/Resources.Designer.cs (revision 04bef178c846add660097aeab97e3d35aefd939b) @@ -0,0 +1,129 @@ +// Copyright (C) Stichting Deltares 2017. 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. + +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Ringtoets.AssemblyTool.Data.Properties { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Ringtoets.AssemblyTool.Data.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Looks up a localized string similar to A. + /// + internal static string AssessmentSectionAssemblyCategoryGroup_A_DisplayName { + get { + return ResourceManager.GetString("AssessmentSectionAssemblyCategoryGroup_A_DisplayName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A+. + /// + internal static string AssessmentSectionAssemblyCategoryGroup_APlus_DisplayName { + get { + return ResourceManager.GetString("AssessmentSectionAssemblyCategoryGroup_APlus_DisplayName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to B. + /// + internal static string AssessmentSectionAssemblyCategoryGroup_B_DisplayName { + get { + return ResourceManager.GetString("AssessmentSectionAssemblyCategoryGroup_B_DisplayName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to C. + /// + internal static string AssessmentSectionAssemblyCategoryGroup_C_DisplayName { + get { + return ResourceManager.GetString("AssessmentSectionAssemblyCategoryGroup_C_DisplayName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to D. + /// + internal static string AssessmentSectionAssemblyCategoryGroup_D_DisplayName { + get { + return ResourceManager.GetString("AssessmentSectionAssemblyCategoryGroup_D_DisplayName", resourceCulture); + } + } + } +} Index: Ringtoets/AssemblyTool/src/Ringtoets.AssemblyTool.Data/Properties/Resources.resx =================================================================== diff -u --- Ringtoets/AssemblyTool/src/Ringtoets.AssemblyTool.Data/Properties/Resources.resx (revision 0) +++ Ringtoets/AssemblyTool/src/Ringtoets.AssemblyTool.Data/Properties/Resources.resx (revision 04bef178c846add660097aeab97e3d35aefd939b) @@ -0,0 +1,135 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + A+ + + + A + + + B + + + C + + + D + + \ No newline at end of file Index: Ringtoets/AssemblyTool/src/Ringtoets.AssemblyTool.Data/Ringtoets.AssemblyTool.Data.csproj =================================================================== diff -u -rb46cba3269d292e5ca3374ec0f75810686cf3ec6 -r04bef178c846add660097aeab97e3d35aefd939b --- Ringtoets/AssemblyTool/src/Ringtoets.AssemblyTool.Data/Ringtoets.AssemblyTool.Data.csproj (.../Ringtoets.AssemblyTool.Data.csproj) (revision b46cba3269d292e5ca3374ec0f75810686cf3ec6) +++ Ringtoets/AssemblyTool/src/Ringtoets.AssemblyTool.Data/Ringtoets.AssemblyTool.Data.csproj (.../Ringtoets.AssemblyTool.Data.csproj) (revision 04bef178c846add660097aeab97e3d35aefd939b) @@ -18,10 +18,27 @@ + + Resources.resx + True + True + Copying.licenseheader + + + {F49BD8B2-332A-4C91-A196-8CCE0A2C7D98} + Core.Common.Util + + + + + ResXFileCodeGenerator + Resources.Designer.cs + + \ No newline at end of file Fisheye: Tag 04bef178c846add660097aeab97e3d35aefd939b refers to a dead (removed) revision in file `Ringtoets/AssemblyTool/src/Ringtoets.AssemblyTool.Forms/DisplayAssessmentSectionAssemblyCategoryGroup.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 04bef178c846add660097aeab97e3d35aefd939b refers to a dead (removed) revision in file `Ringtoets/AssemblyTool/src/Ringtoets.AssemblyTool.Forms/DisplayAssessmentSectionAssemblyCategoryGroupConverter.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/AssemblyTool/src/Ringtoets.AssemblyTool.Forms/Ringtoets.AssemblyTool.Forms.csproj =================================================================== diff -u -r4d5f18805638d24f450406e9eda206b2f3591c36 -r04bef178c846add660097aeab97e3d35aefd939b --- Ringtoets/AssemblyTool/src/Ringtoets.AssemblyTool.Forms/Ringtoets.AssemblyTool.Forms.csproj (.../Ringtoets.AssemblyTool.Forms.csproj) (revision 4d5f18805638d24f450406e9eda206b2f3591c36) +++ Ringtoets/AssemblyTool/src/Ringtoets.AssemblyTool.Forms/Ringtoets.AssemblyTool.Forms.csproj (.../Ringtoets.AssemblyTool.Forms.csproj) (revision 04bef178c846add660097aeab97e3d35aefd939b) @@ -11,9 +11,7 @@ - - Index: Ringtoets/AssemblyTool/test/Ringtoets.AssemblyTool.Data.Test/AssessmentSectionAssemblyCategoryGroupTest.cs =================================================================== diff -u -rb46cba3269d292e5ca3374ec0f75810686cf3ec6 -r04bef178c846add660097aeab97e3d35aefd939b --- Ringtoets/AssemblyTool/test/Ringtoets.AssemblyTool.Data.Test/AssessmentSectionAssemblyCategoryGroupTest.cs (.../AssessmentSectionAssemblyCategoryGroupTest.cs) (revision b46cba3269d292e5ca3374ec0f75810686cf3ec6) +++ Ringtoets/AssemblyTool/test/Ringtoets.AssemblyTool.Data.Test/AssessmentSectionAssemblyCategoryGroupTest.cs (.../AssessmentSectionAssemblyCategoryGroupTest.cs) (revision 04bef178c846add660097aeab97e3d35aefd939b) @@ -26,13 +26,13 @@ namespace Ringtoets.AssemblyTool.Data.Test { [TestFixture] - public class AssessmentSectionAssemblyCategoryGroupTest : EnumValuesTestFixture + public class AssessmentSectionAssemblyCategoryGroupTest : EnumWithDisplayNameTestFixture { - protected override IDictionary ExpectedValueForEnumValues + protected override IDictionary ExpectedValueForEnumValues { get { - return new Dictionary + return new Dictionary { { AssessmentSectionAssemblyCategoryGroup.APlus, 1 @@ -52,5 +52,30 @@ }; } } + + protected override IDictionary ExpectedDisplayNameForEnumValues + { + get + { + return new Dictionary + { + { + AssessmentSectionAssemblyCategoryGroup.APlus, "A+" + }, + { + AssessmentSectionAssemblyCategoryGroup.A, "A" + }, + { + AssessmentSectionAssemblyCategoryGroup.B, "B" + }, + { + AssessmentSectionAssemblyCategoryGroup.C, "C" + }, + { + AssessmentSectionAssemblyCategoryGroup.D, "D" + } + }; + } + } } } \ No newline at end of file Fisheye: Tag 04bef178c846add660097aeab97e3d35aefd939b refers to a dead (removed) revision in file `Ringtoets/AssemblyTool/test/Ringtoets.AssemblyTool.Forms.Test/DisplayAssessmentSectionAssemblyCategoryGroupConverterTest.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 04bef178c846add660097aeab97e3d35aefd939b refers to a dead (removed) revision in file `Ringtoets/AssemblyTool/test/Ringtoets.AssemblyTool.Forms.Test/DisplayAssessmentSectionAssemblyCategoryGroupTest.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/AssemblyTool/test/Ringtoets.AssemblyTool.Forms.Test/Ringtoets.AssemblyTool.Forms.Test.csproj =================================================================== diff -u -r20410c8a25492802a771e8a90144d3805780f62e -r04bef178c846add660097aeab97e3d35aefd939b --- Ringtoets/AssemblyTool/test/Ringtoets.AssemblyTool.Forms.Test/Ringtoets.AssemblyTool.Forms.Test.csproj (.../Ringtoets.AssemblyTool.Forms.Test.csproj) (revision 20410c8a25492802a771e8a90144d3805780f62e) +++ Ringtoets/AssemblyTool/test/Ringtoets.AssemblyTool.Forms.Test/Ringtoets.AssemblyTool.Forms.Test.csproj (.../Ringtoets.AssemblyTool.Forms.Test.csproj) (revision 04bef178c846add660097aeab97e3d35aefd939b) @@ -14,9 +14,7 @@ - - Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/AssessmentSectionAssemblyCategoryRow.cs =================================================================== diff -u -reda6f4a88f954fb580d72368c675254159425e43 -r04bef178c846add660097aeab97e3d35aefd939b --- Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/AssessmentSectionAssemblyCategoryRow.cs (.../AssessmentSectionAssemblyCategoryRow.cs) (revision eda6f4a88f954fb580d72368c675254159425e43) +++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/AssessmentSectionAssemblyCategoryRow.cs (.../AssessmentSectionAssemblyCategoryRow.cs) (revision 04bef178c846add660097aeab97e3d35aefd939b) @@ -24,7 +24,6 @@ using System.Drawing; using Core.Common.Util; using Ringtoets.AssemblyTool.Data; -using Ringtoets.AssemblyTool.Forms; using Ringtoets.Common.Forms.Helpers; using Ringtoets.Common.Forms.TypeConverters; @@ -48,8 +47,7 @@ throw new ArgumentNullException(nameof(assessmentSectionAssemblyCategory)); } - Group = new EnumDisplayWrapper( - DisplayAssessmentSectionAssemblyCategoryGroupConverter.Convert(assessmentSectionAssemblyCategory.Group)).DisplayName; + Group = new EnumDisplayWrapper(assessmentSectionAssemblyCategory.Group).DisplayName; Color = AssemblyCategoryGroupHelper.GetAssessmentSectionAssemblyCategoryGroupColor(assessmentSectionAssemblyCategory.Group); UpperBoundary = assessmentSectionAssemblyCategory.UpperBoundary; LowerBoundary = assessmentSectionAssemblyCategory.LowerBoundary; Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/AssessmentSectionAssemblyCategoriesTableTest.cs =================================================================== diff -u -r723f31df6ebe679dd2e20de9ee3095f242379631 -r04bef178c846add660097aeab97e3d35aefd939b --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/AssessmentSectionAssemblyCategoriesTableTest.cs (.../AssessmentSectionAssemblyCategoriesTableTest.cs) (revision 723f31df6ebe679dd2e20de9ee3095f242379631) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/AssessmentSectionAssemblyCategoriesTableTest.cs (.../AssessmentSectionAssemblyCategoriesTableTest.cs) (revision 04bef178c846add660097aeab97e3d35aefd939b) @@ -26,7 +26,6 @@ using Core.Common.Util; using NUnit.Framework; using Ringtoets.AssemblyTool.Data; -using Ringtoets.AssemblyTool.Forms; using Ringtoets.Common.Forms.Helpers; using Ringtoets.Integration.Forms.Views; @@ -164,8 +163,7 @@ AssessmentSectionAssemblyCategory category = categories[i]; DataGridViewCellCollection rowCells = table.Rows[i].Cells; - Assert.AreEqual(new EnumDisplayWrapper( - DisplayAssessmentSectionAssemblyCategoryGroupConverter.Convert(category.Group)).DisplayName, rowCells[categoryGroupColumnIndex].Value); + Assert.AreEqual(new EnumDisplayWrapper(category.Group).DisplayName, rowCells[categoryGroupColumnIndex].Value); Assert.AreEqual(AssemblyCategoryGroupHelper.GetAssessmentSectionAssemblyCategoryGroupColor(category.Group), rowCells[colorColumnIndex].Value); Assert.AreEqual(category.LowerBoundary, rowCells[lowerBoundaryColumnIndex].Value); Assert.AreEqual(category.UpperBoundary, rowCells[upperBoundaryColumnIndex].Value); Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/AssessmentSectionAssemblyCategoryRowTest.cs =================================================================== diff -u -r4d5f18805638d24f450406e9eda206b2f3591c36 -r04bef178c846add660097aeab97e3d35aefd939b --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/AssessmentSectionAssemblyCategoryRowTest.cs (.../AssessmentSectionAssemblyCategoryRowTest.cs) (revision 4d5f18805638d24f450406e9eda206b2f3591c36) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/AssessmentSectionAssemblyCategoryRowTest.cs (.../AssessmentSectionAssemblyCategoryRowTest.cs) (revision 04bef178c846add660097aeab97e3d35aefd939b) @@ -21,10 +21,8 @@ using System; using Core.Common.TestUtil; -using Core.Common.Util; using NUnit.Framework; using Ringtoets.AssemblyTool.Data; -using Ringtoets.AssemblyTool.Forms; using Ringtoets.Common.Forms.Helpers; using Ringtoets.Common.Forms.TypeConverters; using Ringtoets.Integration.Forms.Views; @@ -46,11 +44,16 @@ } [Test] - public void Constructor_WithAssessmentSectionAssemblyCategory_ExpectedValues() + [TestCase(AssessmentSectionAssemblyCategoryGroup.APlus, "A+")] + [TestCase(AssessmentSectionAssemblyCategoryGroup.A, "A")] + [TestCase(AssessmentSectionAssemblyCategoryGroup.B, "B")] + [TestCase(AssessmentSectionAssemblyCategoryGroup.C, "C")] + [TestCase(AssessmentSectionAssemblyCategoryGroup.D, "D")] + public void Constructor_WithAssessmentSectionAssemblyCategory_ExpectedValues( + AssessmentSectionAssemblyCategoryGroup categoryGroup, string expectedName) { // Setup var random = new Random(39); - var categoryGroup = random.NextEnumValue(); double lowerBoundary = random.NextDouble(); double upperBoundary = random.NextDouble(); var category = new AssessmentSectionAssemblyCategory(lowerBoundary, upperBoundary, categoryGroup); @@ -59,8 +62,7 @@ var categoryRow = new AssessmentSectionAssemblyCategoryRow(category); // Assert - Assert.AreEqual(new EnumDisplayWrapper( - DisplayAssessmentSectionAssemblyCategoryGroupConverter.Convert(categoryGroup)).DisplayName, categoryRow.Group); + Assert.AreEqual(expectedName, categoryRow.Group); Assert.AreEqual(AssemblyCategoryGroupHelper.GetAssessmentSectionAssemblyCategoryGroupColor(categoryGroup), categoryRow.Color); Assert.AreEqual(lowerBoundary, categoryRow.LowerBoundary); Assert.AreEqual(upperBoundary, categoryRow.UpperBoundary);