Index: Core/Common/test/Core.Common.TestUtil/TestDataPath.cs =================================================================== diff -u -r654d3a712eedbdeea718dc0448c5544f09e053cd -rcd2cd8c2cfa9e88043c9dd10f843ba2d7fd81338 --- Core/Common/test/Core.Common.TestUtil/TestDataPath.cs (.../TestDataPath.cs) (revision 654d3a712eedbdeea718dc0448c5544f09e053cd) +++ Core/Common/test/Core.Common.TestUtil/TestDataPath.cs (.../TestDataPath.cs) (revision cd2cd8c2cfa9e88043c9dd10f843ba2d7fd81338) @@ -30,6 +30,17 @@ public static readonly TestDataPath Base = System.IO.Path.Combine("Core", "Common", "test", "Core.Common.Base.Test"); public static readonly TestDataPath Utils = System.IO.Path.Combine("Core", "Common", "test", "Core.Common.Utils.Test"); } + + public static class Components + { + public static readonly TestDataPath DotSpatial = System.IO.Path.Combine("Core", "Components", "test", "Core.Components.DotSpatial.Test"); + } + + public static class Plugins + { + public static readonly TestDataPath DotSpatial = System.IO.Path.Combine("Core", "Plugins", "test", "Core.Plugins.DotSpatial.Test"); + } + } public static class Ringtoets Index: Core/Components/test/Core.Components.DotSpatial.Test/BaseMapTest.cs =================================================================== diff -u -r4e50b5b9df5cafb3e6ea879b5b7d1963de68430d -rcd2cd8c2cfa9e88043c9dd10f843ba2d7fd81338 --- Core/Components/test/Core.Components.DotSpatial.Test/BaseMapTest.cs (.../BaseMapTest.cs) (revision 4e50b5b9df5cafb3e6ea879b5b7d1963de68430d) +++ Core/Components/test/Core.Components.DotSpatial.Test/BaseMapTest.cs (.../BaseMapTest.cs) (revision cd2cd8c2cfa9e88043c9dd10f843ba2d7fd81338) @@ -14,6 +14,11 @@ [TestFixture] public class BaseMapTest { + private readonly string segmentsFile = Path.Combine(TestHelper.GetTestDataPath(TestDataPath.Core.Components.DotSpatial, "ShapeFiles"), "DR10_segments.shp"); + private readonly string dijkvakgebiedenFile = Path.Combine(TestHelper.GetTestDataPath(TestDataPath.Core.Components.DotSpatial, "ShapeFiles"), "DR10_dijkvakgebieden.shp"); + private readonly string binnenTeenFile = Path.Combine(TestHelper.GetTestDataPath(TestDataPath.Core.Components.DotSpatial, "ShapeFiles"), "DR10_binnenteen.shp"); + private readonly string tempTeenFile = Path.Combine(TestHelper.GetTestDataPath(TestDataPath.Core.Components.DotSpatial, "ShapeFiles"), "DR10_teen.shp"); + [Test] public void DefaultConstructor_PropertiesSet() { @@ -31,7 +36,7 @@ var map = new BaseMap(); var data = new MapData(); - data.AddShapeFile(string.Format("{0}\\Resources\\DR10_segments.shp", Environment.CurrentDirectory)); + data.AddShapeFile(segmentsFile); // Call TestDelegate setDataDelegate = () => map.SetMapData(data); @@ -46,12 +51,10 @@ // Setup var map = new BaseMap(); var data = new MapData(); - var filePath = string.Format("{0}\\Resources\\DR10_binnenteen.shp", Environment.CurrentDirectory); - var newPath = string.Format("{0}\\Resources\\DR10_teen.shp", Environment.CurrentDirectory); - data.AddShapeFile(filePath); + data.AddShapeFile(binnenTeenFile); - RenameFile(newPath, filePath); + RenameFile(tempTeenFile, binnenTeenFile); // Call TestDelegate testDelegate = () => map.SetMapData(data); @@ -64,7 +67,7 @@ finally { // Place the original file back for other tests. - RenameFile(filePath, newPath); + RenameFile(binnenTeenFile, tempTeenFile); } } @@ -75,7 +78,7 @@ var map = new BaseMap(); var data = new MapData(); - data.AddShapeFile(string.Format("{0}\\Resources\\DR10_dijkvakgebieden.shp", Environment.CurrentDirectory)); + data.AddShapeFile(dijkvakgebiedenFile); // Call TestDelegate setDataDelegate = () => map.SetMapData(data); @@ -91,10 +94,9 @@ var map = new BaseMap(); var data = new MapData(); - var filePath = string.Format("{0}\\Resources\\DR10_dijkvakgebieden.shp", Environment.CurrentDirectory); - var excpectedLog = string.Format(Resources.BaseMap_LoadData_Shape_file_on_path__0__is_added_to_the_map_, filePath); + var excpectedLog = string.Format(Resources.BaseMap_LoadData_Shape_file_on_path__0__is_added_to_the_map_, dijkvakgebiedenFile); - data.AddShapeFile(filePath); + data.AddShapeFile(dijkvakgebiedenFile); var mapComponent = TypeUtils.GetField(map, "map"); @@ -111,7 +113,10 @@ private static void RenameFile(string newPath, string path) { - File.Delete(newPath); + if (File.Exists(newPath)) + { + File.Delete(newPath); + } File.Move(path, newPath); } } Index: Core/Components/test/Core.Components.DotSpatial.Test/Core.Components.DotSpatial.Test.csproj =================================================================== diff -u -r04c70d10f22ba007f8210813d3d02697e42f8a5d -rcd2cd8c2cfa9e88043c9dd10f843ba2d7fd81338 --- Core/Components/test/Core.Components.DotSpatial.Test/Core.Components.DotSpatial.Test.csproj (.../Core.Components.DotSpatial.Test.csproj) (revision 04c70d10f22ba007f8210813d3d02697e42f8a5d) +++ Core/Components/test/Core.Components.DotSpatial.Test/Core.Components.DotSpatial.Test.csproj (.../Core.Components.DotSpatial.Test.csproj) (revision cd2cd8c2cfa9e88043c9dd10f843ba2d7fd81338) @@ -103,11 +103,6 @@ - - True - True - TestResources.resx - @@ -125,79 +120,7 @@ - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - - ResXFileCodeGenerator - TestResources.Designer.cs - - - - - Always - - - - - Always - - - - - PreserveNewest - -