Index: Core/Components/src/Core.Components.Gis/Theme/MapTheme.cs =================================================================== diff -u -r2a81f01756e227d5ce93717b21b87e8a5cd5fcbb -r0360ee3f46482f5a322c28e10aa1e7f23e999c12 --- Core/Components/src/Core.Components.Gis/Theme/MapTheme.cs (.../MapTheme.cs) (revision 2a81f01756e227d5ce93717b21b87e8a5cd5fcbb) +++ Core/Components/src/Core.Components.Gis/Theme/MapTheme.cs (.../MapTheme.cs) (revision 0360ee3f46482f5a322c28e10aa1e7f23e999c12) @@ -26,13 +26,14 @@ namespace Core.Components.Gis.Theme { /// - /// Class that contains the definition for a categorial theming of + /// Class that contains the definition for a categorical theming of /// map data objects. /// - public class MapTheme + /// The type of category theme for the categorical theming. + public class MapTheme where TCategoryTheme : CategoryTheme { /// - /// Creates a new instance of . + /// Creates a new instance of . /// /// The name of the attribute to which the theme is applicable for. /// The category themes that are applicable for the map theme. @@ -42,7 +43,7 @@ /// is null, empty or consists of only whitespace. /// is empty. /// - public MapTheme(string attributeName, IEnumerable categoryThemes) + public MapTheme(string attributeName, IEnumerable categoryThemes) { if (string.IsNullOrWhiteSpace(attributeName)) { @@ -71,6 +72,6 @@ /// /// Gets the category themes that are applicable for the theme. /// - public IEnumerable CategoryThemes { get; } + public IEnumerable CategoryThemes { get; } } } \ No newline at end of file Index: Core/Components/test/Core.Components.Gis.Test/Theme/MapThemeTest.cs =================================================================== diff -u -r2a81f01756e227d5ce93717b21b87e8a5cd5fcbb -r0360ee3f46482f5a322c28e10aa1e7f23e999c12 --- Core/Components/test/Core.Components.Gis.Test/Theme/MapThemeTest.cs (.../MapThemeTest.cs) (revision 2a81f01756e227d5ce93717b21b87e8a5cd5fcbb) +++ Core/Components/test/Core.Components.Gis.Test/Theme/MapThemeTest.cs (.../MapThemeTest.cs) (revision 0360ee3f46482f5a322c28e10aa1e7f23e999c12) @@ -20,7 +20,6 @@ // All rights reserved. using System; -using System.Collections.Generic; using System.Linq; using Core.Common.TestUtil; using Core.Components.Gis.TestUtil; @@ -39,9 +38,9 @@ public void Constructor_InvalidAttribute_ThrowsArgumentException(string invalidAttributeName) { // Call - TestDelegate call = () => new MapTheme(invalidAttributeName, new[] + TestDelegate call = () => new MapTheme(invalidAttributeName, new[] { - CategoryThemeTestFactory.CreateCategoryTheme() + CreateCategoryTheme() }); // Assert @@ -53,7 +52,7 @@ public void Constructor_CategoryThemesNull_ThrowsArgumentNullException() { // Call - TestDelegate call = () => new MapTheme("Arbitrary attribute", null); + TestDelegate call = () => new MapTheme("Arbitrary attribute", null); // Assert var exception = Assert.Throws(call); @@ -63,11 +62,9 @@ [Test] public void Constructor_CategoryThemesEmpty_ThrowsArgumentException() { - // Setup - IEnumerable mapCategories = Enumerable.Empty(); - // Call - TestDelegate call = () => new MapTheme("Arbitrary attribute", mapCategories); + TestDelegate call = () => new MapTheme("Arbitrary attribute", + Enumerable.Empty()); // Assert const string expectedMessage = "categoryThemes is empty."; @@ -79,17 +76,27 @@ { // Setup const string attributeName = "Arbitrary attribute"; - CategoryTheme[] mapCategories = + TestCategoryTheme[] mapCategories = { - CategoryThemeTestFactory.CreateCategoryTheme() + CreateCategoryTheme() }; // Call - var theme = new MapTheme(attributeName, mapCategories); + var theme = new MapTheme(attributeName, mapCategories); // Assert Assert.AreEqual(attributeName, theme.AttributeName); Assert.AreSame(mapCategories, theme.CategoryThemes); } + + private static TestCategoryTheme CreateCategoryTheme() + { + return new TestCategoryTheme(ValueCriterionTestFactory.CreateValueCriterion()); + } + + private class TestCategoryTheme : CategoryTheme + { + public TestCategoryTheme(ValueCriterion criterion) : base(criterion) {} + } } } \ No newline at end of file