Index: Core/Components/src/Core.Components.DotSpatial/Converter/FeatureBasedMapDataConverter.cs =================================================================== diff -u -re611a8f9a7735c41731487fa449a7e7a092db10b -rd348f01e2a67e8ceee60a095c7f858d2f8c02081 --- Core/Components/src/Core.Components.DotSpatial/Converter/FeatureBasedMapDataConverter.cs (.../FeatureBasedMapDataConverter.cs) (revision e611a8f9a7735c41731487fa449a7e7a092db10b) +++ Core/Components/src/Core.Components.DotSpatial/Converter/FeatureBasedMapDataConverter.cs (.../FeatureBasedMapDataConverter.cs) (revision d348f01e2a67e8ceee60a095c7f858d2f8c02081) @@ -110,7 +110,7 @@ { if (data == null) { - throw new ArgumentNullException("data", @"Null data cannot be converted into a feature layer."); + throw new ArgumentNullException("data", @"Null data cannot be converted into a feature layer data."); } if (!CanConvertMapData(data)) Index: Core/Components/test/Core.Components.DotSpatial.Test/Converter/FeatureBasedMapDataConverterTest.cs =================================================================== diff -u -r9d24ac09af3f8bb26b9ac80a7f934572f5d1388f -rd348f01e2a67e8ceee60a095c7f858d2f8c02081 --- Core/Components/test/Core.Components.DotSpatial.Test/Converter/FeatureBasedMapDataConverterTest.cs (.../FeatureBasedMapDataConverterTest.cs) (revision 9d24ac09af3f8bb26b9ac80a7f934572f5d1388f) +++ Core/Components/test/Core.Components.DotSpatial.Test/Converter/FeatureBasedMapDataConverterTest.cs (.../FeatureBasedMapDataConverterTest.cs) (revision d348f01e2a67e8ceee60a095c7f858d2f8c02081) @@ -63,7 +63,7 @@ TestDelegate test = () => testConverter.Convert(null); // Assert - const string expectedMessage = "Null data cannot be converted into a feature layer."; + const string expectedMessage = "Null data cannot be converted into a feature layer data."; TestHelper.AssertThrowsArgumentExceptionAndTestMessage(test, expectedMessage); } @@ -102,6 +102,100 @@ Assert.IsNotNull(result); } + [Test] + public void ConvertLayerFeatures_DataNull_ThrowsArgumentNullException() + { + // Setup + var testConverter = new TestFeatureBasedMapDataConverter(); + + // Call + TestDelegate test = () => testConverter.ConvertLayerFeatures(null, new MapPointLayer()); + + // Assert + const string expectedMessage = "Null data cannot be converted into a feature layer data."; + TestHelper.AssertThrowsArgumentExceptionAndTestMessage(test, expectedMessage); + } + + [Test] + public void ConvertLayerFeatures_DataCannotBeConverted_ThrowsArgumentException() + { + // Setup + var testConverter = new TestFeatureBasedMapDataConverter(); + var testFeatureBasedMapData = new TestFeatureBasedMapData("test data"); + + // Precondition + Assert.IsFalse(testConverter.CanConvertMapData(testFeatureBasedMapData)); + + // Call + TestDelegate test = () => testConverter.ConvertLayerFeatures(testFeatureBasedMapData, new MapPointLayer()); + + // Assert + var expectedMessage = string.Format("The data of type {0} cannot be converted by this converter.", testFeatureBasedMapData.GetType()); + TestHelper.AssertThrowsArgumentExceptionAndTestMessage(test, expectedMessage); + } + + [Test] + public void ConvertLayerFeatures_TargetLayerNull_ThrowsArgumentNullException() + { + // Setup + var testConverter = new TestFeatureBasedMapDataConverter(); + var testFeatureBasedMapData = new TestFeatureBasedMapData("test data"); + + // Call + TestDelegate test = () => testConverter.ConvertLayerFeatures(testFeatureBasedMapData, null); + + // Assert + const string expectedMessage = "Null data cannot be used as conversion target."; + TestHelper.AssertThrowsArgumentExceptionAndTestMessage(test, expectedMessage); + } + + [Test] + public void ConvertLayerProperties_DataNull_ThrowsArgumentNullException() + { + // Setup + var testConverter = new TestFeatureBasedMapDataConverter(); + + // Call + TestDelegate test = () => testConverter.ConvertLayerProperties(null, new MapPointLayer()); + + // Assert + const string expectedMessage = "Null data cannot be converted into a feature layer data."; + TestHelper.AssertThrowsArgumentExceptionAndTestMessage(test, expectedMessage); + } + + [Test] + public void ConvertLayerProperties_DataCannotBeConverted_ThrowsArgumentException() + { + // Setup + var testConverter = new TestFeatureBasedMapDataConverter(); + var testFeatureBasedMapData = new TestFeatureBasedMapData("test data"); + + // Precondition + Assert.IsFalse(testConverter.CanConvertMapData(testFeatureBasedMapData)); + + // Call + TestDelegate test = () => testConverter.ConvertLayerProperties(testFeatureBasedMapData, new MapPointLayer()); + + // Assert + var expectedMessage = string.Format("The data of type {0} cannot be converted by this converter.", testFeatureBasedMapData.GetType()); + TestHelper.AssertThrowsArgumentExceptionAndTestMessage(test, expectedMessage); + } + + [Test] + public void ConvertLayerProperties_TargetLayerNull_ThrowsArgumentNullException() + { + // Setup + var testConverter = new TestFeatureBasedMapDataConverter(); + var testFeatureBasedMapData = new TestFeatureBasedMapData("test data"); + + // Call + TestDelegate test = () => testConverter.ConvertLayerProperties(testFeatureBasedMapData, null); + + // Assert + const string expectedMessage = "Null data cannot be used as conversion target."; + TestHelper.AssertThrowsArgumentExceptionAndTestMessage(test, expectedMessage); + } + private class Class : FeatureBasedMapData { public Class(string name) : base(name) {} Index: Core/Components/test/Core.Components.DotSpatial.Test/Converter/MapLineDataConverterTest.cs =================================================================== diff -u -r5b237b2999d88a54935d3a2af8702774f56e8b2d -rd348f01e2a67e8ceee60a095c7f858d2f8c02081 --- Core/Components/test/Core.Components.DotSpatial.Test/Converter/MapLineDataConverterTest.cs (.../MapLineDataConverterTest.cs) (revision 5b237b2999d88a54935d3a2af8702774f56e8b2d) +++ Core/Components/test/Core.Components.DotSpatial.Test/Converter/MapLineDataConverterTest.cs (.../MapLineDataConverterTest.cs) (revision d348f01e2a67e8ceee60a095c7f858d2f8c02081) @@ -27,7 +27,6 @@ using System.Drawing.Drawing2D; using System.Linq; using Core.Common.Base.Geometry; -using Core.Common.TestUtil; using Core.Components.DotSpatial.Converter; using Core.Components.DotSpatial.TestUtil; using Core.Components.Gis.Data; @@ -84,38 +83,6 @@ } [Test] - public void Convert_DataNull_ThrowsArgumentNullException() - { - // Setup - var testConverter = new MapLineDataConverter(); - - // Call - TestDelegate test = () => testConverter.Convert(null); - - // Assert - const string expectedMessage = "Null data cannot be converted into a feature layer."; - TestHelper.AssertThrowsArgumentExceptionAndTestMessage(test, expectedMessage); - } - - [Test] - public void Convert_DataCannotBeConverted_ThrowsArgumentException() - { - // Setup - var testConverter = new MapLineDataConverter(); - var testFeatureBasedMapData = new TestFeatureBasedMapData("test data"); - - // Precondition - Assert.IsFalse(testConverter.CanConvertMapData(testFeatureBasedMapData)); - - // Call - TestDelegate test = () => testConverter.Convert(testFeatureBasedMapData); - - // Assert - var expectedMessage = string.Format("The data of type {0} cannot be converted by this converter.", testFeatureBasedMapData.GetType()); - TestHelper.AssertThrowsArgumentExceptionAndTestMessage(test, expectedMessage); - } - - [Test] public void Convert_MapDataWithSingleGeometry_ReturnMapLineLayerWithLineString() { // Setup Index: Core/Components/test/Core.Components.DotSpatial.Test/Converter/MapPointDataConverterTest.cs =================================================================== diff -u -r5b237b2999d88a54935d3a2af8702774f56e8b2d -rd348f01e2a67e8ceee60a095c7f858d2f8c02081 --- Core/Components/test/Core.Components.DotSpatial.Test/Converter/MapPointDataConverterTest.cs (.../MapPointDataConverterTest.cs) (revision 5b237b2999d88a54935d3a2af8702774f56e8b2d) +++ Core/Components/test/Core.Components.DotSpatial.Test/Converter/MapPointDataConverterTest.cs (.../MapPointDataConverterTest.cs) (revision d348f01e2a67e8ceee60a095c7f858d2f8c02081) @@ -25,7 +25,6 @@ using System.Drawing; using System.Linq; using Core.Common.Base.Geometry; -using Core.Common.TestUtil; using Core.Components.DotSpatial.Converter; using Core.Components.DotSpatial.TestUtil; using Core.Components.Gis.Data; @@ -306,38 +305,6 @@ } [Test] - public void Convert_DataNull_ThrowsArgumentNullException() - { - // Setup - var testConverter = new MapPointDataConverter(); - - // Call - TestDelegate test = () => testConverter.Convert(null); - - // Assert - const string expectedMessage = "Null data cannot be converted into a feature layer."; - TestHelper.AssertThrowsArgumentExceptionAndTestMessage(test, expectedMessage); - } - - [Test] - public void Convert_DataCannotBeConverted_ThrowsArgumentException() - { - // Setup - var testConverter = new MapPointDataConverter(); - var testFeatureBasedMapData = new TestFeatureBasedMapData("test data"); - - // Precondition - Assert.IsFalse(testConverter.CanConvertMapData(testFeatureBasedMapData)); - - // Call - TestDelegate test = () => testConverter.Convert(testFeatureBasedMapData); - - // Assert - var expectedMessage = string.Format("The data of type {0} cannot be converted by this converter.", testFeatureBasedMapData.GetType()); - TestHelper.AssertThrowsArgumentExceptionAndTestMessage(test, expectedMessage); - } - - [Test] [TestCase(true)] [TestCase(false)] public void Convert_DataIsVisible_LayerIsVisibleSameAsData(bool isVisible) Index: Core/Components/test/Core.Components.DotSpatial.Test/Converter/MapPolygonDataConverterTest.cs =================================================================== diff -u -r5b237b2999d88a54935d3a2af8702774f56e8b2d -rd348f01e2a67e8ceee60a095c7f858d2f8c02081 --- Core/Components/test/Core.Components.DotSpatial.Test/Converter/MapPolygonDataConverterTest.cs (.../MapPolygonDataConverterTest.cs) (revision 5b237b2999d88a54935d3a2af8702774f56e8b2d) +++ Core/Components/test/Core.Components.DotSpatial.Test/Converter/MapPolygonDataConverterTest.cs (.../MapPolygonDataConverterTest.cs) (revision d348f01e2a67e8ceee60a095c7f858d2f8c02081) @@ -26,7 +26,6 @@ using System.Drawing; using System.Linq; using Core.Common.Base.Geometry; -using Core.Common.TestUtil; using Core.Components.DotSpatial.Converter; using Core.Components.DotSpatial.TestUtil; using Core.Components.Gis.Data; @@ -291,38 +290,6 @@ } [Test] - public void Convert_DataNull_ThrowsArgumentNullException() - { - // Setup - var testConverter = new MapPolygonDataConverter(); - - // Call - TestDelegate test = () => testConverter.Convert(null); - - // Assert - const string expectedMessage = "Null data cannot be converted into a feature layer."; - TestHelper.AssertThrowsArgumentExceptionAndTestMessage(test, expectedMessage); - } - - [Test] - public void Convert_DataCannotBeConverted_ThrowsArgumentException() - { - // Setup - var testConverter = new MapPolygonDataConverter(); - var testFeatureBasedMapData = new TestFeatureBasedMapData("test data"); - - // Precondition - Assert.IsFalse(testConverter.CanConvertMapData(testFeatureBasedMapData)); - - // Call - TestDelegate test = () => testConverter.Convert(testFeatureBasedMapData); - - // Assert - var expectedMessage = string.Format("The data of type {0} cannot be converted by this converter.", testFeatureBasedMapData.GetType()); - TestHelper.AssertThrowsArgumentExceptionAndTestMessage(test, expectedMessage); - } - - [Test] public void Convert_MapDataWithSingleGeometry_ReturnMapPolygonLayerWithPolygon() { // Setup