Index: Core/Components/src/Core.Components.Gis/Theme/CategoryTheme.cs =================================================================== diff -u -r2a81f01756e227d5ce93717b21b87e8a5cd5fcbb -r2534fcf82c58e32cd33a14a9d60fba9d13cf87ac --- Core/Components/src/Core.Components.Gis/Theme/CategoryTheme.cs (.../CategoryTheme.cs) (revision 2a81f01756e227d5ce93717b21b87e8a5cd5fcbb) +++ Core/Components/src/Core.Components.Gis/Theme/CategoryTheme.cs (.../CategoryTheme.cs) (revision 2534fcf82c58e32cd33a14a9d60fba9d13cf87ac) @@ -20,39 +20,31 @@ // All rights reserved. using System; -using System.Drawing; namespace Core.Components.Gis.Theme { /// /// Class to define themes for categories. /// - public class CategoryTheme + public abstract class CategoryTheme { /// /// Creates a new instance of . /// - /// The color to be applied for the theme. /// The criterion belonging to the category. /// Thrown when /// is null. - public CategoryTheme(Color themeColor, ValueCriterion criterion) + protected CategoryTheme(ValueCriterion criterion) { if (criterion == null) { throw new ArgumentNullException(nameof(criterion)); } - Color = themeColor; Criterion = criterion; } /// - /// Gets the color of the category theme. - /// - public Color Color { get; } - - /// /// Gets the criterion that is associated with the category theme. /// public ValueCriterion Criterion { get; } Index: Core/Components/src/Core.Components.Gis/Theme/LineCategoryTheme.cs =================================================================== diff -u -r0c45ab7d619015e9b177a38b37a01817dd4f2f25 -r2534fcf82c58e32cd33a14a9d60fba9d13cf87ac --- Core/Components/src/Core.Components.Gis/Theme/LineCategoryTheme.cs (.../LineCategoryTheme.cs) (revision 0c45ab7d619015e9b177a38b37a01817dd4f2f25) +++ Core/Components/src/Core.Components.Gis/Theme/LineCategoryTheme.cs (.../LineCategoryTheme.cs) (revision 2534fcf82c58e32cd33a14a9d60fba9d13cf87ac) @@ -37,7 +37,7 @@ /// The belonging to the category. /// The belonging to the category. /// Thrown when any parameter is null. - public LineCategoryTheme(ValueCriterion criterion, LineStyle style) : base(Color.AliceBlue, criterion) + public LineCategoryTheme(ValueCriterion criterion, LineStyle style) : base(criterion) { if (style == null) { Index: Core/Components/src/Core.Components.Gis/Theme/PointCategoryTheme.cs =================================================================== diff -u -r0c45ab7d619015e9b177a38b37a01817dd4f2f25 -r2534fcf82c58e32cd33a14a9d60fba9d13cf87ac --- Core/Components/src/Core.Components.Gis/Theme/PointCategoryTheme.cs (.../PointCategoryTheme.cs) (revision 0c45ab7d619015e9b177a38b37a01817dd4f2f25) +++ Core/Components/src/Core.Components.Gis/Theme/PointCategoryTheme.cs (.../PointCategoryTheme.cs) (revision 2534fcf82c58e32cd33a14a9d60fba9d13cf87ac) @@ -37,7 +37,7 @@ /// The belonging to the category. /// The belonging to the category. /// Thrown when any parameter is null. - public PointCategoryTheme(ValueCriterion criterion, PointStyle style) : base(Color.AliceBlue, criterion) + public PointCategoryTheme(ValueCriterion criterion, PointStyle style) : base(criterion) { if (style == null) { Index: Core/Components/src/Core.Components.Gis/Theme/PolygonCategoryTheme.cs =================================================================== diff -u -r0c45ab7d619015e9b177a38b37a01817dd4f2f25 -r2534fcf82c58e32cd33a14a9d60fba9d13cf87ac --- Core/Components/src/Core.Components.Gis/Theme/PolygonCategoryTheme.cs (.../PolygonCategoryTheme.cs) (revision 0c45ab7d619015e9b177a38b37a01817dd4f2f25) +++ Core/Components/src/Core.Components.Gis/Theme/PolygonCategoryTheme.cs (.../PolygonCategoryTheme.cs) (revision 2534fcf82c58e32cd33a14a9d60fba9d13cf87ac) @@ -37,7 +37,7 @@ /// The belonging to the category. /// The belonging to the category. /// Thrown when any parameter is null. - public PolygonCategoryTheme(ValueCriterion criterion, PolygonStyle style) : base(Color.AliceBlue, criterion) + public PolygonCategoryTheme(ValueCriterion criterion, PolygonStyle style) : base(criterion) { if (style == null) { Index: Core/Components/test/Core.Components.Gis.Test/Theme/CategoryThemeTest.cs =================================================================== diff -u -r47db7558d32767bc9f3635dbd4bc4506f6670523 -r2534fcf82c58e32cd33a14a9d60fba9d13cf87ac --- Core/Components/test/Core.Components.Gis.Test/Theme/CategoryThemeTest.cs (.../CategoryThemeTest.cs) (revision 47db7558d32767bc9f3635dbd4bc4506f6670523) +++ Core/Components/test/Core.Components.Gis.Test/Theme/CategoryThemeTest.cs (.../CategoryThemeTest.cs) (revision 2534fcf82c58e32cd33a14a9d60fba9d13cf87ac) @@ -20,8 +20,7 @@ // All rights reserved. using System; -using System.Drawing; -using Core.Common.TestUtil; +using Core.Components.Gis.TestUtil; using Core.Components.Gis.Theme; using NUnit.Framework; @@ -33,12 +32,8 @@ [Test] public void Constructor_CriterionNull_ThrowsArgumentNullException() { - // Setup - var random = new Random(21); - Color themeColor = Color.FromKnownColor(random.NextEnumValue()); - // Call - TestDelegate call = () => new CategoryTheme(themeColor, null); + TestDelegate call = () => new TestCategoryTheme(null); // Assert var exception = Assert.Throws(call); @@ -49,18 +44,18 @@ public void Constructor_ValidArguments_ReturnsExpectedProperties() { // Setup - var random = new Random(21); - var criterion = new ValueCriterion(random.NextEnumValue(), - string.Empty); + ValueCriterion criterion = ValueCriterionTestFactory.CreateValueCriterion(); - Color themeColor = Color.FromKnownColor(random.NextEnumValue()); - // Call - var category = new CategoryTheme(themeColor, criterion); + var category = new TestCategoryTheme(criterion); // Assert - Assert.AreEqual(themeColor, category.Color); Assert.AreSame(criterion, category.Criterion); } + + private class TestCategoryTheme : CategoryTheme + { + public TestCategoryTheme(ValueCriterion criterion) : base(criterion) {} + } } } \ No newline at end of file