1
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
2
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
4
using ICSharpCode.SharpDevelop.Internal.Templates;
5
using ICSharpCode.SharpDevelop.Project;
6
using ICSharpCode.WixBinding;
9
using System.Windows.Forms;
10
using WixBinding.Tests.Utils;
12
namespace WixBinding.Tests.Gui
15
/// Tests that an expanded WixLibraryFolderNode contains WixLibraryNodes.
18
public class WixProjectWithLibraryItemsTestFixture
20
WixProject wixProject;
21
WixLibraryFolderNode wixLibraryFolderNode;
22
WixLibraryProjectItem firstWixLibraryItem;
23
WixLibraryProjectItem secondWixLibraryItem;
24
WixLibraryNode firstWixLibraryNode;
25
WixLibraryNode secondWixLibraryNode;
28
public void SetUpFixture()
30
wixProject = WixBindingTestsHelper.CreateEmptyWixProject();
32
// Add wix library item.
33
firstWixLibraryItem = new WixLibraryProjectItem(wixProject);
34
firstWixLibraryItem.Include = @"..\..\first.wixlib";
35
ProjectService.AddProjectItem(wixProject, firstWixLibraryItem);
37
// Add another wix library item.
38
secondWixLibraryItem = new WixLibraryProjectItem(wixProject);
39
secondWixLibraryItem.Include = @"..\..\second.wixlib";
40
ProjectService.AddProjectItem(wixProject, secondWixLibraryItem);
42
// Run Initialize on the WixLibraryFolderNode, which is
43
// equivalent to expanding the node, so it adds it children. Cannot
44
// call ExtTreeNode.Expanding since this relies on the tree node
46
WixLibraryFolderNodeTester nodeTester = new WixLibraryFolderNodeTester(wixProject);
47
nodeTester.RunInitialize();
49
wixLibraryFolderNode = (WixLibraryFolderNode)nodeTester;
50
firstWixLibraryNode = (WixLibraryNode)wixLibraryFolderNode.Nodes[0];
51
secondWixLibraryNode = (WixLibraryNode)wixLibraryFolderNode.Nodes[1];
55
public void WixLibraryHasTwoChildren()
57
Assert.AreEqual(2, wixLibraryFolderNode.Nodes.Count);
61
public void FirstWixLibraryNodeText()
63
Assert.AreEqual("first.wixlib", firstWixLibraryNode.Text);
67
public void FirstWixLibraryContextMenuPath()
69
Assert.AreEqual("/SharpDevelop/Pads/ProjectBrowser/ContextMenu/WixLibraryNode", firstWixLibraryNode.ContextmenuAddinTreePath);
73
public void SecondWixLibraryNodeText()
75
Assert.AreEqual("second.wixlib", secondWixLibraryNode.Text);
79
public void NewWixLibraryProjectItem()
81
IProject p = WixBindingTestsHelper.CreateEmptyWixProject();
82
WixLibraryProjectItem item = new WixLibraryProjectItem(p);
83
Assert.AreEqual(WixItemType.Library, item.ItemType);