Index: Core/Components/src/Core.Components.Gis/Core.Components.Gis.csproj =================================================================== diff -u -r49fc59dc9e08d2601389edb8b62aea031daeafba -r3c41a03f6a1173872af5d8507465e291f9e3f8f2 --- Core/Components/src/Core.Components.Gis/Core.Components.Gis.csproj (.../Core.Components.Gis.csproj) (revision 49fc59dc9e08d2601389edb8b62aea031daeafba) +++ Core/Components/src/Core.Components.Gis/Core.Components.Gis.csproj (.../Core.Components.Gis.csproj) (revision 3c41a03f6a1173872af5d8507465e291f9e3f8f2) @@ -12,7 +12,7 @@ - + Index: Core/Components/src/Core.Components.Gis/Data/FeatureBasedMapData.cs =================================================================== diff -u -r205d6bacdfb7da4a3f96e65cf4392135323ebd8d -r3c41a03f6a1173872af5d8507465e291f9e3f8f2 --- Core/Components/src/Core.Components.Gis/Data/FeatureBasedMapData.cs (.../FeatureBasedMapData.cs) (revision 205d6bacdfb7da4a3f96e65cf4392135323ebd8d) +++ Core/Components/src/Core.Components.Gis/Data/FeatureBasedMapData.cs (.../FeatureBasedMapData.cs) (revision 3c41a03f6a1173872af5d8507465e291f9e3f8f2) @@ -23,7 +23,7 @@ using System.Collections.Generic; using System.Linq; using Core.Components.Gis.Features; -using Core.Components.Gis.Themes; +using Core.Components.Gis.Theme; namespace Core.Components.Gis.Data { Index: Core/Components/src/Core.Components.Gis/Theme/CategoryTheme.cs =================================================================== diff -u --- Core/Components/src/Core.Components.Gis/Theme/CategoryTheme.cs (revision 0) +++ Core/Components/src/Core.Components.Gis/Theme/CategoryTheme.cs (revision 3c41a03f6a1173872af5d8507465e291f9e3f8f2) @@ -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.Collections.Generic; +using System.Drawing; +using Core.Components.Gis.Theme.Criteria; + +namespace Core.Components.Gis.Theme +{ + /// + /// Class to define themes for categories. + /// + public class CategoryTheme + { + /// + /// Creates a new instance of . + /// + /// The color to be applied for the theme. + /// The criteria belonging to the category. + /// Thrown when + /// is null. + public CategoryTheme(Color themeColor, ICriteria criteria) + { + if (criteria == null) + { + throw new ArgumentNullException(nameof(criteria)); + } + + Color = themeColor; + Criteria = criteria; + } + + /// + /// Gets the color of the category theme. + /// + public Color Color { get; } + + /// + /// Gets the criteria that is associated with the category theme. + /// + public ICriteria Criteria { get; } + } +} \ No newline at end of file Fisheye: Tag 3c41a03f6a1173872af5d8507465e291f9e3f8f2 refers to a dead (removed) revision in file `Core/Components/src/Core.Components.Gis/Theme/IMapCategory.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Core/Components/src/Core.Components.Gis/Theme/MapTheme.cs =================================================================== diff -u -r205d6bacdfb7da4a3f96e65cf4392135323ebd8d -r3c41a03f6a1173872af5d8507465e291f9e3f8f2 --- Core/Components/src/Core.Components.Gis/Theme/MapTheme.cs (.../MapTheme.cs) (revision 205d6bacdfb7da4a3f96e65cf4392135323ebd8d) +++ Core/Components/src/Core.Components.Gis/Theme/MapTheme.cs (.../MapTheme.cs) (revision 3c41a03f6a1173872af5d8507465e291f9e3f8f2) @@ -22,9 +22,8 @@ using System; using System.Collections.Generic; using System.Linq; -using Core.Components.Gis.Theme; -namespace Core.Components.Gis.Themes +namespace Core.Components.Gis.Theme { /// /// Class that contains the definition for a categorial theming of @@ -36,29 +35,29 @@ /// Creates a new instance of . /// /// The name of the attribute to which the theme is applicable for. - /// The map categories that are applicable for the theme. - /// Thrown when is null. + /// The category themes that are applicable for the map theme. + /// Thrown when is null. /// Thrown when: /// /// is null, empty or consists of only whitespace. - /// is empty. + /// is empty. /// - public MapTheme(string attributeName, IEnumerable mapCategories) + public MapTheme(string attributeName, IEnumerable categoryThemes) { if (string.IsNullOrWhiteSpace(attributeName)) { throw new ArgumentException(@"AttributeName is null, empty or consists of whitespace.", nameof(attributeName)); } - if (mapCategories == null) + if (categoryThemes == null) { - throw new ArgumentNullException(nameof(mapCategories)); + throw new ArgumentNullException(nameof(categoryThemes)); } - if (!mapCategories.Any()) + if (!categoryThemes.Any()) { - throw new ArgumentException(@"MapCategories is empty.", nameof(mapCategories)); + throw new ArgumentException(@"MapCategories is empty.", nameof(categoryThemes)); } - MapCategories = mapCategories; + CategoryThemes = categoryThemes; AttributeName = attributeName; } @@ -68,8 +67,8 @@ public string AttributeName { get; } /// - /// Gets the categories that are applicable for the theme. + /// Gets the category themes that are applicable for the theme. /// - public IEnumerable MapCategories { get; } + public IEnumerable CategoryThemes { get; } } } \ No newline at end of file Index: Core/Components/test/Core.Components.Gis.Test/Core.Components.Gis.Test.csproj =================================================================== diff -u -r205d6bacdfb7da4a3f96e65cf4392135323ebd8d -r3c41a03f6a1173872af5d8507465e291f9e3f8f2 --- Core/Components/test/Core.Components.Gis.Test/Core.Components.Gis.Test.csproj (.../Core.Components.Gis.Test.csproj) (revision 205d6bacdfb7da4a3f96e65cf4392135323ebd8d) +++ Core/Components/test/Core.Components.Gis.Test/Core.Components.Gis.Test.csproj (.../Core.Components.Gis.Test.csproj) (revision 3c41a03f6a1173872af5d8507465e291f9e3f8f2) @@ -19,6 +19,7 @@ + Index: Core/Components/test/Core.Components.Gis.Test/Themes/CategoryThemeTest.cs =================================================================== diff -u --- Core/Components/test/Core.Components.Gis.Test/Themes/CategoryThemeTest.cs (revision 0) +++ Core/Components/test/Core.Components.Gis.Test/Themes/CategoryThemeTest.cs (revision 3c41a03f6a1173872af5d8507465e291f9e3f8f2) @@ -0,0 +1,70 @@ +// 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.Drawing; +using Core.Common.TestUtil; +using Core.Components.Gis.Theme; +using Core.Components.Gis.Theme.Criteria; +using NUnit.Framework; +using Rhino.Mocks; + +namespace Core.Components.Gis.Test.Themes +{ + [TestFixture] + public class CategoryThemeTest + { + [Test] + public void Constructor_CriteriaNull_ThrowsArgumentNullException() + { + // Setup + var random = new Random(21); + Color themeColor = Color.FromKnownColor(random.NextEnumValue()); + + // Call + TestDelegate call = () => new CategoryTheme(themeColor, null); + + // Assert + var exception = Assert.Throws(call); + Assert.AreEqual("criteria", exception.ParamName); + } + + [Test] + public void Constructor_ValidArguments_ReturnsExpectedProperties() + { + // Setup + var mocks = new MockRepository(); + var criteria = mocks.Stub(); + mocks.ReplayAll(); + + var random = new Random(21); + Color themeColor = Color.FromKnownColor(random.NextEnumValue()); + + // Call + var category = new CategoryTheme(themeColor, criteria); + + // Assert + Assert.AreEqual(themeColor, category.Color); + Assert.AreSame(criteria, category.Criteria); + mocks.VerifyAll(); + } + } +} \ No newline at end of file Index: Core/Components/test/Core.Components.Gis.Test/Themes/MapThemeTest.cs =================================================================== diff -u -r205d6bacdfb7da4a3f96e65cf4392135323ebd8d -r3c41a03f6a1173872af5d8507465e291f9e3f8f2 --- Core/Components/test/Core.Components.Gis.Test/Themes/MapThemeTest.cs (.../MapThemeTest.cs) (revision 205d6bacdfb7da4a3f96e65cf4392135323ebd8d) +++ Core/Components/test/Core.Components.Gis.Test/Themes/MapThemeTest.cs (.../MapThemeTest.cs) (revision 3c41a03f6a1173872af5d8507465e291f9e3f8f2) @@ -23,41 +23,34 @@ using System.Collections.Generic; using System.Linq; using Core.Common.TestUtil; +using Core.Components.Gis.TestUtil.Theme; using Core.Components.Gis.Theme; -using Core.Components.Gis.Themes; using NUnit.Framework; -using Rhino.Mocks; namespace Core.Components.Gis.Test.Themes { [TestFixture] public class MapThemeTest { [Test] - [TestCase(" ")] - [TestCase("")] [TestCase(null)] + [TestCase("")] + [TestCase(" ")] public void Constructor_InvalidAttribute_ThrowsArgumentException(string invalidAttributeName) { - // Setup - var mocks = new MockRepository(); - var mapCategory = mocks.Stub(); - mocks.ReplayAll(); - // Call - TestDelegate call = () => new MapTheme(invalidAttributeName, new [] + TestDelegate call = () => new MapTheme(invalidAttributeName, new[] { - mapCategory + CategoryThemeTestFactory.CreateCategoryTheme() }); // Assert const string expectedMessage = "AttributeName is null, empty or consists of whitespace."; TestHelper.AssertThrowsArgumentExceptionAndTestMessage(call, expectedMessage); - mocks.VerifyAll(); } [Test] - public void Constructor_MapCategoriesNull_ThrowsArgumentNullException() + public void Constructor_CategoryThemesNull_ThrowsArgumentNullException() { // Call TestDelegate call = () => new MapTheme("Arbitrary attribute", null); @@ -68,10 +61,10 @@ } [Test] - public void Constructor_MapCategoriesEmpty_ThrowsArgumentException() + public void Constructor_CategoryThemesEmpty_ThrowsArgumentException() { // Setup - IEnumerable mapCategories = Enumerable.Empty(); + IEnumerable mapCategories = Enumerable.Empty(); // Call TestDelegate call = () => new MapTheme("Arbitrary attribute", mapCategories); @@ -85,23 +78,18 @@ public void Constructor_ValidArguments_SetsExpectedValues() { // Setup - var mocks = new MockRepository(); - var mapCategory = mocks.Stub(); - mocks.ReplayAll(); - const string attributeName = "Arbitrary attribute"; var mapCategories = new[] { - mapCategory + CategoryThemeTestFactory.CreateCategoryTheme() }; // Call var theme = new MapTheme(attributeName, mapCategories); // Assert Assert.AreEqual(attributeName, theme.AttributeName); - Assert.AreSame(mapCategories, theme.MapCategories); - mocks.VerifyAll(); + Assert.AreSame(mapCategories, theme.CategoryThemes); } } } \ No newline at end of file Index: Core/Components/test/Core.Components.Gis.TestUtil.Test/Core.Components.Gis.TestUtil.Test.csproj =================================================================== diff -u -r63fc151e9cf722527465c1eddfa6567a90feb5e6 -r3c41a03f6a1173872af5d8507465e291f9e3f8f2 --- Core/Components/test/Core.Components.Gis.TestUtil.Test/Core.Components.Gis.TestUtil.Test.csproj (.../Core.Components.Gis.TestUtil.Test.csproj) (revision 63fc151e9cf722527465c1eddfa6567a90feb5e6) +++ Core/Components/test/Core.Components.Gis.TestUtil.Test/Core.Components.Gis.TestUtil.Test.csproj (.../Core.Components.Gis.TestUtil.Test.csproj) (revision 3c41a03f6a1173872af5d8507465e291f9e3f8f2) @@ -13,9 +13,12 @@ + + + Index: Core/Components/test/Core.Components.Gis.TestUtil.Test/Theme/CategoryThemeTestFactoryTest.cs =================================================================== diff -u --- Core/Components/test/Core.Components.Gis.TestUtil.Test/Theme/CategoryThemeTestFactoryTest.cs (revision 0) +++ Core/Components/test/Core.Components.Gis.TestUtil.Test/Theme/CategoryThemeTestFactoryTest.cs (revision 3c41a03f6a1173872af5d8507465e291f9e3f8f2) @@ -0,0 +1,42 @@ +// 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.Drawing; +using Core.Components.Gis.TestUtil.Theme; +using NUnit.Framework; + +namespace Core.Components.Gis.TestUtil.Test.Theme +{ + [TestFixture] + public class CategoryThemeTestFactoryTest + { + [Test] + public void CreateDefaultCategoryTheme_ReturnsCategoryTheme() + { + // Call + var theme = CategoryThemeTestFactory.CreateCategoryTheme(); + + // Assert + Assert.AreEqual(Color.Aqua, theme.Color); + Assert.IsNotNull(theme.Criteria); + } + } +} \ No newline at end of file Index: Core/Components/test/Core.Components.Gis.TestUtil.Test/Theme/TestCriteriaTest.cs =================================================================== diff -u --- Core/Components/test/Core.Components.Gis.TestUtil.Test/Theme/TestCriteriaTest.cs (revision 0) +++ Core/Components/test/Core.Components.Gis.TestUtil.Test/Theme/TestCriteriaTest.cs (revision 3c41a03f6a1173872af5d8507465e291f9e3f8f2) @@ -0,0 +1,41 @@ +// 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 Core.Components.Gis.TestUtil.Theme; +using Core.Components.Gis.Theme.Criteria; +using NUnit.Framework; + +namespace Core.Components.Gis.TestUtil.Test.Theme +{ + [TestFixture] + public class TestCriteriaTest + { + [Test] + public void Constructor_ReturnsExpectedProperties() + { + // Call + var criteria = new TestCriteria(); + + // Assert + Assert.IsInstanceOf(criteria); + } + } +} \ No newline at end of file Index: Core/Components/test/Core.Components.Gis.TestUtil/Core.Components.Gis.TestUtil.csproj =================================================================== diff -u -r63fc151e9cf722527465c1eddfa6567a90feb5e6 -r3c41a03f6a1173872af5d8507465e291f9e3f8f2 --- Core/Components/test/Core.Components.Gis.TestUtil/Core.Components.Gis.TestUtil.csproj (.../Core.Components.Gis.TestUtil.csproj) (revision 63fc151e9cf722527465c1eddfa6567a90feb5e6) +++ Core/Components/test/Core.Components.Gis.TestUtil/Core.Components.Gis.TestUtil.csproj (.../Core.Components.Gis.TestUtil.csproj) (revision 3c41a03f6a1173872af5d8507465e291f9e3f8f2) @@ -9,9 +9,12 @@ + + + Index: Core/Components/test/Core.Components.Gis.TestUtil/TestImageBasedMapData.cs =================================================================== diff -u -r67284323e2785c651633d9c52049ba12a9c70e6a -r3c41a03f6a1173872af5d8507465e291f9e3f8f2 --- Core/Components/test/Core.Components.Gis.TestUtil/TestImageBasedMapData.cs (.../TestImageBasedMapData.cs) (revision 67284323e2785c651633d9c52049ba12a9c70e6a) +++ Core/Components/test/Core.Components.Gis.TestUtil/TestImageBasedMapData.cs (.../TestImageBasedMapData.cs) (revision 3c41a03f6a1173872af5d8507465e291f9e3f8f2) @@ -31,7 +31,7 @@ public class TestImageBasedMapData : ImageBasedMapData { /// - /// + /// Creates a new instance of /// /// The name of the map data. /// The value for . Index: Core/Components/test/Core.Components.Gis.TestUtil/Theme/CategoryThemeTestFactory.cs =================================================================== diff -u --- Core/Components/test/Core.Components.Gis.TestUtil/Theme/CategoryThemeTestFactory.cs (revision 0) +++ Core/Components/test/Core.Components.Gis.TestUtil/Theme/CategoryThemeTestFactory.cs (revision 3c41a03f6a1173872af5d8507465e291f9e3f8f2) @@ -0,0 +1,41 @@ +// 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.Drawing; +using Core.Components.Gis.Theme; + +namespace Core.Components.Gis.TestUtil.Theme +{ + /// + /// Creates valid instances of which can be used for testing. + /// + public static class CategoryThemeTestFactory + { + /// + /// Creates a fully configured + /// + /// A fully configured . + public static CategoryTheme CreateCategoryTheme() + { + return new CategoryTheme(Color.Aqua, new TestCriteria()); + } + } +} \ No newline at end of file Index: Core/Components/test/Core.Components.Gis.TestUtil/Theme/TestCriteria.cs =================================================================== diff -u --- Core/Components/test/Core.Components.Gis.TestUtil/Theme/TestCriteria.cs (revision 0) +++ Core/Components/test/Core.Components.Gis.TestUtil/Theme/TestCriteria.cs (revision 3c41a03f6a1173872af5d8507465e291f9e3f8f2) @@ -0,0 +1,30 @@ +// 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 Core.Components.Gis.Theme.Criteria; + +namespace Core.Components.Gis.TestUtil.Theme +{ + /// + /// A minimal implementation of . + /// + public class TestCriteria : ICriteria {} +} \ No newline at end of file