Index: Core/Components/src/Core.Components.DotSpatial/Converter/FeatureBasedMapDataConverter.cs
===================================================================
diff -u -reefc89546a801a4083259094a763fe7fd93b6c47 -rf3f69076f923a7b691bd550dd0d610ae913b0758
--- Core/Components/src/Core.Components.DotSpatial/Converter/FeatureBasedMapDataConverter.cs (.../FeatureBasedMapDataConverter.cs) (revision eefc89546a801a4083259094a763fe7fd93b6c47)
+++ Core/Components/src/Core.Components.DotSpatial/Converter/FeatureBasedMapDataConverter.cs (.../FeatureBasedMapDataConverter.cs) (revision f3f69076f923a7b691bd550dd0d610ae913b0758)
@@ -185,7 +185,7 @@
foreach (CategoryTheme categoryTheme in mapTheme.CategoryThemes)
{
IFeatureCategory category = CreateCategory(mapData, categoryTheme.Color);
- category.FilterExpression = CreateFilterExpression(attributeIndex, categoryTheme.Criteria);
+ category.FilterExpression = CreateFilterExpression(attributeIndex, categoryTheme.Criterion);
scheme.AddCategory(category);
}
@@ -269,22 +269,22 @@
/// Creates a filter expression based for an attribute and the criteria to apply.
///
/// The index of the attribute in the metadata table.
- /// The criteria to convert to an expression.
+ /// The criterion to convert to an expression.
/// The filter expression based on the
- /// and .
- /// Thrown when the
+ /// and .
+ /// Thrown when the
/// cannot be used to create a filter expression.
- private static string CreateFilterExpression(int attributeIndex, ValueCriteria criteria)
+ private static string CreateFilterExpression(int attributeIndex, ValueCriterion criterion)
{
- ValueCriteriaOperator valueOperator = criteria.ValueOperator;
+ ValueCriterionOperator valueOperator = criterion.ValueOperator;
switch (valueOperator)
{
- case ValueCriteriaOperator.EqualValue:
- return $"[{attributeIndex}] = '{criteria.Value}'";
- case ValueCriteriaOperator.UnequalValue:
- return $"NOT [{attributeIndex}] = '{criteria.Value}'";
+ case ValueCriterionOperator.EqualValue:
+ return $"[{attributeIndex}] = '{criterion.Value}'";
+ case ValueCriterionOperator.UnequalValue:
+ return $"NOT [{attributeIndex}] = '{criterion.Value}'";
default:
- throw new NotSupportedException($"The enum value {nameof(ValueCriteriaOperator)}.{valueOperator} is not supported.");
+ throw new NotSupportedException($"The enum value {nameof(ValueCriterionOperator)}.{valueOperator} is not supported.");
}
}
}
Index: Core/Components/src/Core.Components.Gis/Core.Components.Gis.csproj
===================================================================
diff -u -reefc89546a801a4083259094a763fe7fd93b6c47 -rf3f69076f923a7b691bd550dd0d610ae913b0758
--- Core/Components/src/Core.Components.Gis/Core.Components.Gis.csproj (.../Core.Components.Gis.csproj) (revision eefc89546a801a4083259094a763fe7fd93b6c47)
+++ Core/Components/src/Core.Components.Gis/Core.Components.Gis.csproj (.../Core.Components.Gis.csproj) (revision f3f69076f923a7b691bd550dd0d610ae913b0758)
@@ -13,8 +13,8 @@
-
-
+
+
Index: Core/Components/src/Core.Components.Gis/Theme/CategoryTheme.cs
===================================================================
diff -u -reefc89546a801a4083259094a763fe7fd93b6c47 -rf3f69076f923a7b691bd550dd0d610ae913b0758
--- Core/Components/src/Core.Components.Gis/Theme/CategoryTheme.cs (.../CategoryTheme.cs) (revision eefc89546a801a4083259094a763fe7fd93b6c47)
+++ Core/Components/src/Core.Components.Gis/Theme/CategoryTheme.cs (.../CategoryTheme.cs) (revision f3f69076f923a7b691bd550dd0d610ae913b0758)
@@ -33,18 +33,18 @@
/// Creates a new instance of .
///
/// The color to be applied for the theme.
- /// The criteria belonging to the category.
- /// Thrown when
+ /// The criterion belonging to the category.
+ /// Thrown when
/// is null.
- public CategoryTheme(Color themeColor, ValueCriteria criteria)
+ public CategoryTheme(Color themeColor, ValueCriterion criterion)
{
- if (criteria == null)
+ if (criterion == null)
{
- throw new ArgumentNullException(nameof(criteria));
+ throw new ArgumentNullException(nameof(criterion));
}
Color = themeColor;
- Criteria = criteria;
+ Criterion = criterion;
}
///
@@ -53,8 +53,8 @@
public Color Color { get; }
///
- /// Gets the criteria that is associated with the category theme.
+ /// Gets the criterion that is associated with the category theme.
///
- public ValueCriteria Criteria { get; }
+ public ValueCriterion Criterion { get; }
}
}
\ No newline at end of file
Fisheye: Tag f3f69076f923a7b691bd550dd0d610ae913b0758 refers to a dead (removed) revision in file `Core/Components/src/Core.Components.Gis/Theme/ValueCriteria.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag f3f69076f923a7b691bd550dd0d610ae913b0758 refers to a dead (removed) revision in file `Core/Components/src/Core.Components.Gis/Theme/ValueCriteriaOperator.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Index: Core/Components/src/Core.Components.Gis/Theme/ValueCriterion.cs
===================================================================
diff -u
--- Core/Components/src/Core.Components.Gis/Theme/ValueCriterion.cs (revision 0)
+++ Core/Components/src/Core.Components.Gis/Theme/ValueCriterion.cs (revision f3f69076f923a7b691bd550dd0d610ae913b0758)
@@ -0,0 +1,62 @@
+// 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 Lesser 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 Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser 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;
+
+namespace Core.Components.Gis.Theme
+{
+ ///
+ /// Criterion to be used for equal or unequal values.
+ ///
+ public class ValueCriterion
+ {
+ ///
+ /// Creates a new instance of .
+ ///
+ /// The belonging to this criterion.
+ /// The value to apply when using this criteria.
+ /// Thrown when
+ /// contains an invalid value for .
+ public ValueCriterion(ValueCriterionOperator valueOperator, double value)
+ {
+ if (!Enum.IsDefined(typeof(ValueCriterionOperator), valueOperator))
+ {
+ throw new InvalidEnumArgumentException(nameof(valueOperator),
+ (int) valueOperator,
+ typeof(ValueCriterionOperator));
+ }
+
+ ValueOperator = valueOperator;
+ Value = value;
+ }
+
+ ///
+ /// Gets the operator for the criteria.
+ ///
+ public ValueCriterionOperator ValueOperator { get; }
+
+ ///
+ /// Gets the value that belongs to the criteria.
+ ///
+ public double Value { get; }
+ }
+}
\ No newline at end of file
Index: Core/Components/src/Core.Components.Gis/Theme/ValueCriterionOperator.cs
===================================================================
diff -u
--- Core/Components/src/Core.Components.Gis/Theme/ValueCriterionOperator.cs (revision 0)
+++ Core/Components/src/Core.Components.Gis/Theme/ValueCriterionOperator.cs (revision f3f69076f923a7b691bd550dd0d610ae913b0758)
@@ -0,0 +1,39 @@
+// 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 Lesser 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 Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser 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.
+
+namespace Core.Components.Gis.Theme
+{
+ ///
+ /// Defines the operators of an equality based criterion.
+ ///
+ public enum ValueCriterionOperator
+ {
+ ///
+ /// Represents the operator '=='
+ ///
+ EqualValue = 1,
+
+ ///
+ /// Represents the operator '!='
+ ///
+ UnequalValue = 2
+ }
+}
\ No newline at end of file
Index: Core/Components/test/Core.Components.DotSpatial.Test/Converter/FeatureBasedMapDataConverterTest.cs
===================================================================
diff -u -r7342ccce69e53838422f3fd9e96029d674ceacb4 -rf3f69076f923a7b691bd550dd0d610ae913b0758
--- Core/Components/test/Core.Components.DotSpatial.Test/Converter/FeatureBasedMapDataConverterTest.cs (.../FeatureBasedMapDataConverterTest.cs) (revision 7342ccce69e53838422f3fd9e96029d674ceacb4)
+++ Core/Components/test/Core.Components.DotSpatial.Test/Converter/FeatureBasedMapDataConverterTest.cs (.../FeatureBasedMapDataConverterTest.cs) (revision f3f69076f923a7b691bd550dd0d610ae913b0758)
@@ -524,8 +524,8 @@
var theme = new MapTheme("Meta", new[]
{
new CategoryTheme(Color.FromKnownColor(random.NextEnum()),
- new ValueCriteria(random.NextEnum(),
- random.NextDouble()))
+ new ValueCriterion(random.NextEnum(),
+ random.NextDouble()))
});
var mapData = new TestFeatureBasedMapData("test data")
@@ -554,9 +554,9 @@
}
[Test]
- [TestCase(ValueCriteriaOperator.EqualValue, "[1] = '{0}'", TestName = "EqualValue")]
- [TestCase(ValueCriteriaOperator.UnequalValue, "NOT [1] = '{0}'", TestName = "UnequalValue")]
- public void ConvertLayerProperties_MapDataWithMapThemeAndValidValueCriteria_SetsCorrectFilterExpression(ValueCriteriaOperator criteriaOperator,
+ [TestCase(ValueCriterionOperator.EqualValue, "[1] = '{0}'", TestName = "EqualValue")]
+ [TestCase(ValueCriterionOperator.UnequalValue, "NOT [1] = '{0}'", TestName = "UnequalValue")]
+ public void ConvertLayerProperties_MapDataWithMapThemeAndValidValueCriteria_SetsCorrectFilterExpression(ValueCriterionOperator criterionOperator,
string expressionFormat)
{
// Setup
@@ -568,12 +568,12 @@
var defaultCategory = new PointCategory();
var category = new PointCategory();
- var valueCriteria = new ValueCriteria(criteriaOperator,
- value);
+ var valueCriterion = new ValueCriterion(criterionOperator,
+ value);
var theme = new MapTheme(metadataAttributeName, new[]
{
new CategoryTheme(Color.FromKnownColor(random.NextEnum()),
- valueCriteria)
+ valueCriterion)
});
var mapData = new TestFeatureBasedMapData("test data")
Index: Core/Components/test/Core.Components.DotSpatial.Test/Converter/MapLineDataConverterTest.cs
===================================================================
diff -u -r24d0467d90ae44ab5630a29f761f4e33ced2a5f4 -rf3f69076f923a7b691bd550dd0d610ae913b0758
--- Core/Components/test/Core.Components.DotSpatial.Test/Converter/MapLineDataConverterTest.cs (.../MapLineDataConverterTest.cs) (revision 24d0467d90ae44ab5630a29f761f4e33ced2a5f4)
+++ Core/Components/test/Core.Components.DotSpatial.Test/Converter/MapLineDataConverterTest.cs (.../MapLineDataConverterTest.cs) (revision f3f69076f923a7b691bd550dd0d610ae913b0758)
@@ -198,16 +198,16 @@
const string metadataAttribute = "Meta";
var random = new Random(21);
- var unequalCriteria = new ValueCriteria(ValueCriteriaOperator.UnequalValue,
+ var unequalCriterion = new ValueCriterion(ValueCriterionOperator.UnequalValue,
+ random.NextDouble());
+ var equalCriterion = new ValueCriterion(ValueCriterionOperator.EqualValue,
random.NextDouble());
- var equalCriteria = new ValueCriteria(ValueCriteriaOperator.EqualValue,
- random.NextDouble());
var theme = new MapTheme(metadataAttribute, new[]
{
new CategoryTheme(Color.FromKnownColor(random.NextEnum()),
- equalCriteria),
+ equalCriterion),
new CategoryTheme(Color.FromKnownColor(random.NextEnum()),
- unequalCriteria)
+ unequalCriterion)
});
var lineStyle = new LineStyle
@@ -246,15 +246,15 @@
Assert.IsNull(baseCategory.FilterExpression);
ILineCategory equalSchemeCategory = appliedScheme.Categories[1];
- string expectedFilter = $"[1] = '{equalCriteria.Value}'";
+ string expectedFilter = $"[1] = '{equalCriterion.Value}'";
Assert.AreEqual(expectedFilter, equalSchemeCategory.FilterExpression);
expectedSymbolizer = CreateExpectedSymbolizer(lineStyle,
expectedDashStyle,
theme.CategoryThemes.ElementAt(0).Color);
AssertAreEqual(expectedSymbolizer, equalSchemeCategory.Symbolizer);
ILineCategory unEqualSchemeCategory = appliedScheme.Categories[2];
- expectedFilter = $"NOT [1] = '{unequalCriteria.Value}'";
+ expectedFilter = $"NOT [1] = '{unequalCriterion.Value}'";
Assert.AreEqual(expectedFilter, unEqualSchemeCategory.FilterExpression);
expectedSymbolizer = CreateExpectedSymbolizer(lineStyle,
expectedDashStyle,
Index: Core/Components/test/Core.Components.DotSpatial.Test/Converter/MapPointDataConverterTest.cs
===================================================================
diff -u -r24d0467d90ae44ab5630a29f761f4e33ced2a5f4 -rf3f69076f923a7b691bd550dd0d610ae913b0758
--- Core/Components/test/Core.Components.DotSpatial.Test/Converter/MapPointDataConverterTest.cs (.../MapPointDataConverterTest.cs) (revision 24d0467d90ae44ab5630a29f761f4e33ced2a5f4)
+++ Core/Components/test/Core.Components.DotSpatial.Test/Converter/MapPointDataConverterTest.cs (.../MapPointDataConverterTest.cs) (revision f3f69076f923a7b691bd550dd0d610ae913b0758)
@@ -192,16 +192,16 @@
const string metadataAttribute = "Meta";
var random = new Random(21);
- var unequalCriteria = new ValueCriteria(ValueCriteriaOperator.UnequalValue,
- random.NextDouble());
- var equalCriteria = new ValueCriteria(ValueCriteriaOperator.EqualValue,
- random.NextDouble());
+ var unequalCriterion = new ValueCriterion(ValueCriterionOperator.UnequalValue,
+ random.NextDouble());
+ var equalCriterion = new ValueCriterion(ValueCriterionOperator.EqualValue,
+ random.NextDouble());
var theme = new MapTheme(metadataAttribute, new[]
{
new CategoryTheme(Color.FromKnownColor(random.NextEnum()),
- equalCriteria),
+ equalCriterion),
new CategoryTheme(Color.FromKnownColor(random.NextEnum()),
- unequalCriteria)
+ unequalCriterion)
});
var pointStyle = new PointStyle
@@ -242,15 +242,15 @@
Assert.IsNull(baseCategory.FilterExpression);
IPointCategory equalSchemeCategory = appliedScheme.Categories[1];
- string expectedFilter = $"[1] = '{equalCriteria.Value}'";
+ string expectedFilter = $"[1] = '{equalCriterion.Value}'";
Assert.AreEqual(expectedFilter, equalSchemeCategory.FilterExpression);
expectedSymbolizer = CreateExpectedSymbolizer(pointStyle,
expectedPointShape,
theme.CategoryThemes.ElementAt(0).Color);
AssertAreEqual(expectedSymbolizer, equalSchemeCategory.Symbolizer);
IPointCategory unEqualSchemeCategory = appliedScheme.Categories[2];
- expectedFilter = $"NOT [1] = '{unequalCriteria.Value}'";
+ expectedFilter = $"NOT [1] = '{unequalCriterion.Value}'";
Assert.AreEqual(expectedFilter, unEqualSchemeCategory.FilterExpression);
expectedSymbolizer = CreateExpectedSymbolizer(pointStyle,
expectedPointShape,
Index: Core/Components/test/Core.Components.DotSpatial.Test/Converter/MapPolygonDataConverterTest.cs
===================================================================
diff -u -r24d0467d90ae44ab5630a29f761f4e33ced2a5f4 -rf3f69076f923a7b691bd550dd0d610ae913b0758
--- Core/Components/test/Core.Components.DotSpatial.Test/Converter/MapPolygonDataConverterTest.cs (.../MapPolygonDataConverterTest.cs) (revision 24d0467d90ae44ab5630a29f761f4e33ced2a5f4)
+++ Core/Components/test/Core.Components.DotSpatial.Test/Converter/MapPolygonDataConverterTest.cs (.../MapPolygonDataConverterTest.cs) (revision f3f69076f923a7b691bd550dd0d610ae913b0758)
@@ -277,16 +277,16 @@
const string metadataAttribute = "Meta";
var random = new Random(21);
- var unequalCriteria = new ValueCriteria(ValueCriteriaOperator.UnequalValue,
+ var unequalCriterion = new ValueCriterion(ValueCriterionOperator.UnequalValue,
+ random.NextDouble());
+ var equalCriterion = new ValueCriterion(ValueCriterionOperator.EqualValue,
random.NextDouble());
- var equalCriteria = new ValueCriteria(ValueCriteriaOperator.EqualValue,
- random.NextDouble());
var theme = new MapTheme(metadataAttribute, new[]
{
new CategoryTheme(Color.FromKnownColor(random.NextEnum()),
- equalCriteria),
+ equalCriterion),
new CategoryTheme(Color.FromKnownColor(random.NextEnum()),
- unequalCriteria)
+ unequalCriterion)
});
var polygonStyle = new PolygonStyle
@@ -322,14 +322,14 @@
Assert.IsNull(baseCategory.FilterExpression);
IPolygonCategory equalSchemeCategory = appliedScheme.Categories[1];
- string expectedFilter = $"[1] = '{equalCriteria.Value}'";
+ string expectedFilter = $"[1] = '{equalCriterion.Value}'";
Assert.AreEqual(expectedFilter, equalSchemeCategory.FilterExpression);
expectedSymbolizer = CreateExpectedSymbolizer(polygonStyle,
theme.CategoryThemes.ElementAt(0).Color);
AssertAreEqual(expectedSymbolizer, equalSchemeCategory.Symbolizer);
IPolygonCategory unEqualSchemeCategory = appliedScheme.Categories[2];
- expectedFilter = $"NOT [1] = '{unequalCriteria.Value}'";
+ expectedFilter = $"NOT [1] = '{unequalCriterion.Value}'";
Assert.AreEqual(expectedFilter, unEqualSchemeCategory.FilterExpression);
expectedSymbolizer = CreateExpectedSymbolizer(polygonStyle,
theme.CategoryThemes.ElementAt(1).Color);
Index: Core/Components/test/Core.Components.Gis.Test/Core.Components.Gis.Test.csproj
===================================================================
diff -u -r24d0467d90ae44ab5630a29f761f4e33ced2a5f4 -rf3f69076f923a7b691bd550dd0d610ae913b0758
--- Core/Components/test/Core.Components.Gis.Test/Core.Components.Gis.Test.csproj (.../Core.Components.Gis.Test.csproj) (revision 24d0467d90ae44ab5630a29f761f4e33ced2a5f4)
+++ Core/Components/test/Core.Components.Gis.Test/Core.Components.Gis.Test.csproj (.../Core.Components.Gis.Test.csproj) (revision f3f69076f923a7b691bd550dd0d610ae913b0758)
@@ -20,7 +20,7 @@
-
+
Index: Core/Components/test/Core.Components.Gis.Test/Theme/CategoryThemeTest.cs
===================================================================
diff -u -reefc89546a801a4083259094a763fe7fd93b6c47 -rf3f69076f923a7b691bd550dd0d610ae913b0758
--- Core/Components/test/Core.Components.Gis.Test/Theme/CategoryThemeTest.cs (.../CategoryThemeTest.cs) (revision eefc89546a801a4083259094a763fe7fd93b6c47)
+++ Core/Components/test/Core.Components.Gis.Test/Theme/CategoryThemeTest.cs (.../CategoryThemeTest.cs) (revision f3f69076f923a7b691bd550dd0d610ae913b0758)
@@ -24,15 +24,14 @@
using Core.Common.TestUtil;
using Core.Components.Gis.Theme;
using NUnit.Framework;
-using Rhino.Mocks;
namespace Core.Components.Gis.Test.Theme
{
[TestFixture]
public class CategoryThemeTest
{
[Test]
- public void Constructor_CriteriaNull_ThrowsArgumentNullException()
+ public void Constructor_CriterionNull_ThrowsArgumentNullException()
{
// Setup
var random = new Random(21);
@@ -43,25 +42,25 @@
// Assert
var exception = Assert.Throws(call);
- Assert.AreEqual("criteria", exception.ParamName);
+ Assert.AreEqual("criterion", exception.ParamName);
}
[Test]
public void Constructor_ValidArguments_ReturnsExpectedProperties()
{
// Setup
var random = new Random(21);
- var criteria = new ValueCriteria(random.NextEnumValue(),
- random.NextDouble());
+ var criterion = new ValueCriterion(random.NextEnumValue(),
+ random.NextDouble());
Color themeColor = Color.FromKnownColor(random.NextEnumValue());
// Call
- var category = new CategoryTheme(themeColor, criteria);
+ var category = new CategoryTheme(themeColor, criterion);
// Assert
Assert.AreEqual(themeColor, category.Color);
- Assert.AreSame(criteria, category.Criteria);
+ Assert.AreSame(criterion, category.Criterion);
}
}
}
\ No newline at end of file
Fisheye: Tag f3f69076f923a7b691bd550dd0d610ae913b0758 refers to a dead (removed) revision in file `Core/Components/test/Core.Components.Gis.Test/Theme/ValueCriteriaTest.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Index: Core/Components/test/Core.Components.Gis.Test/Theme/ValueCriterionTest.cs
===================================================================
diff -u
--- Core/Components/test/Core.Components.Gis.Test/Theme/ValueCriterionTest.cs (revision 0)
+++ Core/Components/test/Core.Components.Gis.Test/Theme/ValueCriterionTest.cs (revision f3f69076f923a7b691bd550dd0d610ae913b0758)
@@ -0,0 +1,65 @@
+// 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 Lesser 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 Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser 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 Core.Common.TestUtil;
+using Core.Components.Gis.Theme;
+using NUnit.Framework;
+
+namespace Core.Components.Gis.Test.Theme
+{
+ [TestFixture]
+ public class ValueCriterionTest
+ {
+ [Test]
+ public void Constructor_ReturnsExpectedProperties()
+ {
+ // Setup
+ var random = new Random(21);
+ var valueOperator = random.NextEnumValue();
+ double value = random.NextDouble();
+
+ // Call
+ var criteria = new ValueCriterion(valueOperator, value);
+
+ // Assert
+ Assert.AreEqual(valueOperator, criteria.ValueOperator);
+ Assert.AreEqual(value, criteria.Value);
+ }
+
+ [Test]
+ public void Constructor_InvalidOperator_ThrowsInvalidEnumArgumentException()
+ {
+ // Setup
+ var random = new Random(21);
+ const ValueCriterionOperator invalidOperator = (ValueCriterionOperator) 9999;
+
+ // Call
+ TestDelegate call = () => new ValueCriterion(invalidOperator, random.NextDouble());
+
+ // Assert
+ string expectedMessage = $"The value of argument 'valueOperator' ({invalidOperator}) is invalid for Enum type '{nameof(ValueCriterionOperator)}'.";
+ string parameterName = TestHelper.AssertThrowsArgumentExceptionAndTestMessage(call, expectedMessage).ParamName;
+ Assert.AreEqual("valueOperator", parameterName);
+ }
+ }
+}
\ No newline at end of file
Index: Core/Components/test/Core.Components.Gis.TestUtil.Test/CategoryThemeTestFactoryTest.cs
===================================================================
diff -u -r7342ccce69e53838422f3fd9e96029d674ceacb4 -rf3f69076f923a7b691bd550dd0d610ae913b0758
--- Core/Components/test/Core.Components.Gis.TestUtil.Test/CategoryThemeTestFactoryTest.cs (.../CategoryThemeTestFactoryTest.cs) (revision 7342ccce69e53838422f3fd9e96029d674ceacb4)
+++ Core/Components/test/Core.Components.Gis.TestUtil.Test/CategoryThemeTestFactoryTest.cs (.../CategoryThemeTestFactoryTest.cs) (revision f3f69076f923a7b691bd550dd0d610ae913b0758)
@@ -35,7 +35,7 @@
// Assert
Assert.AreEqual(Color.Aqua, theme.Color);
- Assert.IsNotNull(theme.Criteria);
+ Assert.IsNotNull(theme.Criterion);
}
}
}
\ No newline at end of file
Index: Core/Components/test/Core.Components.Gis.TestUtil/CategoryThemeTestFactory.cs
===================================================================
diff -u -r7342ccce69e53838422f3fd9e96029d674ceacb4 -rf3f69076f923a7b691bd550dd0d610ae913b0758
--- Core/Components/test/Core.Components.Gis.TestUtil/CategoryThemeTestFactory.cs (.../CategoryThemeTestFactory.cs) (revision 7342ccce69e53838422f3fd9e96029d674ceacb4)
+++ Core/Components/test/Core.Components.Gis.TestUtil/CategoryThemeTestFactory.cs (.../CategoryThemeTestFactory.cs) (revision f3f69076f923a7b691bd550dd0d610ae913b0758)
@@ -39,8 +39,8 @@
{
var random = new Random(21);
return new CategoryTheme(Color.Aqua,
- new ValueCriteria(random.NextEnumValue(),
- random.NextDouble()));
+ new ValueCriterion(random.NextEnumValue(),
+ random.NextDouble()));
}
}
}
\ No newline at end of file
Index: Demo/Ringtoets/src/Demo.Ringtoets/Commands/OpenThematicalMapViewCommand.cs
===================================================================
diff -u -r24d0467d90ae44ab5630a29f761f4e33ced2a5f4 -rf3f69076f923a7b691bd550dd0d610ae913b0758
--- Demo/Ringtoets/src/Demo.Ringtoets/Commands/OpenThematicalMapViewCommand.cs (.../OpenThematicalMapViewCommand.cs) (revision 24d0467d90ae44ab5630a29f761f4e33ced2a5f4)
+++ Demo/Ringtoets/src/Demo.Ringtoets/Commands/OpenThematicalMapViewCommand.cs (.../OpenThematicalMapViewCommand.cs) (revision f3f69076f923a7b691bd550dd0d610ae913b0758)
@@ -116,10 +116,10 @@
int nrOfFeatures = mapData.Features.Count();
var theme = new MapTheme("Waarde", new[]
{
- new CategoryTheme(Color.DarkOrange, new ValueCriteria(ValueCriteriaOperator.EqualValue, random.Next(0, nrOfFeatures))),
- new CategoryTheme(Color.OrangeRed, new ValueCriteria(ValueCriteriaOperator.EqualValue, random.Next(0, nrOfFeatures))),
- new CategoryTheme(Color.SkyBlue, new ValueCriteria(ValueCriteriaOperator.EqualValue, random.Next(0, nrOfFeatures))),
- new CategoryTheme(Color.GreenYellow, new ValueCriteria(ValueCriteriaOperator.EqualValue, random.Next(0, nrOfFeatures)))
+ new CategoryTheme(Color.DarkOrange, new ValueCriterion(ValueCriterionOperator.EqualValue, random.Next(0, nrOfFeatures))),
+ new CategoryTheme(Color.OrangeRed, new ValueCriterion(ValueCriterionOperator.EqualValue, random.Next(0, nrOfFeatures))),
+ new CategoryTheme(Color.SkyBlue, new ValueCriterion(ValueCriterionOperator.EqualValue, random.Next(0, nrOfFeatures))),
+ new CategoryTheme(Color.GreenYellow, new ValueCriterion(ValueCriterionOperator.EqualValue, random.Next(0, nrOfFeatures)))
});
mapData.MapTheme = theme;
@@ -131,7 +131,7 @@
int nrOfFeatures = mapData.Features.Count();
var theme = new MapTheme("Waarde", new[]
{
- new CategoryTheme(Color.Purple, new ValueCriteria(ValueCriteriaOperator.UnequalValue, random.Next(0, nrOfFeatures)))
+ new CategoryTheme(Color.Purple, new ValueCriterion(ValueCriterionOperator.UnequalValue, random.Next(0, nrOfFeatures)))
});
mapData.MapTheme = theme;