public void Test_LoadSingleBO_NoChildren()
 {
     //---------------Set up test pack-------------------
     TreeViewWin treeView = new TreeViewWin();
     TreeViewController treeViewController = new TreeViewController(treeView);
     OrganisationTestBO organisationTestBO = new OrganisationTestBO();
     //-------------Assert Preconditions -------------
     Assert.AreEqual(0, treeView.Nodes.Count);
     //---------------Execute Test ----------------------
     treeViewController.LoadTreeView(organisationTestBO);
     //---------------Test Result -----------------------
     Assert.AreEqual(1, treeView.Nodes.Count);
     ITreeNode node = treeView.Nodes[0];
     Assert.AreEqual(organisationTestBO.ToString(), node.Text);
     Assert.AreEqual(0, node.Nodes.Count);
 }
 public void Test_LoadSingleBO_OneChild_Expanded()
 {
     //---------------Set up test pack-------------------
     TreeViewWin treeView = new TreeViewWin();
     TreeViewController treeViewController = new TreeViewController(treeView);
     OrganisationTestBO organisationTestBO = new OrganisationTestBO {Name = TestUtil.GetRandomString()};
     ContactPersonTestBO contactPersonTestBO = organisationTestBO.ContactPeople.CreateBusinessObject();
     contactPersonTestBO.Surname = TestUtil.GetRandomString();
     //-------------Assert Preconditions -------------
     Assert.AreEqual(0, treeView.Nodes.Count);
     //---------------Execute Test ----------------------
     treeViewController.LoadTreeView(organisationTestBO, 2);
     //---------------Test Result -----------------------
     Assert.AreEqual(1, treeView.Nodes.Count);
     ITreeNode node = treeView.Nodes[0];
     Assert.AreEqual(organisationTestBO.ToString(), node.Text);
     Assert.AreEqual(1, node.Nodes.Count);
     ITreeNode relationshipNode = node.Nodes[0];
     Assert.AreEqual("ContactPeople", relationshipNode.Text);
     Assert.AreEqual(1, relationshipNode.Nodes.Count);
     ITreeNode childNode = relationshipNode.Nodes[0];
     Assert.AreEqual(contactPersonTestBO.ToString(), childNode.Text);
 }
 public void Test_LoadSingleBO_OneChildRelationship_Expanded()
 {
     //---------------Set up test pack-------------------
     TreeViewWin treeView = new TreeViewWin();
     TreeViewController treeViewController = new TreeViewController(treeView);
     OrganisationTestBO organisationTestBO = new OrganisationTestBO();  
     //-------------Assert Preconditions -------------
     Assert.AreEqual(0, treeView.Nodes.Count);
     //---------------Execute Test ----------------------
     treeViewController.LoadTreeView(organisationTestBO, 1);
     //---------------Test Result -----------------------
     Assert.AreEqual(1, treeView.Nodes.Count);
     ITreeNode node = treeView.Nodes[0];
     Assert.AreEqual(organisationTestBO.ToString(), node.Text);
     Assert.AreEqual(1, node.Nodes.Count);
     ITreeNode relationshipNode = node.Nodes[0];
     Assert.AreEqual("ContactPeople", relationshipNode.Text);
 }