[Adapdev-commits] Adapdev/src/Adapdev.Windows.Forms.Tests SmartTreeViewTest.cs,1.1,1.2
Status: Beta
Brought to you by:
intesar66
From: Sean M. <int...@us...> - 2005-06-02 03:26:12
|
Update of /cvsroot/adapdev/Adapdev/src/Adapdev.Windows.Forms.Tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28755/src/Adapdev.Windows.Forms.Tests Modified Files: SmartTreeViewTest.cs Log Message: Updated OracleSelectQuery to properly handle SetLimit Updated CrypoTests to pass Modified SmartTreeView to track state of nodes across reloads Small modifications to the caching block Index: SmartTreeViewTest.cs =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/Adapdev.Windows.Forms.Tests/SmartTreeViewTest.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SmartTreeViewTest.cs 25 May 2005 05:17:48 -0000 1.1 --- SmartTreeViewTest.cs 2 Jun 2005 03:26:00 -0000 1.2 *************** *** 139,142 **** --- 139,176 ---- } + [Test] + public void GetUniqueNodeName() + { + Assert.AreEqual("Root", tree.GetUniqueNodeName(this.GetRoot())); + Assert.AreEqual("Node1Root", tree.GetUniqueNodeName(this.GetNode1())); + Assert.AreEqual("Child1Node1Root", tree.GetUniqueNodeName(this.GetChild1())); + } + + [Test] + public void GetState() + { + this.GetNode1().Checked = false; + Assert.IsTrue(this.GetNode1().Checked == false, "Node1 should not be checked initially"); + // Check it - checked state should be saved + this.GetNode1().Checked = true; + // Remove it + this.GetNode1().Remove(); + // Readd it + this.GetRoot().Nodes.Add("Node1"); + this.GetNode1().Checked = false; + Assert.IsTrue(this.GetNode1().Checked == false, "Node1 should not be checked after being added"); + + // Load the state + this.tree.LoadState(); + Assert.IsTrue(this.GetNode1().Checked == true, "Node1 should be checked."); + + // Clear the state and reload + this.tree.ClearState(); + this.GetNode1().Checked = false; + this.tree.LoadState(); + Assert.IsFalse(this.GetNode1().Checked == true, "Node1 should not be checked since state was cleared."); + + } + #region Utility Methods private TreeNode GetRoot() |