Index: Core/Plugins/test/Core.Plugins.Map.Test/Legend/MapDataCollectionTreeNodeInfoTest.cs =================================================================== diff -u -r45440093089496f59ed420e772136756c229e30b -ra7a7213570203593da0dfc8f4f9cfafabf69ca3e --- Core/Plugins/test/Core.Plugins.Map.Test/Legend/MapDataCollectionTreeNodeInfoTest.cs (.../MapDataCollectionTreeNodeInfoTest.cs) (revision 45440093089496f59ed420e772136756c229e30b) +++ Core/Plugins/test/Core.Plugins.Map.Test/Legend/MapDataCollectionTreeNodeInfoTest.cs (.../MapDataCollectionTreeNodeInfoTest.cs) (revision a7a7213570203593da0dfc8f4f9cfafabf69ca3e) @@ -21,6 +21,7 @@ using System; using System.Collections.Generic; +using System.Drawing; using System.Linq; using System.Windows.Forms; using Core.Common.Base; @@ -32,7 +33,6 @@ using Core.Common.Utils.Reflection; using Core.Components.Gis.Data; using Core.Components.Gis.Features; -using Core.Components.Gis.Forms; using Core.Components.Gis.Geometries; using Core.Plugins.Map.Legend; using Core.Plugins.Map.Properties; @@ -63,7 +63,7 @@ mapLegendView = new MapLegendView(contextMenuBuilderProvider); - TreeViewControl treeViewControl = TypeUtils.GetField(mapLegendView, "treeViewControl"); + var treeViewControl = TypeUtils.GetField(mapLegendView, "treeViewControl"); Dictionary treeNodeInfoLookup = TypeUtils.GetField>(treeViewControl, "tagTypeTreeNodeInfoLookup"); info = treeNodeInfoLookup[typeof(MapDataCollection)]; @@ -104,7 +104,7 @@ var mapDataCollection = new MapDataCollection("Collectie"); // Call - var text = info.Text(mapDataCollection); + string text = info.Text(mapDataCollection); // Assert Assert.AreEqual(mapDataCollection.Name, text); @@ -117,7 +117,7 @@ mocks.ReplayAll(); // Call - var image = info.Image(null); + Image image = info.Image(null); // Assert TestHelper.AssertImagesAreEqual(GuiResources.folder, image); @@ -158,7 +158,7 @@ var mapDataCollection = new MapDataCollection("test data"); // Call - var canDrop = info.CanDrop(new object(), mapDataCollection); + bool canDrop = info.CanDrop(new object(), mapDataCollection); // Assert Assert.IsFalse(canDrop); @@ -174,7 +174,7 @@ mocks.ReplayAll(); // Call - var canDrop = info.CanDrop(mapData, mapDataCollection); + bool canDrop = info.CanDrop(mapData, mapDataCollection); // Assert Assert.IsTrue(canDrop); @@ -188,7 +188,7 @@ var mapDataCollection = new MapDataCollection("test data"); // Call - var canInsert = info.CanInsert(new object(), mapDataCollection); + bool canInsert = info.CanInsert(new object(), mapDataCollection); // Assert Assert.IsFalse(canInsert); @@ -204,7 +204,7 @@ mocks.ReplayAll(); // Call - var canInsert = info.CanInsert(mapData, mapDataCollection); + bool canInsert = info.CanInsert(mapData, mapDataCollection); // Assert Assert.IsTrue(canInsert); @@ -239,7 +239,7 @@ info.OnDrop(mapData1, mapDataCollection, mapDataCollection, position, treeViewControl); // Assert - var reversedIndex = 2 - position; + int reversedIndex = 2 - position; Assert.AreSame(mapData1, mapDataCollection.Collection.ElementAt(reversedIndex)); } } @@ -302,7 +302,7 @@ // Call var builder = new ContextMenuBuilder(applicationFeatureCommandsStub, importCommandHandlerMock, - exportCommandHandlerMock, + exportCommandHandlerMock, updateCommandHandlerMock, viewCommandsMock, mapDataCollection, @@ -365,7 +365,7 @@ // Call var builder = new ContextMenuBuilder(applicationFeatureCommandsStub, importCommandHandlerMock, - exportCommandHandlerMock, + exportCommandHandlerMock, updateCommandHandlerMock, viewCommandsMock, mapDataCollection, @@ -438,7 +438,7 @@ // Call var builder = new ContextMenuBuilder(applicationFeatureCommandsStub, importCommandHandlerMock, - exportCommandHandlerMock, + exportCommandHandlerMock, updateCommandHandlerMock, viewCommandsMock, mapDataCollection, @@ -497,13 +497,9 @@ var builder = new CustomItemsOnlyContextMenuBuilder(); contextMenuBuilderProvider.Stub(p => p.Get(null, null)).IgnoreArguments().Return(builder); - var mapControl = mocks.Stub(); - mapControl.Expect(c => c.ZoomToAllVisibleLayers(mapData)); mocks.ReplayAll(); - mapLegendView.MapControl = mapControl; - - using (var contextMenu = info.ContextMenuStrip(mapData, null, null)) + using (ContextMenuStrip contextMenu = info.ContextMenuStrip(mapData, null, null)) { // Call contextMenu.Items[contextMenuZoomToAllIndex].PerformClick(); @@ -529,7 +525,7 @@ IsVisible = true }; - using (var contextMenu = info.ContextMenuStrip(mapData, null, null)) + using (ContextMenuStrip contextMenu = info.ContextMenuStrip(mapData, null, null)) { // Call TestDelegate call = () => contextMenu.Items[contextMenuZoomToAllIndex].PerformClick(); Index: Core/Plugins/test/Core.Plugins.Map.Test/Legend/MapLineDataTreeNodeInfoTest.cs =================================================================== diff -u -r5bf59860c8030dc0e3fd02d02d446bf2fba691c1 -ra7a7213570203593da0dfc8f4f9cfafabf69ca3e --- Core/Plugins/test/Core.Plugins.Map.Test/Legend/MapLineDataTreeNodeInfoTest.cs (.../MapLineDataTreeNodeInfoTest.cs) (revision 5bf59860c8030dc0e3fd02d02d446bf2fba691c1) +++ Core/Plugins/test/Core.Plugins.Map.Test/Legend/MapLineDataTreeNodeInfoTest.cs (.../MapLineDataTreeNodeInfoTest.cs) (revision a7a7213570203593da0dfc8f4f9cfafabf69ca3e) @@ -21,7 +21,9 @@ using System; using System.Collections.Generic; +using System.Drawing; using System.Linq; +using System.Windows.Forms; using Core.Common.Base; using Core.Common.Controls.TreeView; using Core.Common.Gui.ContextMenu; @@ -30,7 +32,6 @@ using Core.Common.Utils.Reflection; using Core.Components.Gis.Data; using Core.Components.Gis.Features; -using Core.Components.Gis.Forms; using Core.Components.Gis.Geometries; using Core.Plugins.Map.Legend; using Core.Plugins.Map.Properties; @@ -57,7 +58,7 @@ mapLegendView = new MapLegendView(contextMenuBuilderProvider); - TreeViewControl treeViewControl = TypeUtils.GetField(mapLegendView, "treeViewControl"); + var treeViewControl = TypeUtils.GetField(mapLegendView, "treeViewControl"); Dictionary treeNodeInfoLookup = TypeUtils.GetField>(treeViewControl, "tagTypeTreeNodeInfoLookup"); info = treeNodeInfoLookup[typeof(MapLineData)]; @@ -106,7 +107,7 @@ var mapLineData = new MapLineData("test data"); // Call - var text = info.Text(mapLineData); + string text = info.Text(mapLineData); // Assert Assert.AreEqual(mapLineData.Name, text); @@ -119,7 +120,7 @@ mocks.ReplayAll(); // Call - var image = info.Image(null); + Image image = info.Image(null); // Assert TestHelper.AssertImagesAreEqual(Resources.LineIcon, image); @@ -169,7 +170,7 @@ }; // Call - using (var contextMenu = info.ContextMenuStrip(mapData, null, null)) + using (ContextMenuStrip contextMenu = info.ContextMenuStrip(mapData, null, null)) { // Assert TestHelper.AssertContextMenuStripContainsItem(contextMenu, contextMenuZoomToAllIndex, @@ -194,7 +195,7 @@ }; // Call - using (var contextMenu = info.ContextMenuStrip(mapData, null, null)) + using (ContextMenuStrip contextMenu = info.ContextMenuStrip(mapData, null, null)) { // Assert TestHelper.AssertContextMenuStripContainsItem(contextMenu, contextMenuZoomToAllIndex, @@ -220,7 +221,7 @@ }; // Call - using (var contextMenu = info.ContextMenuStrip(mapData, null, null)) + using (ContextMenuStrip contextMenu = info.ContextMenuStrip(mapData, null, null)) { // Assert TestHelper.AssertContextMenuStripContainsItem(contextMenu, contextMenuZoomToAllIndex, @@ -247,13 +248,9 @@ var builder = new CustomItemsOnlyContextMenuBuilder(); contextMenuBuilderProvider.Stub(p => p.Get(null, null)).IgnoreArguments().Return(builder); - var mapControl = mocks.Stub(); - mapControl.Expect(c => c.ZoomToAllVisibleLayers(mapData)); mocks.ReplayAll(); - mapLegendView.MapControl = mapControl; - - using (var contextMenu = info.ContextMenuStrip(mapData, null, null)) + using (ContextMenuStrip contextMenu = info.ContextMenuStrip(mapData, null, null)) { // Call contextMenu.Items[contextMenuZoomToAllIndex].PerformClick(); @@ -279,7 +276,7 @@ IsVisible = true }; - using (var contextMenu = info.ContextMenuStrip(mapData, null, null)) + using (ContextMenuStrip contextMenu = info.ContextMenuStrip(mapData, null, null)) { // Call TestDelegate call = () => contextMenu.Items[contextMenuZoomToAllIndex].PerformClick(); @@ -297,7 +294,7 @@ var mapLineData = new MapLineData("test data"); // Call - var canCheck = info.CanCheck(mapLineData); + bool canCheck = info.CanCheck(mapLineData); // Assert Assert.IsTrue(canCheck); @@ -311,7 +308,7 @@ var mapLineData = new MapLineData("test data"); // Call - var canDrag = info.CanDrag(mapLineData, null); + bool canDrag = info.CanDrag(mapLineData, null); // Assert Assert.IsTrue(canDrag); @@ -329,7 +326,7 @@ }; // Call - var canCheck = info.IsChecked(mapLineData); + bool canCheck = info.IsChecked(mapLineData); // Assert Assert.AreEqual(isVisible, canCheck); Index: Core/Plugins/test/Core.Plugins.Map.Test/Legend/MapPointDataTreeNodeInfoTest.cs =================================================================== diff -u -r8b3f995635bbd317936d1607058bb0e80c3c5508 -ra7a7213570203593da0dfc8f4f9cfafabf69ca3e --- Core/Plugins/test/Core.Plugins.Map.Test/Legend/MapPointDataTreeNodeInfoTest.cs (.../MapPointDataTreeNodeInfoTest.cs) (revision 8b3f995635bbd317936d1607058bb0e80c3c5508) +++ Core/Plugins/test/Core.Plugins.Map.Test/Legend/MapPointDataTreeNodeInfoTest.cs (.../MapPointDataTreeNodeInfoTest.cs) (revision a7a7213570203593da0dfc8f4f9cfafabf69ca3e) @@ -21,7 +21,9 @@ using System; using System.Collections.Generic; +using System.Drawing; using System.Linq; +using System.Windows.Forms; using Core.Common.Base; using Core.Common.Controls.TreeView; using Core.Common.Gui.ContextMenu; @@ -30,7 +32,6 @@ using Core.Common.Utils.Reflection; using Core.Components.Gis.Data; using Core.Components.Gis.Features; -using Core.Components.Gis.Forms; using Core.Components.Gis.Geometries; using Core.Plugins.Map.Legend; using Core.Plugins.Map.Properties; @@ -57,7 +58,7 @@ mapLegendView = new MapLegendView(contextMenuBuilderProvider); - TreeViewControl treeViewControl = TypeUtils.GetField(mapLegendView, "treeViewControl"); + var treeViewControl = TypeUtils.GetField(mapLegendView, "treeViewControl"); Dictionary treeNodeInfoLookup = TypeUtils.GetField>(treeViewControl, "tagTypeTreeNodeInfoLookup"); info = treeNodeInfoLookup[typeof(MapPointData)]; @@ -106,7 +107,7 @@ var mapPointData = new MapPointData("MapPointData"); // Call - var text = info.Text(mapPointData); + string text = info.Text(mapPointData); // Assert Assert.AreEqual(mapPointData.Name, text); @@ -119,7 +120,7 @@ mocks.ReplayAll(); // Call - var image = info.Image(null); + Image image = info.Image(null); // Assert TestHelper.AssertImagesAreEqual(Resources.PointsIcon, image); @@ -169,7 +170,7 @@ }; // Call - using (var contextMenu = info.ContextMenuStrip(mapData, null, null)) + using (ContextMenuStrip contextMenu = info.ContextMenuStrip(mapData, null, null)) { // Assert TestHelper.AssertContextMenuStripContainsItem(contextMenu, contextMenuZoomToAllIndex, @@ -194,7 +195,7 @@ }; // Call - using (var contextMenu = info.ContextMenuStrip(mapData, null, null)) + using (ContextMenuStrip contextMenu = info.ContextMenuStrip(mapData, null, null)) { // Assert TestHelper.AssertContextMenuStripContainsItem(contextMenu, contextMenuZoomToAllIndex, @@ -220,7 +221,7 @@ }; // Call - using (var contextMenu = info.ContextMenuStrip(mapData, null, null)) + using (ContextMenuStrip contextMenu = info.ContextMenuStrip(mapData, null, null)) { // Assert TestHelper.AssertContextMenuStripContainsItem(contextMenu, contextMenuZoomToAllIndex, @@ -240,20 +241,16 @@ IsVisible = true, Features = new[] { - new MapFeature(Enumerable.Empty()), + new MapFeature(Enumerable.Empty()) } }; var builder = new CustomItemsOnlyContextMenuBuilder(); contextMenuBuilderProvider.Stub(p => p.Get(null, null)).IgnoreArguments().Return(builder); - var mapControl = mocks.Stub(); - mapControl.Expect(c => c.ZoomToAllVisibleLayers(mapData)); mocks.ReplayAll(); - mapLegendView.MapControl = mapControl; - - using (var contextMenu = info.ContextMenuStrip(mapData, null, null)) + using (ContextMenuStrip contextMenu = info.ContextMenuStrip(mapData, null, null)) { // Call contextMenu.Items[contextMenuZoomToAllIndex].PerformClick(); @@ -279,7 +276,7 @@ IsVisible = true }; - using (var contextMenu = info.ContextMenuStrip(mapData, null, null)) + using (ContextMenuStrip contextMenu = info.ContextMenuStrip(mapData, null, null)) { // Call TestDelegate call = () => contextMenu.Items[contextMenuZoomToAllIndex].PerformClick(); @@ -297,7 +294,7 @@ var mapPointData = new MapPointData("test data"); // Call - var canCheck = info.CanCheck(mapPointData); + bool canCheck = info.CanCheck(mapPointData); // Assert Assert.IsTrue(canCheck); @@ -311,7 +308,7 @@ var mapPointData = new MapPointData("test data"); // Call - var canDrag = info.CanDrag(mapPointData, null); + bool canDrag = info.CanDrag(mapPointData, null); // Assert Assert.IsTrue(canDrag); @@ -329,7 +326,7 @@ }; // Call - var canCheck = info.IsChecked(mapPointData); + bool canCheck = info.IsChecked(mapPointData); // Assert Assert.AreEqual(isVisible, canCheck); Index: Core/Plugins/test/Core.Plugins.Map.Test/Legend/MapPolygonDataTreeNodeInfoTest.cs =================================================================== diff -u -r8b3f995635bbd317936d1607058bb0e80c3c5508 -ra7a7213570203593da0dfc8f4f9cfafabf69ca3e --- Core/Plugins/test/Core.Plugins.Map.Test/Legend/MapPolygonDataTreeNodeInfoTest.cs (.../MapPolygonDataTreeNodeInfoTest.cs) (revision 8b3f995635bbd317936d1607058bb0e80c3c5508) +++ Core/Plugins/test/Core.Plugins.Map.Test/Legend/MapPolygonDataTreeNodeInfoTest.cs (.../MapPolygonDataTreeNodeInfoTest.cs) (revision a7a7213570203593da0dfc8f4f9cfafabf69ca3e) @@ -21,7 +21,9 @@ using System; using System.Collections.Generic; +using System.Drawing; using System.Linq; +using System.Windows.Forms; using Core.Common.Base; using Core.Common.Controls.TreeView; using Core.Common.Gui.ContextMenu; @@ -30,7 +32,6 @@ using Core.Common.Utils.Reflection; using Core.Components.Gis.Data; using Core.Components.Gis.Features; -using Core.Components.Gis.Forms; using Core.Components.Gis.Geometries; using Core.Plugins.Map.Legend; using Core.Plugins.Map.Properties; @@ -57,7 +58,7 @@ mapLegendView = new MapLegendView(contextMenuBuilderProvider); - TreeViewControl treeViewControl = TypeUtils.GetField(mapLegendView, "treeViewControl"); + var treeViewControl = TypeUtils.GetField(mapLegendView, "treeViewControl"); Dictionary treeNodeInfoLookup = TypeUtils.GetField>(treeViewControl, "tagTypeTreeNodeInfoLookup"); info = treeNodeInfoLookup[typeof(MapPolygonData)]; @@ -106,7 +107,7 @@ var mapPolygonData = new MapPolygonData("MapPolygonData"); // Call - var text = info.Text(mapPolygonData); + string text = info.Text(mapPolygonData); // Assert Assert.AreEqual(mapPolygonData.Name, text); @@ -119,7 +120,7 @@ mocks.ReplayAll(); // Call - var image = info.Image(null); + Image image = info.Image(null); // Assert TestHelper.AssertImagesAreEqual(Resources.AreaIcon, image); @@ -169,7 +170,7 @@ }; // Call - using (var contextMenu = info.ContextMenuStrip(mapData, null, null)) + using (ContextMenuStrip contextMenu = info.ContextMenuStrip(mapData, null, null)) { // Assert TestHelper.AssertContextMenuStripContainsItem(contextMenu, contextMenuZoomToAllIndex, @@ -194,7 +195,7 @@ }; // Call - using (var contextMenu = info.ContextMenuStrip(mapData, null, null)) + using (ContextMenuStrip contextMenu = info.ContextMenuStrip(mapData, null, null)) { // Assert TestHelper.AssertContextMenuStripContainsItem(contextMenu, contextMenuZoomToAllIndex, @@ -220,7 +221,7 @@ }; // Call - using (var contextMenu = info.ContextMenuStrip(mapData, null, null)) + using (ContextMenuStrip contextMenu = info.ContextMenuStrip(mapData, null, null)) { // Assert TestHelper.AssertContextMenuStripContainsItem(contextMenu, contextMenuZoomToAllIndex, @@ -247,13 +248,9 @@ var builder = new CustomItemsOnlyContextMenuBuilder(); contextMenuBuilderProvider.Stub(p => p.Get(null, null)).IgnoreArguments().Return(builder); - var mapControl = mocks.Stub(); - mapControl.Expect(c => c.ZoomToAllVisibleLayers(mapData)); mocks.ReplayAll(); - mapLegendView.MapControl = mapControl; - - using (var contextMenu = info.ContextMenuStrip(mapData, null, null)) + using (ContextMenuStrip contextMenu = info.ContextMenuStrip(mapData, null, null)) { // Call contextMenu.Items[contextMenuZoomToAllIndex].PerformClick(); @@ -279,7 +276,7 @@ IsVisible = true }; - using (var contextMenu = info.ContextMenuStrip(mapData, null, null)) + using (ContextMenuStrip contextMenu = info.ContextMenuStrip(mapData, null, null)) { // Call TestDelegate call = () => contextMenu.Items[contextMenuZoomToAllIndex].PerformClick(); @@ -297,7 +294,7 @@ var mapPolygonData = new MapPolygonData("test data"); // Call - var canCheck = info.CanCheck(mapPolygonData); + bool canCheck = info.CanCheck(mapPolygonData); // Assert Assert.IsTrue(canCheck); @@ -311,7 +308,7 @@ var mapPolygonData = new MapPolygonData("test data"); // Call - var canDrag = info.CanDrag(mapPolygonData, null); + bool canDrag = info.CanDrag(mapPolygonData, null); // Assert Assert.IsTrue(canDrag); @@ -329,7 +326,7 @@ }; // Call - var canCheck = info.IsChecked(mapPolygonData); + bool canCheck = info.IsChecked(mapPolygonData); // Assert Assert.AreEqual(isVisible, canCheck);