Fisheye: Tag 1d28de98daddf0f744f11cc1c1cdb5f1a6a2b966 refers to a dead (removed) revision in file `Riskeer/Integration/src/Riskeer.Integration.Forms/Views/AssemblyCategoryRow.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Index: Riskeer/Integration/src/Riskeer.Integration.Forms/Views/AssemblyGroupRow.cs
===================================================================
diff -u
--- Riskeer/Integration/src/Riskeer.Integration.Forms/Views/AssemblyGroupRow.cs (revision 0)
+++ Riskeer/Integration/src/Riskeer.Integration.Forms/Views/AssemblyGroupRow.cs (revision 1d28de98daddf0f744f11cc1c1cdb5f1a6a2b966)
@@ -0,0 +1,84 @@
+// Copyright (C) Stichting Deltares 2021. All rights reserved.
+//
+// This file is part of Riskeer.
+//
+// Riskeer is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+//
+// All names, logos, and references to "Deltares" are registered trademarks of
+// Stichting Deltares and remain full property of Stichting Deltares at all times.
+// All rights reserved.
+
+using System;
+using System.ComponentModel;
+using System.Drawing;
+using Core.Common.Util;
+using Riskeer.AssemblyTool.Data;
+using Riskeer.Common.Forms.TypeConverters;
+
+namespace Riskeer.Integration.Forms.Views
+{
+ ///
+ /// This class represents a row displaying the properties of an assembly group.
+ ///
+ /// The type of the enum to display.
+ internal class AssemblyGroupRow
+ where T : struct
+ {
+ ///
+ /// Creates a new instance of .
+ ///
+ /// The to use.
+ /// The belonging to this group.
+ /// The actual assembly group.
+ /// Thrown when
+ /// is null.
+ public AssemblyGroupRow(AssemblyGroupBoundaries assemblyGroupBoundaries,
+ Color assemblyColor,
+ T assemblyGroup)
+ {
+ if (assemblyGroupBoundaries == null)
+ {
+ throw new ArgumentNullException(nameof(assemblyGroupBoundaries));
+ }
+
+ Group = assemblyGroup;
+ Color = assemblyColor;
+ UpperBoundary = assemblyGroupBoundaries.UpperBoundary;
+ LowerBoundary = assemblyGroupBoundaries.LowerBoundary;
+ }
+
+ ///
+ /// Gets the display name of the assembly group.
+ ///
+ [TypeConverter(typeof(EnumTypeConverter))]
+ public T Group { get; }
+
+ ///
+ /// Gets the color of the assembly group.
+ ///
+ public Color Color { get; }
+
+ ///
+ /// Gets the lower boundary of the assembly group.
+ ///
+ [TypeConverter(typeof(NoProbabilityValueDoubleConverter))]
+ public double LowerBoundary { get; }
+
+ ///
+ /// Gets the upper boundary of the assembly group.
+ ///
+ [TypeConverter(typeof(NoProbabilityValueDoubleConverter))]
+ public double UpperBoundary { get; }
+ }
+}
\ No newline at end of file
Index: Riskeer/Integration/src/Riskeer.Integration.Forms/Views/AssemblyGroupsTable.cs
===================================================================
diff -u -rfb551ab3c861e1e8c2ffd868885ee68bf7041067 -r1d28de98daddf0f744f11cc1c1cdb5f1a6a2b966
--- Riskeer/Integration/src/Riskeer.Integration.Forms/Views/AssemblyGroupsTable.cs (.../AssemblyGroupsTable.cs) (revision fb551ab3c861e1e8c2ffd868885ee68bf7041067)
+++ Riskeer/Integration/src/Riskeer.Integration.Forms/Views/AssemblyGroupsTable.cs (.../AssemblyGroupsTable.cs) (revision 1d28de98daddf0f744f11cc1c1cdb5f1a6a2b966)
@@ -50,23 +50,23 @@
/// The collection of .
public void SetData(IEnumerable> groups)
{
- SetDataSource(groups?.Select(group => new AssemblyCategoryRow(group.Item1, group.Item2, group.Item3)).ToArray());
+ SetDataSource(groups?.Select(group => new AssemblyGroupRow(group.Item1, group.Item2, group.Item3)).ToArray());
}
private void AddColumns()
{
- AddTextBoxColumn(nameof(AssemblyCategoryRow.Group),
+ AddTextBoxColumn(nameof(AssemblyGroupRow.Group),
RiskeerCommonFormsResources.AssemblyGroup_Group_DisplayName,
true);
- AddColorColumn(nameof(AssemblyCategoryRow.Color),
+ AddColorColumn(nameof(AssemblyGroupRow.Color),
RiskeerCommonFormsResources.AssemblyGroup_Color_DisplayName);
- AddTextBoxColumn(nameof(AssemblyCategoryRow.LowerBoundary),
+ AddTextBoxColumn(nameof(AssemblyGroupRow.LowerBoundary),
RiskeerCommonFormsResources.AssemblyGroup_LowerBoundary_DisplayName,
true);
- AddTextBoxColumn(nameof(AssemblyCategoryRow.UpperBoundary),
+ AddTextBoxColumn(nameof(AssemblyGroupRow.UpperBoundary),
RiskeerCommonFormsResources.AssemblyGroup_UpperBoundary_DisplayName,
true);
}
Fisheye: Tag 1d28de98daddf0f744f11cc1c1cdb5f1a6a2b966 refers to a dead (removed) revision in file `Riskeer/Integration/test/Riskeer.Integration.Forms.Test/Views/AssemblyCategoryRowTest.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Index: Riskeer/Integration/test/Riskeer.Integration.Forms.Test/Views/AssemblyGroupRowTest.cs
===================================================================
diff -u
--- Riskeer/Integration/test/Riskeer.Integration.Forms.Test/Views/AssemblyGroupRowTest.cs (revision 0)
+++ Riskeer/Integration/test/Riskeer.Integration.Forms.Test/Views/AssemblyGroupRowTest.cs (revision 1d28de98daddf0f744f11cc1c1cdb5f1a6a2b966)
@@ -0,0 +1,93 @@
+// Copyright (C) Stichting Deltares 2021. All rights reserved.
+//
+// This file is part of Riskeer.
+//
+// Riskeer is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+//
+// All names, logos, and references to "Deltares" are registered trademarks of
+// Stichting Deltares and remain full property of Stichting Deltares at all times.
+// All rights reserved.
+
+using System;
+using System.Drawing;
+using Core.Common.TestUtil;
+using Core.Common.Util;
+using NUnit.Framework;
+using Riskeer.AssemblyTool.Data;
+using Riskeer.Common.Forms.TypeConverters;
+using Riskeer.Integration.Forms.Views;
+
+namespace Riskeer.Integration.Forms.Test.Views
+{
+ [TestFixture]
+ public class AssemblyGroupRowTest
+ {
+ [Test]
+ public void Constructor_AssemblyGroupBoundariesNull_ThrowsArgumentNullException()
+ {
+ // Setup
+ var random = new Random(39);
+
+ // Call
+ void Call() => new AssemblyGroupRow(null,
+ Color.FromKnownColor(random.NextEnumValue()),
+ random.NextEnumValue());
+
+ // Assert
+ string paramName = Assert.Throws(Call).ParamName;
+ Assert.AreEqual("assemblyGroupBoundaries", paramName);
+ }
+
+ [Test]
+ public void Constructor_WithAssemblyGroup_ExpectedValues()
+ {
+ // Setup
+ var random = new Random(39);
+ double lowerBoundary = random.NextDouble();
+ double upperBoundary = random.NextDouble();
+ var group = random.NextEnumValue();
+ var color = Color.FromKnownColor(random.NextEnumValue());
+ var assemblyGroupBoundaries = new TestAssemblyGroupBoundaries(lowerBoundary, upperBoundary);
+
+ // Call
+ var groupRow = new AssemblyGroupRow(assemblyGroupBoundaries, color, group);
+
+ // Assert
+ Assert.AreEqual(group, groupRow.Group);
+ Assert.AreEqual(color, groupRow.Color);
+ Assert.AreEqual(lowerBoundary, groupRow.LowerBoundary);
+ Assert.AreEqual(upperBoundary, groupRow.UpperBoundary);
+
+ TestHelper.AssertTypeConverter,
+ EnumTypeConverter>(nameof(AssemblyGroupRow.Group));
+ TestHelper.AssertTypeConverter,
+ NoProbabilityValueDoubleConverter>(
+ nameof(AssemblyGroupRow.LowerBoundary));
+ TestHelper.AssertTypeConverter,
+ NoProbabilityValueDoubleConverter>(
+ nameof(AssemblyGroupRow.UpperBoundary));
+ }
+
+ private class TestAssemblyGroupBoundaries : AssemblyGroupBoundaries
+ {
+ public TestAssemblyGroupBoundaries(double lowerBoundary, double upperBoundary)
+ : base(lowerBoundary, upperBoundary) {}
+ }
+
+ private enum TestAssemblyGroup
+ {
+ I = 1
+ }
+ }
+}
\ No newline at end of file
Index: Riskeer/Integration/test/Riskeer.Integration.Forms.Test/Views/AssemblyGroupsViewTest.cs
===================================================================
diff -u -r5d3fcfc76fcab0152f1b9046a4b0cdd84f08ba46 -r1d28de98daddf0f744f11cc1c1cdb5f1a6a2b966
--- Riskeer/Integration/test/Riskeer.Integration.Forms.Test/Views/AssemblyGroupsViewTest.cs (.../AssemblyGroupsViewTest.cs) (revision 5d3fcfc76fcab0152f1b9046a4b0cdd84f08ba46)
+++ Riskeer/Integration/test/Riskeer.Integration.Forms.Test/Views/AssemblyGroupsViewTest.cs (.../AssemblyGroupsViewTest.cs) (revision 1d28de98daddf0f744f11cc1c1cdb5f1a6a2b966)
@@ -151,7 +151,7 @@
// Assert
Assert.AreEqual(1, assemblyGroupsTable.Rows.Count);
- var row = (AssemblyCategoryRow) assemblyGroupsTable.Rows[0].DataBoundItem;
+ var row = (AssemblyGroupRow) assemblyGroupsTable.Rows[0].DataBoundItem;
Assert.AreEqual(DisplayFailureMechanismSectionAssemblyGroupConverter.Convert(failureMechanismSectionAssemblyGroup), row.Group);
Assert.AreEqual(lowerBoundary, row.LowerBoundary);
Assert.AreEqual(upperBoundary, row.UpperBoundary);