Index: Core/Plugins/src/Core.Plugins.ProjectExplorer/ProjectExplorer.cs =================================================================== diff -u -r650277f75faab8d29b4a07b738f0fd2a99ac7ed3 -r0da3e250b166a2e82b6f58fb1e9841ccbff64819 --- Core/Plugins/src/Core.Plugins.ProjectExplorer/ProjectExplorer.cs (.../ProjectExplorer.cs) (revision 650277f75faab8d29b4a07b738f0fd2a99ac7ed3) +++ Core/Plugins/src/Core.Plugins.ProjectExplorer/ProjectExplorer.cs (.../ProjectExplorer.cs) (revision 0da3e250b166a2e82b6f58fb1e9841ccbff64819) @@ -72,14 +72,6 @@ BindTreeInteractionEvents(); } - public TreeViewControl TreeViewControl - { - get - { - return treeViewControl; - } - } - public object Data { get @@ -99,7 +91,7 @@ { get { - return TreeViewControl.SelectedData; + return treeViewControl.SelectedData; } } Index: Core/Plugins/test/Core.Plugins.Map.Test/Legend/MapLegendViewTest.cs =================================================================== diff -u -r650277f75faab8d29b4a07b738f0fd2a99ac7ed3 -r0da3e250b166a2e82b6f58fb1e9841ccbff64819 --- Core/Plugins/test/Core.Plugins.Map.Test/Legend/MapLegendViewTest.cs (.../MapLegendViewTest.cs) (revision 650277f75faab8d29b4a07b738f0fd2a99ac7ed3) +++ Core/Plugins/test/Core.Plugins.Map.Test/Legend/MapLegendViewTest.cs (.../MapLegendViewTest.cs) (revision 0da3e250b166a2e82b6f58fb1e9841ccbff64819) @@ -66,15 +66,15 @@ // Call using (var view = new MapLegendView(contextMenuBuilderProvider, parentWindow)) { - var treeView = TypeUtils.GetField(view, "treeViewControl"); + var treeViewControl = TypeUtils.GetField(view, "treeViewControl"); // Assert Assert.IsInstanceOf(view); Assert.IsInstanceOf(view); Assert.IsNull(view.Data); Assert.AreEqual(Resources.General_Map, view.Text); - Assert.IsNotNull(treeView); - Assert.IsInstanceOf(treeView); + Assert.IsNotNull(treeViewControl); + Assert.IsInstanceOf(treeViewControl); } } Index: Core/Plugins/test/Core.Plugins.ProjectExplorer.Test/ProjectExplorerTest.cs =================================================================== diff -u -r650277f75faab8d29b4a07b738f0fd2a99ac7ed3 -r0da3e250b166a2e82b6f58fb1e9841ccbff64819 --- Core/Plugins/test/Core.Plugins.ProjectExplorer.Test/ProjectExplorerTest.cs (.../ProjectExplorerTest.cs) (revision 650277f75faab8d29b4a07b738f0fd2a99ac7ed3) +++ Core/Plugins/test/Core.Plugins.ProjectExplorer.Test/ProjectExplorerTest.cs (.../ProjectExplorerTest.cs) (revision 0da3e250b166a2e82b6f58fb1e9841ccbff64819) @@ -71,11 +71,13 @@ // Call using (var explorer = new ProjectExplorer(viewCommands, treeNodeInfos)) { + var treeViewControl = TypeUtils.GetField(explorer, "treeViewControl"); + // Assert Assert.IsInstanceOf(explorer); Assert.IsInstanceOf(explorer); Assert.IsNull(explorer.Data); - Assert.IsInstanceOf(explorer.TreeViewControl); + Assert.IsInstanceOf(treeViewControl); } mocks.VerifyAll(); } @@ -100,11 +102,13 @@ using (var explorer = new ProjectExplorer(viewCommands, treeNodeInfos)) { + var treeViewControl = TypeUtils.GetField(explorer, "treeViewControl"); + // Call explorer.Data = projectStub; // Assert - Assert.AreSame(projectStub, explorer.TreeViewControl.Data); + Assert.AreSame(projectStub, treeViewControl.Data); } mocks.VerifyAll(); } @@ -141,8 +145,10 @@ Data = projectStub }) { + var treeViewControl = TypeUtils.GetField(explorer, "treeViewControl"); + // Call - explorer.TreeViewControl.TryRemoveNodeForData(projectStub); + treeViewControl.TryRemoveNodeForData(projectStub); } // Assert mocks.VerifyAll(); @@ -185,13 +191,15 @@ Data = projectStub }) { - WindowsFormsTestHelper.Show(explorer.TreeViewControl); + var treeViewControl = TypeUtils.GetField(explorer, "treeViewControl"); + WindowsFormsTestHelper.Show(treeViewControl); + var selectionChangedCount = 0; explorer.SelectionChanged += (sender, args) => selectionChangedCount++; // Call - explorer.TreeViewControl.TrySelectNodeForData(stringA); + treeViewControl.TrySelectNodeForData(stringA); // Assert Assert.AreEqual(1, selectionChangedCount); @@ -238,10 +246,12 @@ form.Controls.Add(explorer); form.Show(); - TypeUtils.GetField(explorer.TreeViewControl, "treeView").Name = treeIdentifier; + var treeViewControl = TypeUtils.GetField(explorer, "treeViewControl"); + TypeUtils.GetField(treeViewControl, "treeView").Name = treeIdentifier; + // Precondition - Assert.AreSame(explorer.TreeViewControl.SelectedData, projectStub); + Assert.AreSame(treeViewControl.SelectedData, projectStub); var tester = new TreeViewTester(treeIdentifier); @@ -288,9 +298,11 @@ Data = projectStub }) { - WindowsFormsTestHelper.Show(explorer.TreeViewControl); - explorer.TreeViewControl.TrySelectNodeForData(stringA); + var treeViewControl = TypeUtils.GetField(explorer, "treeViewControl"); + WindowsFormsTestHelper.Show(treeViewControl); + treeViewControl.TrySelectNodeForData(stringA); + // Call var selection = explorer.Selection;