Index: Core/Components/src/Core.Components.Gis/Data/FeatureBasedMapData.cs
===================================================================
diff -u -rc4ad0672cee580dfc9a2835dcb2a39e92a49280f -r0a8ca85c3cd07479f7fe3753141f2c13aa47c665
--- Core/Components/src/Core.Components.Gis/Data/FeatureBasedMapData.cs (.../FeatureBasedMapData.cs) (revision c4ad0672cee580dfc9a2835dcb2a39e92a49280f)
+++ Core/Components/src/Core.Components.Gis/Data/FeatureBasedMapData.cs (.../FeatureBasedMapData.cs) (revision 0a8ca85c3cd07479f7fe3753141f2c13aa47c665)
@@ -120,18 +120,25 @@
/// The name of the .
/// Thrown when is
/// null or only whitespace.
- protected FeatureBasedMapData(string name) : this(name, null) {}
+ protected FeatureBasedMapData(string name) : base(name) {}
///
/// Creates a new instance of .
///
/// The name of the .
/// The
/// belonging to the .
+ /// Thrown when
+ /// is null.
/// Thrown when is
/// null or only whitespace.
- protected FeatureBasedMapData(string name, MapTheme theme) : base(name)
+ protected FeatureBasedMapData(string name, MapTheme theme) : this(name)
{
+ if (theme == null)
+ {
+ throw new ArgumentNullException(nameof(theme));
+ }
+
Theme = theme;
}
Index: Core/Components/src/Core.Components.Gis/Data/MapLineData.cs
===================================================================
diff -u -r2f5fc74d129a8b1c3410c3d256f33f84a26e8dfd -r0a8ca85c3cd07479f7fe3753141f2c13aa47c665
--- Core/Components/src/Core.Components.Gis/Data/MapLineData.cs (.../MapLineData.cs) (revision 2f5fc74d129a8b1c3410c3d256f33f84a26e8dfd)
+++ Core/Components/src/Core.Components.Gis/Data/MapLineData.cs (.../MapLineData.cs) (revision 0a8ca85c3cd07479f7fe3753141f2c13aa47c665)
@@ -51,8 +51,16 @@
/// null or only whitespace.
/// Thrown when
/// is null.
- public MapLineData(string name, LineStyle style) : this(name, style, null) {}
+ public MapLineData(string name, LineStyle style) : base(name)
+ {
+ if (style == null)
+ {
+ throw new ArgumentNullException(nameof(style));
+ }
+ Style = style;
+ }
+
///
/// Creates a new instance of .
///
Index: Core/Components/src/Core.Components.Gis/Data/MapPointData.cs
===================================================================
diff -u -r2f5fc74d129a8b1c3410c3d256f33f84a26e8dfd -r0a8ca85c3cd07479f7fe3753141f2c13aa47c665
--- Core/Components/src/Core.Components.Gis/Data/MapPointData.cs (.../MapPointData.cs) (revision 2f5fc74d129a8b1c3410c3d256f33f84a26e8dfd)
+++ Core/Components/src/Core.Components.Gis/Data/MapPointData.cs (.../MapPointData.cs) (revision 0a8ca85c3cd07479f7fe3753141f2c13aa47c665)
@@ -51,8 +51,16 @@
/// null or only whitespace.
/// Thrown when
/// is null.
- public MapPointData(string name, PointStyle style) : this(name, style, null) {}
+ public MapPointData(string name, PointStyle style) : base(name)
+ {
+ if (style == null)
+ {
+ throw new ArgumentNullException(nameof(style));
+ }
+ Style = style;
+ }
+
///
/// Creates a new instance of .
///
Index: Core/Components/src/Core.Components.Gis/Data/MapPolygonData.cs
===================================================================
diff -u -r2f5fc74d129a8b1c3410c3d256f33f84a26e8dfd -r0a8ca85c3cd07479f7fe3753141f2c13aa47c665
--- Core/Components/src/Core.Components.Gis/Data/MapPolygonData.cs (.../MapPolygonData.cs) (revision 2f5fc74d129a8b1c3410c3d256f33f84a26e8dfd)
+++ Core/Components/src/Core.Components.Gis/Data/MapPolygonData.cs (.../MapPolygonData.cs) (revision 0a8ca85c3cd07479f7fe3753141f2c13aa47c665)
@@ -51,8 +51,16 @@
/// null or only whitespace.
/// Thrown when
/// is null.
- public MapPolygonData(string name, PolygonStyle style) : this(name, style, null) {}
+ public MapPolygonData(string name, PolygonStyle style) : base(name)
+ {
+ if (style == null)
+ {
+ throw new ArgumentNullException(nameof(style));
+ }
+ Style = style;
+ }
+
///
/// Creates a new instance of .
///
Index: Core/Components/test/Core.Components.DotSpatial.Test/Converter/FeatureBasedMapDataConverterTest.cs
===================================================================
diff -u -rc4ad0672cee580dfc9a2835dcb2a39e92a49280f -r0a8ca85c3cd07479f7fe3753141f2c13aa47c665
--- Core/Components/test/Core.Components.DotSpatial.Test/Converter/FeatureBasedMapDataConverterTest.cs (.../FeatureBasedMapDataConverterTest.cs) (revision c4ad0672cee580dfc9a2835dcb2a39e92a49280f)
+++ Core/Components/test/Core.Components.DotSpatial.Test/Converter/FeatureBasedMapDataConverterTest.cs (.../FeatureBasedMapDataConverterTest.cs) (revision 0a8ca85c3cd07479f7fe3753141f2c13aa47c665)
@@ -772,7 +772,7 @@
private class TestFeatureBasedMapData : FeatureBasedMapData
{
- public TestFeatureBasedMapData(string name) : this(name, null) {}
+ public TestFeatureBasedMapData(string name) : base(name) {}
public TestFeatureBasedMapData(string name, MapTheme theme) : base(name, theme) {}
}
Index: Core/Components/test/Core.Components.Gis.Test/Data/FeatureBasedMapDataTest.cs
===================================================================
diff -u -rc4ad0672cee580dfc9a2835dcb2a39e92a49280f -r0a8ca85c3cd07479f7fe3753141f2c13aa47c665
--- Core/Components/test/Core.Components.Gis.Test/Data/FeatureBasedMapDataTest.cs (.../FeatureBasedMapDataTest.cs) (revision c4ad0672cee580dfc9a2835dcb2a39e92a49280f)
+++ Core/Components/test/Core.Components.Gis.Test/Data/FeatureBasedMapDataTest.cs (.../FeatureBasedMapDataTest.cs) (revision 0a8ca85c3cd07479f7fe3753141f2c13aa47c665)
@@ -150,6 +150,17 @@
}
[Test]
+ public void TypedConstructor_ThemeNull_ThrowsArgumentNullException()
+ {
+ // Call
+ TestDelegate call = () => new TypedTestFeatureBasedMapData("name", null);
+
+ // Assert
+ var exception = Assert.Throws(call);
+ Assert.AreEqual("theme", exception.ParamName);
+ }
+
+ [Test]
public void TypedConstructor_WitName_ExpectedValues()
{
// Setup
Index: Core/Plugins/test/Core.Plugins.Map.Test/PropertyClasses/MapLineDataPropertiesTest.cs
===================================================================
diff -u -rf7561a643a1fcf1760116b1bc93055e26f11aa8b -r0a8ca85c3cd07479f7fe3753141f2c13aa47c665
--- Core/Plugins/test/Core.Plugins.Map.Test/PropertyClasses/MapLineDataPropertiesTest.cs (.../MapLineDataPropertiesTest.cs) (revision f7561a643a1fcf1760116b1bc93055e26f11aa8b)
+++ Core/Plugins/test/Core.Plugins.Map.Test/PropertyClasses/MapLineDataPropertiesTest.cs (.../MapLineDataPropertiesTest.cs) (revision 0a8ca85c3cd07479f7fe3753141f2c13aa47c665)
@@ -323,10 +323,9 @@
public void DynamicVisibleValidationMethod_MapLineDataWithMapTheme_ReturnsExpectedValuesForRelevantProperties(bool hasMapTheme)
{
// Setup
- MapTheme mapTheme = hasMapTheme
- ? CreateMapTheme()
- : null;
- var mapLineData = new MapLineData("Test", new LineStyle(), mapTheme);
+ MapLineData mapLineData = hasMapTheme
+ ? new MapLineData("Test", new LineStyle(), CreateMapTheme())
+ : new MapLineData("Test");
var properties = new MapLineDataProperties(mapLineData, Enumerable.Empty());
Index: Core/Plugins/test/Core.Plugins.Map.Test/PropertyClasses/MapPointDataPropertiesTest.cs
===================================================================
diff -u -rf7561a643a1fcf1760116b1bc93055e26f11aa8b -r0a8ca85c3cd07479f7fe3753141f2c13aa47c665
--- Core/Plugins/test/Core.Plugins.Map.Test/PropertyClasses/MapPointDataPropertiesTest.cs (.../MapPointDataPropertiesTest.cs) (revision f7561a643a1fcf1760116b1bc93055e26f11aa8b)
+++ Core/Plugins/test/Core.Plugins.Map.Test/PropertyClasses/MapPointDataPropertiesTest.cs (.../MapPointDataPropertiesTest.cs) (revision 0a8ca85c3cd07479f7fe3753141f2c13aa47c665)
@@ -359,10 +359,9 @@
public void DynamicVisibleValidationMethod_MapPointDataWithMapTheme_ReturnsExpectedValuesForRelevantProperties(bool hasMapTheme)
{
// Setup
- MapTheme mapTheme = hasMapTheme
- ? CreateMapTheme()
- : null;
- var mapPointData = new MapPointData("Test", new PointStyle(), mapTheme);
+ MapPointData mapPointData = hasMapTheme
+ ? new MapPointData("Test", new PointStyle(), CreateMapTheme())
+ : new MapPointData("Test");
var properties = new MapPointDataProperties(mapPointData, Enumerable.Empty());
Index: Core/Plugins/test/Core.Plugins.Map.Test/PropertyClasses/MapPolygonDataPropertiesTest.cs
===================================================================
diff -u -rf7561a643a1fcf1760116b1bc93055e26f11aa8b -r0a8ca85c3cd07479f7fe3753141f2c13aa47c665
--- Core/Plugins/test/Core.Plugins.Map.Test/PropertyClasses/MapPolygonDataPropertiesTest.cs (.../MapPolygonDataPropertiesTest.cs) (revision f7561a643a1fcf1760116b1bc93055e26f11aa8b)
+++ Core/Plugins/test/Core.Plugins.Map.Test/PropertyClasses/MapPolygonDataPropertiesTest.cs (.../MapPolygonDataPropertiesTest.cs) (revision 0a8ca85c3cd07479f7fe3753141f2c13aa47c665)
@@ -331,10 +331,9 @@
public void DynamicVisibleValidationMethod_MapPolygonDataWithMapTheme_ReturnsExpectedValuesForRelevantProperties(bool hasMapTheme)
{
// Setup
- MapTheme mapTheme = hasMapTheme
- ? CreateMapTheme()
- : null;
- var mapPolygonData = new MapPolygonData("Test", new PolygonStyle(), mapTheme);
+ MapPolygonData mapPolygonData = hasMapTheme
+ ? new MapPolygonData("Test", new PolygonStyle(), CreateMapTheme())
+ : new MapPolygonData("Test");
var properties = new MapPolygonDataProperties(mapPolygonData, Enumerable.Empty());