Index: src/Plugins/Wti/Wti.Data/PipingFailureMechanism.cs =================================================================== diff -u -r5f7007ed48dccd78b0a07db987bf234a6705ec9b -r4959b3b9b84eec4cb80ec43c037579d9177b3d02 --- src/Plugins/Wti/Wti.Data/PipingFailureMechanism.cs (.../PipingFailureMechanism.cs) (revision 5f7007ed48dccd78b0a07db987bf234a6705ec9b) +++ src/Plugins/Wti/Wti.Data/PipingFailureMechanism.cs (.../PipingFailureMechanism.cs) (revision 4959b3b9b84eec4cb80ec43c037579d9177b3d02) @@ -1,4 +1,5 @@ -using System.Collections.Generic; +using System.Collections; +using System.Collections.Generic; using System.Linq; using DelftTools.Shell.Core; @@ -17,19 +18,25 @@ public PipingFailureMechanism() { SurfaceLines = Enumerable.Empty(); + SoilProfiles = Enumerable.Empty(); PipingData = new PipingData(); } /// - /// Gets the available surface lines within the scope of the piping failure mechanism. + /// Gets the available within the scope of the piping failure mechanism. /// public IEnumerable SurfaceLines { get; private set; } /// /// Gets the , which contains input and output of a piping calculation. /// - public PipingData PipingData { get; set; } + public PipingData PipingData { get; private set; } + /// + /// Gets the available profiles within the scope of the piping failure mechanism. + /// + public IEnumerable SoilProfiles { get; private set; } + public void Attach(IObserver observer) { observers.Add(observer); Index: src/Plugins/Wti/Wti.Forms/NodePresenters/PipingFailureMechanismNodePresenter.cs =================================================================== diff -u -r5f7007ed48dccd78b0a07db987bf234a6705ec9b -r4959b3b9b84eec4cb80ec43c037579d9177b3d02 --- src/Plugins/Wti/Wti.Forms/NodePresenters/PipingFailureMechanismNodePresenter.cs (.../PipingFailureMechanismNodePresenter.cs) (revision 5f7007ed48dccd78b0a07db987bf234a6705ec9b) +++ src/Plugins/Wti/Wti.Forms/NodePresenters/PipingFailureMechanismNodePresenter.cs (.../PipingFailureMechanismNodePresenter.cs) (revision 4959b3b9b84eec4cb80ec43c037579d9177b3d02) @@ -8,8 +8,10 @@ namespace Wti.Forms.NodePresenters { - public class PipingFailureMechanismNodePresenter : ITreeNodePresenter { + public class PipingFailureMechanismNodePresenter : ITreeNodePresenter + { public ITreeView TreeView { get; set; } + public Type NodeTagType { get @@ -26,13 +28,14 @@ public IEnumerable GetChildNodeObjects(object parentNodeData, ITreeNode node) { - PipingFailureMechanism failureMechanism = (PipingFailureMechanism)parentNodeData; + PipingFailureMechanism failureMechanism = (PipingFailureMechanism) parentNodeData; + yield return failureMechanism.SoilProfiles; yield return failureMechanism.SurfaceLines; if (failureMechanism.PipingData != null) { yield return failureMechanism.PipingData; - } + } } public bool CanRenameNode(ITreeNode node) Index: src/Plugins/Wti/Wti.Forms/NodePresenters/PipingSoilProfileCollectionNodePresenter.cs =================================================================== diff -u --- src/Plugins/Wti/Wti.Forms/NodePresenters/PipingSoilProfileCollectionNodePresenter.cs (revision 0) +++ src/Plugins/Wti/Wti.Forms/NodePresenters/PipingSoilProfileCollectionNodePresenter.cs (revision 4959b3b9b84eec4cb80ec43c037579d9177b3d02) @@ -0,0 +1,94 @@ +using System; +using System.Collections; +using System.ComponentModel; +using System.Drawing; +using DelftTools.Controls; +using DelftTools.Utils.Collections; +using Wti.Forms.Properties; + +namespace Wti.Forms.NodePresenters +{ + /// + /// Tree node presenter representing the collection of piping surface line available for piping + /// calculations. + /// + public class PipingSoilProfileCollectionNodePresenter : ITreeNodePresenter + { + public ITreeView TreeView { get; set; } + + public Type NodeTagType + { + get + { + return typeof(IEnumerable); + } + } + + public void UpdateNode(ITreeNode parentNode, ITreeNode node, object nodeData) + { + node.Text = Resources.PipingSoilProfilesCollectionName; + node.ForegroundColor = Color.FromKnownColor(KnownColor.GrayText); + node.Image = Resources.FolderIcon; + } + + public IEnumerable GetChildNodeObjects(object parentNodeData, ITreeNode node) + { + yield break; + } + + public bool CanRenameNode(ITreeNode node) + { + return false; + } + + public bool CanRenameNodeTo(ITreeNode node, string newName) + { + return false; + } + + public void OnNodeRenamed(object nodeData, string newName) + { + throw new InvalidOperationException(string.Format("Cannot rename tree node of type {0}.", GetType().Name)); + } + + public void OnNodeChecked(ITreeNode node) {} + + public DragOperations CanDrag(object nodeData) + { + return DragOperations.None; + } + + public DragOperations CanDrop(object item, ITreeNode sourceNode, ITreeNode targetNode, DragOperations validOperations) + { + return DragOperations.None; + } + + public bool CanInsert(object item, ITreeNode sourceNode, ITreeNode targetNode) + { + return false; + } + + public void OnDragDrop(object item, object sourceParentNodeData, object targetParentNodeData, DragOperations operation, int position) {} + + public void OnNodeSelected(object nodeData) {} + + public IMenuItem GetContextMenu(ITreeNode sender, object nodeData) + { + return null; + } + + public void OnPropertyChanged(object sender, ITreeNode node, PropertyChangedEventArgs e) {} + + public void OnCollectionChanged(object sender, NotifyCollectionChangingEventArgs e) {} + + public bool CanRemove(object parentNodeData, object nodeData) + { + return false; + } + + public bool RemoveNodeData(object parentNodeData, object nodeData) + { + throw new InvalidOperationException(String.Format("Cannot delete node of type {0}.", GetType().Name)); + } + } +} \ No newline at end of file Index: src/Plugins/Wti/Wti.Forms/NodePresenters/PipingSurfaceLineCollectionNodePresenter.cs =================================================================== diff -u -rbb61ed227cf79e994b84019096e4297b2fbd4527 -r4959b3b9b84eec4cb80ec43c037579d9177b3d02 --- src/Plugins/Wti/Wti.Forms/NodePresenters/PipingSurfaceLineCollectionNodePresenter.cs (.../PipingSurfaceLineCollectionNodePresenter.cs) (revision bb61ed227cf79e994b84019096e4297b2fbd4527) +++ src/Plugins/Wti/Wti.Forms/NodePresenters/PipingSurfaceLineCollectionNodePresenter.cs (.../PipingSurfaceLineCollectionNodePresenter.cs) (revision 4959b3b9b84eec4cb80ec43c037579d9177b3d02) @@ -4,19 +4,17 @@ using System.ComponentModel; using System.Drawing; using System.Windows.Forms; - using DelftTools.Controls; using DelftTools.Controls.Swf; using DelftTools.Utils.Collections; - using Wti.Data; using Wti.Forms.Extensions; using Wti.Forms.Properties; namespace Wti.Forms.NodePresenters { /// - /// Tree node presenter representing the collection of surfacelines available for piping + /// Tree node presenter representing the collection of available for piping /// calculations. /// public class PipingSurfaceLineCollectionNodePresenter : ITreeNodePresenter @@ -46,7 +44,7 @@ public IEnumerable GetChildNodeObjects(object parentNodeData, ITreeNode node) { - var surfaceLines = (IEnumerable)parentNodeData; + var surfaceLines = (IEnumerable) parentNodeData; foreach (var pipingSurfaceLine in surfaceLines) { yield return pipingSurfaceLine; @@ -68,10 +66,7 @@ throw new InvalidOperationException(string.Format("Cannot rename tree node of type {0}.", GetType().Name)); } - public void OnNodeChecked(ITreeNode node) - { - - } + public void OnNodeChecked(ITreeNode node) {} public DragOperations CanDrag(object nodeData) { @@ -88,15 +83,9 @@ return false; } - public void OnDragDrop(object item, object sourceParentNodeData, object targetParentNodeData, DragOperations operation, int position) - { - - } + public void OnDragDrop(object item, object sourceParentNodeData, object targetParentNodeData, DragOperations operation, int position) {} - public void OnNodeSelected(object nodeData) - { - - } + public void OnNodeSelected(object nodeData) {} public IMenuItem GetContextMenu(ITreeNode sender, object nodeData) { @@ -107,15 +96,9 @@ return null; } - public void OnPropertyChanged(object sender, ITreeNode node, PropertyChangedEventArgs e) - { - - } + public void OnPropertyChanged(object sender, ITreeNode node, PropertyChangedEventArgs e) {} - public void OnCollectionChanged(object sender, NotifyCollectionChangingEventArgs e) - { - - } + public void OnCollectionChanged(object sender, NotifyCollectionChangingEventArgs e) {} public bool CanRemove(object parentNodeData, object nodeData) { Index: src/Plugins/Wti/Wti.Forms/Properties/Resources.Designer.cs =================================================================== diff -u -r5f7007ed48dccd78b0a07db987bf234a6705ec9b -r4959b3b9b84eec4cb80ec43c037579d9177b3d02 --- src/Plugins/Wti/Wti.Forms/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 5f7007ed48dccd78b0a07db987bf234a6705ec9b) +++ src/Plugins/Wti/Wti.Forms/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 4959b3b9b84eec4cb80ec43c037579d9177b3d02) @@ -694,6 +694,15 @@ } /// + /// Looks up a localized string similar to Ondergrondprofielen. + /// + public static string PipingSoilProfilesCollectionName { + get { + return ResourceManager.GetString("PipingSoilProfilesCollectionName", resourceCulture); + } + } + + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// public static System.Drawing.Bitmap PipingSurfaceLineIcon { Index: src/Plugins/Wti/Wti.Forms/Properties/Resources.resx =================================================================== diff -u -r5f7007ed48dccd78b0a07db987bf234a6705ec9b -r4959b3b9b84eec4cb80ec43c037579d9177b3d02 --- src/Plugins/Wti/Wti.Forms/Properties/Resources.resx (.../Resources.resx) (revision 5f7007ed48dccd78b0a07db987bf234a6705ec9b) +++ src/Plugins/Wti/Wti.Forms/Properties/Resources.resx (.../Resources.resx) (revision 4959b3b9b84eec4cb80ec43c037579d9177b3d02) @@ -352,4 +352,7 @@ Kan geen nieuwe piping toetsing starten, omdat er al een piping toetsing is gestart voor dit project. + + Ondergrondprofielen + \ No newline at end of file Index: src/Plugins/Wti/Wti.Forms/Wti.Forms.csproj =================================================================== diff -u -r2ff69dfc67c77d80c1ed2f4f1f9bc0172e28e518 -r4959b3b9b84eec4cb80ec43c037579d9177b3d02 --- src/Plugins/Wti/Wti.Forms/Wti.Forms.csproj (.../Wti.Forms.csproj) (revision 2ff69dfc67c77d80c1ed2f4f1f9bc0172e28e518) +++ src/Plugins/Wti/Wti.Forms/Wti.Forms.csproj (.../Wti.Forms.csproj) (revision 4959b3b9b84eec4cb80ec43c037579d9177b3d02) @@ -57,6 +57,7 @@ + Index: src/Plugins/Wti/Wti.Plugin/WtiGuiPlugin.cs =================================================================== diff -u -rbb61ed227cf79e994b84019096e4297b2fbd4527 -r4959b3b9b84eec4cb80ec43c037579d9177b3d02 --- src/Plugins/Wti/Wti.Plugin/WtiGuiPlugin.cs (.../WtiGuiPlugin.cs) (revision bb61ed227cf79e994b84019096e4297b2fbd4527) +++ src/Plugins/Wti/Wti.Plugin/WtiGuiPlugin.cs (.../WtiGuiPlugin.cs) (revision 4959b3b9b84eec4cb80ec43c037579d9177b3d02) @@ -78,6 +78,7 @@ { ImportSurfaceLinesAction = Gui.CommandHandler.ImportToGuiSelection }; + yield return new PipingSoilProfileCollectionNodePresenter(); yield return new PipingOutputNodePresenter(); } } Index: test/Plugins/Wti/Wti.Data.Test/PipingFailureMechanismTest.cs =================================================================== diff -u -r8af9f2baf8d6ed5b2450bd9812328bf0efd7e339 -r4959b3b9b84eec4cb80ec43c037579d9177b3d02 --- test/Plugins/Wti/Wti.Data.Test/PipingFailureMechanismTest.cs (.../PipingFailureMechanismTest.cs) (revision 8af9f2baf8d6ed5b2450bd9812328bf0efd7e339) +++ test/Plugins/Wti/Wti.Data.Test/PipingFailureMechanismTest.cs (.../PipingFailureMechanismTest.cs) (revision 4959b3b9b84eec4cb80ec43c037579d9177b3d02) @@ -23,6 +23,7 @@ // assert CollectionAssert.IsEmpty(piping.SurfaceLines); + CollectionAssert.IsEmpty(piping.SoilProfiles); Assert.IsNotNull(piping.PipingData); } Index: test/Plugins/Wti/Wti.Forms.Test/NodePresenters/PipingFailureMechanismNodePresenterTest.cs =================================================================== diff -u -r97ebda114265b9ccdc6cf73bab8312e5422e3de4 -r4959b3b9b84eec4cb80ec43c037579d9177b3d02 --- test/Plugins/Wti/Wti.Forms.Test/NodePresenters/PipingFailureMechanismNodePresenterTest.cs (.../PipingFailureMechanismNodePresenterTest.cs) (revision 97ebda114265b9ccdc6cf73bab8312e5422e3de4) +++ test/Plugins/Wti/Wti.Forms.Test/NodePresenters/PipingFailureMechanismNodePresenterTest.cs (.../PipingFailureMechanismNodePresenterTest.cs) (revision 4959b3b9b84eec4cb80ec43c037579d9177b3d02) @@ -1,9 +1,8 @@ using System; using System.ComponentModel; +using System.Linq; using DelftTools.Controls; using DelftTools.Utils.Collections; -using System.Linq; - using NUnit.Framework; using Rhino.Mocks; using Wti.Data; @@ -64,9 +63,10 @@ var children = nodePresenter.GetChildNodeObjects(pipingFailureMechanism, nodeMock).OfType().ToArray(); // Assert - Assert.AreEqual(2, children.Length); - Assert.AreSame(pipingFailureMechanism.SurfaceLines, children[0]); - Assert.AreSame(pipingFailureMechanism.PipingData, children[1]); + Assert.AreEqual(3, children.Length); + Assert.AreSame(pipingFailureMechanism.SoilProfiles, children[0]); + Assert.AreSame(pipingFailureMechanism.SurfaceLines, children[1]); + Assert.AreSame(pipingFailureMechanism.PipingData, children[2]); mocks.VerifyAll(); // Expect no calls on tree node } Index: test/Plugins/Wti/Wti.Forms.Test/NodePresenters/PipingSoilProfileCollectionNodePresenterTest.cs =================================================================== diff -u --- test/Plugins/Wti/Wti.Forms.Test/NodePresenters/PipingSoilProfileCollectionNodePresenterTest.cs (revision 0) +++ test/Plugins/Wti/Wti.Forms.Test/NodePresenters/PipingSoilProfileCollectionNodePresenterTest.cs (revision 4959b3b9b84eec4cb80ec43c037579d9177b3d02) @@ -0,0 +1,317 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Linq; +using DelftTools.Controls; +using DelftTools.Utils.Collections; +using NUnit.Framework; +using Rhino.Mocks; +using Wti.Forms.NodePresenters; +using WtiFormsResources = Wti.Forms.Properties.Resources; + +namespace Wti.Forms.Test.NodePresenters +{ + [TestFixture] + public class PipingSoilProfileCollectionNodePresenterTest + { + [Test] + public void DefaultConstructor_ExpectedValues() + { + // Call + var nodePresenter = new PipingSoilProfileCollectionNodePresenter(); + + // Assert + Assert.IsInstanceOf(nodePresenter); + Assert.IsNull(nodePresenter.TreeView); + Assert.AreEqual(typeof(IEnumerable), nodePresenter.NodeTagType); + } + + [Test] + public void UpdateNode_WithData_InitializeNode() + { + // Setup + var mocks = new MockRepository(); + var soilProfileCollectionNodeStub = mocks.Stub(); + mocks.ReplayAll(); + + var nodePresenter = new PipingSoilProfileCollectionNodePresenter(); + + IEnumerable surfaceLinesCollection = Enumerable.Empty(); + + // Call + nodePresenter.UpdateNode(null, soilProfileCollectionNodeStub, surfaceLinesCollection); + + // Assert + Assert.AreEqual(WtiFormsResources.PipingSoilProfilesCollectionName, soilProfileCollectionNodeStub.Text); + Assert.AreEqual(Color.FromKnownColor(KnownColor.GrayText), soilProfileCollectionNodeStub.ForegroundColor); + Assert.AreEqual(16, soilProfileCollectionNodeStub.Image.Height); + Assert.AreEqual(16, soilProfileCollectionNodeStub.Image.Width); + } + + [Test] + public void GetChildNodeObjects_Always_ReturnEmpty() + { + // Setup + var mocks = new MockRepository(); + var nodeMock = mocks.StrictMock(); + mocks.ReplayAll(); + + var nodePresenter = new PipingSoilProfileCollectionNodePresenter(); + + IEnumerable surfaceLinesCollection = new object[0]; + + // Call + var children = nodePresenter.GetChildNodeObjects(surfaceLinesCollection, nodeMock); + + // Assert + CollectionAssert.IsEmpty(children); + mocks.VerifyAll(); // Expect no calls on tree node + } + + [Test] + public void CanRenameNode_Always_ReturnFalse() + { + // Setup + var mocks = new MockRepository(); + var nodeMock = mocks.StrictMock(); + mocks.ReplayAll(); + + var nodePresenter = new PipingSoilProfileCollectionNodePresenter(); + + // Call + var renameAllowed = nodePresenter.CanRenameNode(nodeMock); + + // Assert + Assert.IsFalse(renameAllowed); + mocks.VerifyAll(); // Expect no calls on tree node + } + + [Test] + public void CanRenameNodeTo_Always_ReturnFalse() + { + // Setup + var mocks = new MockRepository(); + var nodeMock = mocks.StrictMock(); + mocks.ReplayAll(); + + var nodePresenter = new PipingSoilProfileCollectionNodePresenter(); + + // Call + var renameAllowed = nodePresenter.CanRenameNodeTo(nodeMock, ""); + + // Assert + Assert.IsFalse(renameAllowed); + mocks.ReplayAll(); // Expect no calls on tree node + } + + [Test] + public void OnNodeRenamed_Always_ThrowInvalidOperationException() + { + // Setup + var mocks = new MockRepository(); + var nodeMock = mocks.StrictMock(); + mocks.ReplayAll(); + + var nodePresenter = new PipingSoilProfileCollectionNodePresenter(); + + // Call + TestDelegate call = () => { nodePresenter.OnNodeRenamed(nodeMock, ""); }; + + // Assert + var exception = Assert.Throws(call); + var expectedMessage = string.Format("Cannot rename tree node of type {0}.", nodePresenter.GetType().Name); + Assert.AreEqual(expectedMessage, exception.Message); + mocks.ReplayAll(); // Expect no calls on tree node + } + + [Test] + public void OnNodeChecked_Always_DoNothing() + { + // Setup + var mocks = new MockRepository(); + var nodeMock = mocks.StrictMock(); + mocks.ReplayAll(); + + var nodePresenter = new PipingSoilProfileCollectionNodePresenter(); + + // Call + nodePresenter.OnNodeChecked(nodeMock); + + // Assert + mocks.VerifyAll(); // Expect no calls on tree node + } + + [Test] + public void CanDrag_Always_ReturnNone() + { + // Setup + var mocks = new MockRepository(); + var dataMock = mocks.StrictMock(); + mocks.ReplayAll(); + + var nodePresenter = new PipingSoilProfileCollectionNodePresenter(); + + // Call + DragOperations dragAllowed = nodePresenter.CanDrag(dataMock); + + // Assert + Assert.AreEqual(DragOperations.None, dragAllowed); + mocks.VerifyAll(); + } + + [Test] + public void CanDrop_Always_ReturnNone() + { + // Setup + var mocks = new MockRepository(); + var dataMock = mocks.StrictMock(); + var sourceMock = mocks.StrictMock(); + var targetMock = mocks.StrictMock(); + mocks.ReplayAll(); + + var nodePresenter = new PipingSoilProfileCollectionNodePresenter(); + + // Call + DragOperations dropAllowed = nodePresenter.CanDrop(dataMock, sourceMock, targetMock, DragOperations.Move); + + // Assert + Assert.AreEqual(DragOperations.None, dropAllowed); + mocks.VerifyAll(); // Expect no calls on mocks. + } + + [Test] + public void CanInsert_Always_ReturnFalse() + { + // Setup + var mocks = new MockRepository(); + var dataMock = mocks.StrictMock(); + var sourceMock = mocks.StrictMock(); + var targetMock = mocks.StrictMock(); + mocks.ReplayAll(); + + var nodePresenter = new PipingSoilProfileCollectionNodePresenter(); + + // Call + bool insertionAllowed = nodePresenter.CanInsert(dataMock, sourceMock, targetMock); + + // Assert + Assert.IsFalse(insertionAllowed); + mocks.VerifyAll(); // Expect no calls on arguments + } + + [Test] + public void OnDragDrop_Always_DoNothing() + { + // Setup + var mocks = new MockRepository(); + var dataMock = mocks.StrictMock(); + var sourceParentNodeMock = mocks.StrictMock(); + var targetParentNodeDataMock = mocks.StrictMock(); + mocks.ReplayAll(); + + var nodePresenter = new PipingSoilProfileCollectionNodePresenter(); + + // Call + nodePresenter.OnDragDrop(dataMock, sourceParentNodeMock, targetParentNodeDataMock, DragOperations.Move, 2); + + // Assert + mocks.VerifyAll(); // Expect no calls on arguments + } + + [Test] + public void OnNodeSelected_Always_DoNothing() + { + // Setup + var mocks = new MockRepository(); + var dataMock = mocks.StrictMock(); + mocks.ReplayAll(); + + var nodePresenter = new PipingSoilProfileCollectionNodePresenter(); + + // Call + nodePresenter.OnNodeSelected(dataMock); + + // Assert + mocks.VerifyAll(); // Expect no calls on arguments + } + + [Test] + public void OnPropertyChange_Always_DoNothing() + { + // Setup + var mocks = new MockRepository(); + var dataMock = mocks.StrictMock(); + var nodeMock = mocks.StrictMock(); + var eventArgsMock = mocks.StrictMock(""); + mocks.ReplayAll(); + + var nodePresenter = new PipingSoilProfileCollectionNodePresenter(); + + // Call + nodePresenter.OnPropertyChanged(dataMock, nodeMock, eventArgsMock); + + // Assert + mocks.VerifyAll(); // Expect no calls on arguments + } + + [Test] + public void OnCollectionChange_Always_DoNothing() + { + // Setup + var mocks = new MockRepository(); + var dataMock = mocks.StrictMock(); + var eventArgsMock = mocks.StrictMock(); + mocks.ReplayAll(); + + var nodePresenter = new PipingSoilProfileCollectionNodePresenter(); + + // Call + nodePresenter.OnCollectionChanged(dataMock, eventArgsMock); + + // Assert + mocks.VerifyAll(); // Expect no calls on arguments + } + + [Test] + public void CanRemove_Always_ReturnFalse() + { + // Setup + var mocks = new MockRepository(); + var dataMock = mocks.StrictMock(); + var nodeMock = mocks.StrictMock(); + mocks.ReplayAll(); + + var nodePresenter = new PipingSoilProfileCollectionNodePresenter(); + + // Call + bool removalAllowed = nodePresenter.CanRemove(dataMock, nodeMock); + + // Assert + Assert.IsFalse(removalAllowed); + mocks.VerifyAll(); // Expect no calls on arguments + } + + [Test] + public void RemoveNodeData_Always_ThrowInvalidOperationException() + { + // setup + var mocks = new MockRepository(); + var parentNodeDataMock = mocks.StrictMock(); + var nodeDataMock = mocks.StrictMock(); + mocks.ReplayAll(); + + var nodePresenter = new PipingSoilProfileCollectionNodePresenter(); + + // call + TestDelegate call = () => nodePresenter.RemoveNodeData(parentNodeDataMock, nodeDataMock); + + // assert + var exception = Assert.Throws(call); + var expectedMessage = string.Format("Cannot delete node of type {0}.", nodePresenter.GetType().Name); + Assert.AreEqual(expectedMessage, exception.Message); + mocks.VerifyAll(); // Expect no calls on arguments + } + } +} \ No newline at end of file Index: test/Plugins/Wti/Wti.Forms.Test/Wti.Forms.Test.csproj =================================================================== diff -u -r2ff69dfc67c77d80c1ed2f4f1f9bc0172e28e518 -r4959b3b9b84eec4cb80ec43c037579d9177b3d02 --- test/Plugins/Wti/Wti.Forms.Test/Wti.Forms.Test.csproj (.../Wti.Forms.Test.csproj) (revision 2ff69dfc67c77d80c1ed2f4f1f9bc0172e28e518) +++ test/Plugins/Wti/Wti.Forms.Test/Wti.Forms.Test.csproj (.../Wti.Forms.Test.csproj) (revision 4959b3b9b84eec4cb80ec43c037579d9177b3d02) @@ -46,6 +46,7 @@ + Index: test/Plugins/Wti/Wti.Plugin.Test/WtiGuiPluginTest.cs =================================================================== diff -u -r493a740c5f9592074c117c718b2f9b0af310c355 -r4959b3b9b84eec4cb80ec43c037579d9177b3d02 --- test/Plugins/Wti/Wti.Plugin.Test/WtiGuiPluginTest.cs (.../WtiGuiPluginTest.cs) (revision 493a740c5f9592074c117c718b2f9b0af310c355) +++ test/Plugins/Wti/Wti.Plugin.Test/WtiGuiPluginTest.cs (.../WtiGuiPluginTest.cs) (revision 4959b3b9b84eec4cb80ec43c037579d9177b3d02) @@ -94,9 +94,10 @@ ITreeNodePresenter[] nodePresenters = guiPlugin.GetProjectTreeViewNodePresenters().ToArray(); // assert - Assert.AreEqual(5, nodePresenters.Length); + Assert.AreEqual(6, nodePresenters.Length); Assert.IsTrue(nodePresenters.Any(np => np is WtiProjectNodePresenter)); Assert.IsTrue(nodePresenters.Any(np => np is PipingSurfaceLineCollectionNodePresenter)); + Assert.IsTrue(nodePresenters.Any(np => np is PipingSoilProfileCollectionNodePresenter)); Assert.IsTrue(nodePresenters.Any(np => np is PipingDataNodePresenter)); Assert.IsTrue(nodePresenters.Any(np => np is PipingFailureMechanismNodePresenter)); Assert.IsTrue(nodePresenters.Any(np => np is PipingOutputNodePresenter));