Index: src/Plugins/Wti/Wti.Data/WtiProject.cs =================================================================== diff -u -r5fc71a385897af92ccb092f2f969b5709afab85a -rd6424435444e760d052fe6d8c8786e01bddf9d2b --- src/Plugins/Wti/Wti.Data/WtiProject.cs (.../WtiProject.cs) (revision 5fc71a385897af92ccb092f2f969b5709afab85a) +++ src/Plugins/Wti/Wti.Data/WtiProject.cs (.../WtiProject.cs) (revision d6424435444e760d052fe6d8c8786e01bddf9d2b) @@ -7,6 +7,7 @@ public class WtiProject : INameable, IObservable { private readonly IList observers = new List(); + private PipingFailureMechanism pipingFailureMechanism; public WtiProject() { @@ -15,6 +16,18 @@ public string Name { get; set; } + public PipingFailureMechanism PipingFailureMechanism + { + get + { + return pipingFailureMechanism; + } + set + { + pipingFailureMechanism = value; + } + } + #region IObservable public void Attach(IObserver observer) Index: src/Plugins/Wti/Wti.Forms/NodePresenters/PipingFailureMechanismNodePresenter.cs =================================================================== diff -u -rb16cc39381e4275844ad330e0bc56ede52aa5b88 -rd6424435444e760d052fe6d8c8786e01bddf9d2b --- src/Plugins/Wti/Wti.Forms/NodePresenters/PipingFailureMechanismNodePresenter.cs (.../PipingFailureMechanismNodePresenter.cs) (revision b16cc39381e4275844ad330e0bc56ede52aa5b88) +++ src/Plugins/Wti/Wti.Forms/NodePresenters/PipingFailureMechanismNodePresenter.cs (.../PipingFailureMechanismNodePresenter.cs) (revision d6424435444e760d052fe6d8c8786e01bddf9d2b) @@ -77,11 +77,20 @@ public bool CanRemove(object parentNodeData, object nodeData) { - return false; + return nodeData is PipingFailureMechanism; } public bool RemoveNodeData(object parentNodeData, object nodeData) { + if (nodeData is PipingFailureMechanism) + { + var wtiProject = (WtiProject) parentNodeData; + + wtiProject.PipingFailureMechanism = null; + wtiProject.NotifyObservers(); + + return true; + } return false; } } Index: src/Plugins/Wti/Wti.Forms/NodePresenters/WtiProjectNodePresenter.cs =================================================================== diff -u -r5fc71a385897af92ccb092f2f969b5709afab85a -rd6424435444e760d052fe6d8c8786e01bddf9d2b --- src/Plugins/Wti/Wti.Forms/NodePresenters/WtiProjectNodePresenter.cs (.../WtiProjectNodePresenter.cs) (revision 5fc71a385897af92ccb092f2f969b5709afab85a) +++ src/Plugins/Wti/Wti.Forms/NodePresenters/WtiProjectNodePresenter.cs (.../WtiProjectNodePresenter.cs) (revision d6424435444e760d052fe6d8c8786e01bddf9d2b) @@ -1,7 +1,9 @@ using System; using System.Collections; using System.ComponentModel; +using System.Windows.Forms; using DelftTools.Controls; +using DelftTools.Controls.Swf; using DelftTools.Shell.Core; using DelftTools.Utils.Collections; using Wti.Data; @@ -30,7 +32,11 @@ public IEnumerable GetChildNodeObjects(object parentNodeData, ITreeNode node) { - yield break; + var wtiProject = (WtiProject)parentNodeData; + if (wtiProject.PipingFailureMechanism != null) + { + yield return wtiProject.PipingFailureMechanism; + } } public bool CanRenameNode(ITreeNode node) @@ -74,9 +80,27 @@ public IMenuItem GetContextMenu(ITreeNode sender, object nodeData) { - return null; + var contextMenu = new ContextMenuStrip(); + var addPipingFailureMechanismItem = contextMenu.Items.Add(Resources.AddPipingFailureMechanismContextMenuItem); + var contextMenuAdapter = new MenuItemContextMenuStripAdapter(contextMenu); + + addPipingFailureMechanismItem.Tag = nodeData; + addPipingFailureMechanismItem.Click += InitializePipingFailureMechanismForWtiProject; + + return contextMenuAdapter; } + private void InitializePipingFailureMechanismForWtiProject(object sender, EventArgs e) + { + var treeNode = (ToolStripItem) sender; + if (treeNode != null) + { + var wtiProject = (WtiProject) treeNode.Tag; + wtiProject.PipingFailureMechanism = new PipingFailureMechanism(); + wtiProject.NotifyObservers(); + } + } + public void OnPropertyChanged(object sender, ITreeNode node, PropertyChangedEventArgs e) {} public void OnCollectionChanged(object sender, NotifyCollectionChangingEventArgs e) {} Index: src/Plugins/Wti/Wti.Forms/Properties/Resources.Designer.cs =================================================================== diff -u -r2cc167229383dbc03827939d66d50db5b651dba5 -rd6424435444e760d052fe6d8c8786e01bddf9d2b --- src/Plugins/Wti/Wti.Forms/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 2cc167229383dbc03827939d66d50db5b651dba5) +++ src/Plugins/Wti/Wti.Forms/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision d6424435444e760d052fe6d8c8786e01bddf9d2b) @@ -61,6 +61,15 @@ } /// + /// Looks up a localized string similar to Voeg piping faalmechanisme toe. + /// + public static string AddPipingFailureMechanismContextMenuItem { + get { + return ResourceManager.GetString("AddPipingFailureMechanismContextMenuItem", resourceCulture); + } + } + + /// /// Looks up a localized string similar to Algemeen. /// public static string Categories_General { Index: src/Plugins/Wti/Wti.Forms/Properties/Resources.resx =================================================================== diff -u -r2cc167229383dbc03827939d66d50db5b651dba5 -rd6424435444e760d052fe6d8c8786e01bddf9d2b --- src/Plugins/Wti/Wti.Forms/Properties/Resources.resx (.../Resources.resx) (revision 2cc167229383dbc03827939d66d50db5b651dba5) +++ src/Plugins/Wti/Wti.Forms/Properties/Resources.resx (.../Resources.resx) (revision d6424435444e760d052fe6d8c8786e01bddf9d2b) @@ -331,4 +331,7 @@ ..\Resources\u48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + Voeg piping faalmechanisme toe + \ No newline at end of file Index: src/Plugins/Wti/Wti.Plugin/WtiApplicationPlugin.cs =================================================================== diff -u -r2cc167229383dbc03827939d66d50db5b651dba5 -rd6424435444e760d052fe6d8c8786e01bddf9d2b --- src/Plugins/Wti/Wti.Plugin/WtiApplicationPlugin.cs (.../WtiApplicationPlugin.cs) (revision 2cc167229383dbc03827939d66d50db5b651dba5) +++ src/Plugins/Wti/Wti.Plugin/WtiApplicationPlugin.cs (.../WtiApplicationPlugin.cs) (revision d6424435444e760d052fe6d8c8786e01bddf9d2b) @@ -51,13 +51,6 @@ Image = WtiFormsResources.WtiProjectFolderIcon, CreateData = owner => new WtiProject() }; - yield return new DataItemInfo - { - Name = WtiFormsResources.PipingFailureMechanismDisplayName, - Category = ApplicationResources.WtiApplicationName, - Image = WtiFormsResources.PipingIcon, - CreateData = owner => new PipingFailureMechanism() - }; } } } \ No newline at end of file Index: test/Plugins/Wti/Wti.Forms.Test/NodePresenters/PipingDataNodePresenterTest.cs =================================================================== diff -u -rf4f20297137850e94b8ae0d8c582aec872d8c707 -rd6424435444e760d052fe6d8c8786e01bddf9d2b --- test/Plugins/Wti/Wti.Forms.Test/NodePresenters/PipingDataNodePresenterTest.cs (.../PipingDataNodePresenterTest.cs) (revision f4f20297137850e94b8ae0d8c582aec872d8c707) +++ test/Plugins/Wti/Wti.Forms.Test/NodePresenters/PipingDataNodePresenterTest.cs (.../PipingDataNodePresenterTest.cs) (revision d6424435444e760d052fe6d8c8786e01bddf9d2b) @@ -1,10 +1,12 @@ using System; using System.ComponentModel; using DelftTools.Controls; +using DelftTools.Controls.Swf; using DelftTools.Shell.Core; using DelftTools.Utils.Collections; using NUnit.Framework; using Rhino.Mocks; +using Wti.Controller; using Wti.Data; using Wti.Forms.NodePresenters; using WtiFormsResources = Wti.Forms.Properties.Resources; @@ -244,7 +246,7 @@ } [Test] - public void GetContextMenu_ContextMenuFunctionSet_CallsContextMenuFunction() + public void GetContextMenu_Always_ContextMenuWithOneItemForCalculate() { // Setup var mocks = new MockRepository(); @@ -256,10 +258,13 @@ mocks.ReplayAll(); // Call - var contextMenu = nodePresenter.GetContextMenu(nodeMock, dataMock); + var contextMenu = nodePresenter.GetContextMenu(nodeMock, dataMock) as MenuItemContextMenuStripAdapter; // Assert Assert.NotNull(contextMenu); + Assert.AreEqual(1, contextMenu.ContextMenuStrip.Items.Count); + Assert.AreEqual(WtiFormsResources.PipingDataContextMenuCalculate, contextMenu.ContextMenuStrip.Items[0].Text); + Assert.IsInstanceOf(contextMenu.ContextMenuStrip); mocks.VerifyAll(); // Expect no calls on arguments } Index: test/Plugins/Wti/Wti.Forms.Test/NodePresenters/PipingFailureMechanismNodePresenterTest.cs =================================================================== diff -u -rb16cc39381e4275844ad330e0bc56ede52aa5b88 -rd6424435444e760d052fe6d8c8786e01bddf9d2b --- test/Plugins/Wti/Wti.Forms.Test/NodePresenters/PipingFailureMechanismNodePresenterTest.cs (.../PipingFailureMechanismNodePresenterTest.cs) (revision b16cc39381e4275844ad330e0bc56ede52aa5b88) +++ test/Plugins/Wti/Wti.Forms.Test/NodePresenters/PipingFailureMechanismNodePresenterTest.cs (.../PipingFailureMechanismNodePresenterTest.cs) (revision d6424435444e760d052fe6d8c8786e01bddf9d2b) @@ -1,20 +1,354 @@ -using NUnit.Framework; +using System.ComponentModel; +using DelftTools.Controls; +using DelftTools.Shell.Core; +using DelftTools.Utils.Collections; +using NUnit.Framework; +using Rhino.Mocks; +using Wti.Data; using Wti.Forms.NodePresenters; namespace Wti.Forms.Test.NodePresenters { public class PipingFailureMechanismNodePresenterTest { [Test] - public void Constructor_Default_NotNull() + public void DefaultConstructor_ExpectedValues() { + // Call + var nodePresenter = new PipingFailureMechanismNodePresenter(); + + // Assert + Assert.IsInstanceOf(nodePresenter); + Assert.IsNull(nodePresenter.TreeView); + Assert.AreEqual(typeof(PipingFailureMechanism), nodePresenter.NodeTagType); + } + + [Test] + public void UpdateNode_WithData_InitializeNode() + { // Setup - var pipingFailureMechanismNode = new PipingFailureMechanismNodePresenter(); + const string nodeName = "Faalmechanisme piping"; + var mocks = new MockRepository(); + var pipingNode = mocks.Stub(); + mocks.ReplayAll(); + + var nodePresenter = new PipingFailureMechanismNodePresenter(); + + var pipingData = new PipingData + { + AssessmentLevel = 2.0 + }; + // Call + nodePresenter.UpdateNode(null, pipingNode, pipingData); // Assert + Assert.AreEqual(nodeName, pipingNode.Text); + Assert.AreEqual(16, pipingNode.Image.Height); + Assert.AreEqual(16, pipingNode.Image.Width); + } + [Test] + public void GetChildNodeObjects_Always_ReturnPipingDataChildNode() + { + // Setup + var mocks = new MockRepository(); + var nodeMock = mocks.StrictMock(); + mocks.ReplayAll(); + + var nodePresenter = new PipingFailureMechanismNodePresenter(); + + var pipingFailureMechanism = new PipingFailureMechanism(); + + // Call + var children = nodePresenter.GetChildNodeObjects(pipingFailureMechanism, nodeMock); + + // Assert + Assert.AreEqual(1, children.Count()); + CollectionAssert.AllItemsAreInstancesOfType(children, typeof(PipingData)); + 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 PipingFailureMechanismNodePresenter(); + + // 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 PipingFailureMechanismNodePresenter(); + + // Call + var renameAllowed = nodePresenter.CanRenameNodeTo(nodeMock, ""); + + // Assert + Assert.IsFalse(renameAllowed); + 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 PipingFailureMechanismNodePresenter(); + + // 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 PipingFailureMechanismNodePresenter(); + + // 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 PipingFailureMechanismNodePresenter(); + + // 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 PipingFailureMechanismNodePresenter(); + + // 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 PipingFailureMechanismNodePresenter(); + + // 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 PipingFailureMechanismNodePresenter(); + + // Call + nodePresenter.OnNodeSelected(dataMock); + + // Assert + mocks.VerifyAll(); // Expect no calls on arguments + } + + [Test] + public void GetContextMenu_Always_ReturnsNull() + { + // Setup + var mocks = new MockRepository(); + var nodeMock = mocks.StrictMock(); + var dataMock = mocks.StrictMock(); + + var nodePresenter = new PipingFailureMechanismNodePresenter(); + + mocks.ReplayAll(); + + // Call + var contextMenu = nodePresenter.GetContextMenu(nodeMock, dataMock); + + // Assert + Assert.Null(contextMenu); + 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 PipingFailureMechanismNodePresenter(); + + // 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 PipingFailureMechanismNodePresenter(); + + // Call + nodePresenter.OnCollectionChanged(dataMock, eventArgsMock); + + // Assert + mocks.VerifyAll(); // Expect no calls on arguments + } + + [Test] + public void CanRemove_RemovingAnythingButPipingFailureMechanism_ReturnFalse() + { + // Setup + var mocks = new MockRepository(); + var dataMock = mocks.StrictMock(); + var nodeMock = mocks.StrictMock(); + mocks.ReplayAll(); + + var nodePresenter = new PipingFailureMechanismNodePresenter(); + + // Call + bool removalAllowed = nodePresenter.CanRemove(dataMock, nodeMock); + + // Assert + Assert.IsFalse(removalAllowed); + mocks.VerifyAll(); // Expect no calls on arguments + } + + [Test] + public void CanRemove_RemovingPipingFailureMechanism_ReturnTrue() + { + // Setup + var mocks = new MockRepository(); + var dataMock = mocks.StrictMock(); + var nodeMock = mocks.StrictMock(); + mocks.ReplayAll(); + + var nodePresenter = new PipingFailureMechanismNodePresenter(); + + // Call + bool removalAllowed = nodePresenter.CanRemove(dataMock, nodeMock); + + // Assert + Assert.IsTrue(removalAllowed); + mocks.VerifyAll(); // Expect no calls on arguments + } + + [Test] + public void RemoveNodeData_PipingFailureMechanism_PipingFailureMechanismRemovedFromWtiProject() + { + // Setup + var failureMechanism = new PipingFailureMechanism(); + + var project = new WtiProject(); + project.PipingFailureMechanism = failureMechanism; + + var nodePresenter = new PipingFailureMechanismNodePresenter(); + + // Call + bool removalSuccesful = nodePresenter.RemoveNodeData(project, failureMechanism); + + // Assert + Assert.IsTrue(removalSuccesful); + Assert.IsNull(project.PipingFailureMechanism); + } + + + [Test] + public void RemoveNodeData_AnythingButPipingFailureMechanism_PipingFailureMechanismNotRemovedFromWtiProject() + { + // Setup + var failureMechanism = new PipingFailureMechanism(); + + var project = new WtiProject(); + project.PipingFailureMechanism = failureMechanism; + + var nodePresenter = new PipingFailureMechanismNodePresenter(); + + // Call + bool removalSuccesful = nodePresenter.RemoveNodeData(project, new object()); + + // Assert + Assert.IsFalse(removalSuccesful); + Assert.AreSame(failureMechanism, project.PipingFailureMechanism); + } } } \ No newline at end of file Index: test/Plugins/Wti/Wti.Forms.Test/NodePresenters/WtiProjectNodePresenterTest.cs =================================================================== diff -u -rcbc411cd86a4b826cfb17e0ac45921c0f6433f93 -rd6424435444e760d052fe6d8c8786e01bddf9d2b --- test/Plugins/Wti/Wti.Forms.Test/NodePresenters/WtiProjectNodePresenterTest.cs (.../WtiProjectNodePresenterTest.cs) (revision cbc411cd86a4b826cfb17e0ac45921c0f6433f93) +++ test/Plugins/Wti/Wti.Forms.Test/NodePresenters/WtiProjectNodePresenterTest.cs (.../WtiProjectNodePresenterTest.cs) (revision d6424435444e760d052fe6d8c8786e01bddf9d2b) @@ -1,5 +1,6 @@ using System.ComponentModel; using DelftTools.Controls; +using DelftTools.Controls.Swf; using DelftTools.Shell.Core; using DelftTools.Utils.Collections; using NUnit.Framework; @@ -242,7 +243,7 @@ } [Test] - public void GetContextMenu_Always_ReturnNull() + public void GetContextMenu_CreateWithData_ReturnsContextMenuWithOneItemWithDataAsTag() { // Setup var mocks = new MockRepository(); @@ -253,10 +254,13 @@ var nodePresenter = new WtiProjectNodePresenter(); // Call - var contextMenu = nodePresenter.GetContextMenu(nodeMock, dataMock); + var contextMenu = nodePresenter.GetContextMenu(nodeMock, dataMock) as MenuItemContextMenuStripAdapter; // Assert - Assert.IsNull(contextMenu); + Assert.NotNull(contextMenu); + Assert.AreEqual(1, contextMenu.ContextMenuStrip.Items.Count); + Assert.AreEqual(WtiFormsResources.AddPipingFailureMechanismContextMenuItem, contextMenu.ContextMenuStrip.Items[0].Text); + Assert.AreSame(dataMock, contextMenu.ContextMenuStrip.Items[0].Tag); mocks.VerifyAll(); // Expect no calls on arguments } Index: test/Plugins/Wti/Wti.Forms.Test/Wti.Forms.Test.csproj =================================================================== diff -u -rb16cc39381e4275844ad330e0bc56ede52aa5b88 -rd6424435444e760d052fe6d8c8786e01bddf9d2b --- test/Plugins/Wti/Wti.Forms.Test/Wti.Forms.Test.csproj (.../Wti.Forms.Test.csproj) (revision b16cc39381e4275844ad330e0bc56ede52aa5b88) +++ test/Plugins/Wti/Wti.Forms.Test/Wti.Forms.Test.csproj (.../Wti.Forms.Test.csproj) (revision d6424435444e760d052fe6d8c8786e01bddf9d2b) @@ -56,6 +56,10 @@ + + {3DBD23CE-5C4A-4A49-B51C-B268CB2B510E} + DelftTools.Controls.Swf + {9a2d67e6-26ac-4d17-b11a-2b4372f2f572} DelftTools.Controls Index: test/Plugins/Wti/Wti.Plugin.Test/WtiApplicationPluginTest.cs =================================================================== diff -u -rcbc411cd86a4b826cfb17e0ac45921c0f6433f93 -rd6424435444e760d052fe6d8c8786e01bddf9d2b --- test/Plugins/Wti/Wti.Plugin.Test/WtiApplicationPluginTest.cs (.../WtiApplicationPluginTest.cs) (revision cbc411cd86a4b826cfb17e0ac45921c0f6433f93) +++ test/Plugins/Wti/Wti.Plugin.Test/WtiApplicationPluginTest.cs (.../WtiApplicationPluginTest.cs) (revision d6424435444e760d052fe6d8c8786e01bddf9d2b) @@ -48,7 +48,7 @@ var dataItemDefinitions = plugin.GetDataItemInfos().ToArray(); // assert - Assert.AreEqual(2, dataItemDefinitions.Length); + Assert.AreEqual(1, dataItemDefinitions.Length); DataItemInfo projectDataItemDefinition = dataItemDefinitions.Single(did => did.ValueType == typeof(WtiProject)); Assert.AreEqual("WTI project", projectDataItemDefinition.Name); @@ -58,15 +58,6 @@ Assert.IsNull(projectDataItemDefinition.AdditionalOwnerCheck); Assert.IsInstanceOf(projectDataItemDefinition.CreateData(null)); Assert.IsNull(projectDataItemDefinition.AddExampleData); - - DataItemInfo pipingDataItemDefinition = dataItemDefinitions.Single(did => did.ValueType == typeof(PipingData)); - Assert.AreEqual("Piping", pipingDataItemDefinition.Name); - Assert.AreEqual("WTI", pipingDataItemDefinition.Category); - Assert.AreEqual(16, pipingDataItemDefinition.Image.Width); - Assert.AreEqual(16, pipingDataItemDefinition.Image.Height); - Assert.IsNull(pipingDataItemDefinition.AdditionalOwnerCheck); - Assert.IsInstanceOf(pipingDataItemDefinition.CreateData(null)); - Assert.IsNull(pipingDataItemDefinition.AddExampleData); } } } \ No newline at end of file Index: test/Plugins/Wti/Wti.Plugin.Test/WtiGuiPluginTest.cs =================================================================== diff -u -rcbc411cd86a4b826cfb17e0ac45921c0f6433f93 -rd6424435444e760d052fe6d8c8786e01bddf9d2b --- test/Plugins/Wti/Wti.Plugin.Test/WtiGuiPluginTest.cs (.../WtiGuiPluginTest.cs) (revision cbc411cd86a4b826cfb17e0ac45921c0f6433f93) +++ test/Plugins/Wti/Wti.Plugin.Test/WtiGuiPluginTest.cs (.../WtiGuiPluginTest.cs) (revision d6424435444e760d052fe6d8c8786e01bddf9d2b) @@ -84,9 +84,10 @@ ITreeNodePresenter[] nodePresenters = guiPlugin.GetProjectTreeViewNodePresenters().ToArray(); // assert - Assert.AreEqual(3, nodePresenters.Length); + Assert.AreEqual(4, nodePresenters.Length); Assert.IsTrue(nodePresenters.Any(np => np is WtiProjectNodePresenter)); Assert.IsTrue(nodePresenters.Any(np => np is PipingDataNodePresenter)); + Assert.IsTrue(nodePresenters.Any(np => np is PipingFailureMechanismNodePresenter)); Assert.IsTrue(nodePresenters.Any(np => np is PipingOutputNodePresenter)); } }