Inheritance: System.Web.UI.WebControls.TreeNode
Exemplo n.º 1
0
        public void TreeNode_DefaultProperties()
        {
            PokerTreeNode tn = new PokerTreeNode();

            Assert.AreEqual(false, tn.Checked, "Checked");
            Assert.AreEqual(0, tn.ChildNodes.Count, "ChildNodes.Count");
            Assert.AreEqual(false, tn.DataBound, "DataBound");
            Assert.AreEqual(null, tn.DataItem, "DataItem");
            Assert.AreEqual(string.Empty, tn.DataPath, "DataPath");
            Assert.AreEqual(0, tn.Depth, "Depth");
            Assert.AreEqual(null, tn.Expanded, "Expanded");
            Assert.AreEqual(string.Empty, tn.ImageToolTip, "ImageToolTip");
            Assert.AreEqual(string.Empty, tn.ImageUrl, "ImageUrl");
            Assert.AreEqual(string.Empty, tn.NavigateUrl, "NavigateUrl");
            Assert.AreEqual(null, tn.Parent, "Parent");
            Assert.AreEqual(false, tn.PopulateOnDemand, "PopulateOnDemand");
            Assert.AreEqual(TreeNodeSelectAction.Select, tn.SelectAction, "SelectAction");
            Assert.AreEqual(false, tn.Selected, "Selected");
            Assert.AreEqual(null, tn.ShowCheckBox, "ShowCheckBox");
            Assert.AreEqual(string.Empty, tn.Target, "Target");
            Assert.AreEqual(string.Empty, tn.Text, "Text");
            Assert.AreEqual(string.Empty, tn.Value, "Value");
            Assert.AreEqual(string.Empty, tn.ToolTip, "ToolTip");
            Assert.AreEqual(string.Empty, tn.ValuePath, "ValuePath");
            Assert.AreEqual(true, tn.IsTrackingViewStateBase, "IsTrackingViewState");
        }
Exemplo n.º 2
0
        public void TreeNode_AssignToDefaultProperties()
        {
            PokerTreeNode tn = new PokerTreeNode();

            tn.Checked = false;
            Assert.AreEqual(false, tn.Checked, "Checked");
            tn.ChildNodes.Add(new TreeNode());
            Assert.AreEqual(1, tn.ChildNodes.Count, "ChildNodes.Count");
            tn.Expanded = false;
            Assert.AreEqual(false, tn.Expanded, "Expanded");
            tn.ImageToolTip = string.Empty;
            Assert.AreEqual(string.Empty, tn.ImageToolTip, "ImageToolTip");
            tn.ImageUrl = string.Empty;
            Assert.AreEqual(string.Empty, tn.ImageUrl, "ImageUrl");
            tn.NavigateUrl = string.Empty;
            Assert.AreEqual(string.Empty, tn.NavigateUrl, "NavigateUrl");
            tn.PopulateOnDemand = false;
            Assert.AreEqual(false, tn.PopulateOnDemand, "PopulateOnDemand");
            tn.SelectAction = TreeNodeSelectAction.Select;
            Assert.AreEqual(TreeNodeSelectAction.Select, tn.SelectAction, "SelectAction");
            tn.Selected = false;
            Assert.AreEqual(false, tn.Selected, "Selected");
            tn.ShowCheckBox = false;
            Assert.AreEqual(false, tn.ShowCheckBox, "ShowCheckBox");
            tn.Target = string.Empty;
            Assert.AreEqual(string.Empty, tn.Target, "Target");
            tn.Text = string.Empty;
            Assert.AreEqual(string.Empty, tn.Text, "Text");
            tn.Value = string.Empty;
            Assert.AreEqual(string.Empty, tn.Value, "Value");
            tn.ToolTip = string.Empty;
            Assert.AreEqual(string.Empty, tn.ToolTip, "ToolTip");
        }
Exemplo n.º 3
0
        public void TreeNode_Method_Select()
        {
            PokerTreeNode tn = new PokerTreeNode();

            Assert.AreEqual(false, tn.Selected, "BeforeSelect");
            tn.Select();
            Assert.AreEqual(true, tn.Selected, "AfterSelect");
        }
Exemplo n.º 4
0
        public void TreeNode_Method_Clone()
        {
            PokerTreeNode tn1 = new PokerTreeNode();
            TreeNode      tn2 = new TreeNode();

            tn1.Text  = "CloneThisNode";
            tn1.Value = "111";
            Assert.AreEqual(string.Empty, tn2.Text, "BeforeClone1");
            Assert.AreEqual(string.Empty, tn2.Value, "BeforeClone2");
            tn2 = (TreeNode)tn1.CloneBase();
            Assert.AreEqual("CloneThisNode", tn2.Text, "AfterClone1");
            Assert.AreEqual("111", tn2.Value, "AfterClone2");
        }
Exemplo n.º 5
0
        public static void pageLoadNavigateUrl(Page page)
        {
            TreeView tv = new TreeView();

            tv.ID = "treeview1";
            PokerTreeNode tn1 = new PokerTreeNode();

            tn1.Text        = "TreeNode1";
            tn1.NavigateUrl = "NavigateUrl";
            tv.Nodes.Add(tn1);
            LiteralControl lcb = new LiteralControl(HtmlDiff.BEGIN_TAG);
            LiteralControl lce = new LiteralControl(HtmlDiff.END_TAG);

            page.Form.Controls.Add(lcb);
            page.Form.Controls.Add(tv);
            page.Form.Controls.Add(lce);
        }
		public void TreeNode_DefaultProperties () {
			PokerTreeNode tn = new PokerTreeNode ();
			Assert.AreEqual (false, tn.Checked, "Checked");
			Assert.AreEqual (0, tn.ChildNodes.Count, "ChildNodes.Count");
			Assert.AreEqual (false, tn.DataBound, "DataBound");
			Assert.AreEqual (null, tn.DataItem, "DataItem");
			Assert.AreEqual (string.Empty, tn.DataPath, "DataPath");
			Assert.AreEqual (0, tn.Depth, "Depth");
			Assert.AreEqual (null, tn.Expanded, "Expanded");
			Assert.AreEqual (string.Empty, tn.ImageToolTip, "ImageToolTip");
			Assert.AreEqual (string.Empty, tn.ImageUrl, "ImageUrl");
			Assert.AreEqual (string.Empty, tn.NavigateUrl, "NavigateUrl");
			Assert.AreEqual (null, tn.Parent, "Parent");
			Assert.AreEqual (false, tn.PopulateOnDemand, "PopulateOnDemand");
			Assert.AreEqual (TreeNodeSelectAction.Select, tn.SelectAction, "SelectAction");
			Assert.AreEqual (false, tn.Selected, "Selected");
			Assert.AreEqual (null, tn.ShowCheckBox, "ShowCheckBox");
			Assert.AreEqual (string.Empty, tn.Target, "Target");
			Assert.AreEqual (string.Empty, tn.Text, "Text");
			Assert.AreEqual (string.Empty, tn.Value, "Value");
			Assert.AreEqual (string.Empty, tn.ToolTip, "ToolTip");
			Assert.AreEqual (string.Empty, tn.ValuePath, "ValuePath");
			Assert.AreEqual (true, tn.IsTrackingViewStateBase, "IsTrackingViewState");
		}
		public static void pageLoadNavigateUrl (Page page) {
			TreeView tv = new TreeView ();
			tv.ID = "treeview1";
			PokerTreeNode tn1 = new PokerTreeNode ();
			tn1.Text = "TreeNode1";
			tn1.NavigateUrl = "NavigateUrl";
			tv.Nodes.Add (tn1);
			LiteralControl lcb = new LiteralControl (HtmlDiff.BEGIN_TAG);
			LiteralControl lce = new LiteralControl (HtmlDiff.END_TAG);
			page.Form.Controls.Add (lcb);
			page.Form.Controls.Add (tv);
			page.Form.Controls.Add (lce);
		}
		public void TreeNode_Method_Clone () {
			PokerTreeNode tn1 = new PokerTreeNode ();
			TreeNode tn2 = new TreeNode ();
			tn1.Text = "CloneThisNode";
			tn1.Value = "111";
			Assert.AreEqual (string.Empty, tn2.Text, "BeforeClone1");
			Assert.AreEqual (string.Empty, tn2.Value, "BeforeClone2");
			tn2 = (TreeNode) tn1.CloneBase ();
			Assert.AreEqual ("CloneThisNode", tn2.Text, "AfterClone1");
			Assert.AreEqual ("111", tn2.Value, "AfterClone2");
		}
		public void TreeNode_Method_Select () {
			PokerTreeNode tn = new PokerTreeNode ();
			Assert.AreEqual (false, tn.Selected, "BeforeSelect");
			tn.Select ();
			Assert.AreEqual (true, tn.Selected, "AfterSelect");
		}
Exemplo n.º 10
0
		public void TreeNode_AssignToDefaultProperties ()
		{
			PokerTreeNode tn = new PokerTreeNode ();
			tn.Checked = false;
			Assert.AreEqual (false, tn.Checked, "Checked");
			tn.ChildNodes.Add (new TreeNode ());
			Assert.AreEqual (1, tn.ChildNodes.Count, "ChildNodes.Count");
			tn.Expanded = false;
			Assert.AreEqual (false, tn.Expanded, "Expanded");
			tn.ImageToolTip = string.Empty;
			Assert.AreEqual (string.Empty, tn.ImageToolTip, "ImageToolTip");
			tn.ImageUrl = string.Empty;
			Assert.AreEqual (string.Empty, tn.ImageUrl, "ImageUrl");
			tn.NavigateUrl = string.Empty;
			Assert.AreEqual (string.Empty, tn.NavigateUrl, "NavigateUrl");
			tn.PopulateOnDemand = false;
			Assert.AreEqual (false, tn.PopulateOnDemand, "PopulateOnDemand");
			tn.SelectAction = TreeNodeSelectAction.Select;
			Assert.AreEqual (TreeNodeSelectAction.Select, tn.SelectAction, "SelectAction");
			tn.Selected = false;
			Assert.AreEqual (false, tn.Selected, "Selected");
			tn.ShowCheckBox = false;
			Assert.AreEqual (false, tn.ShowCheckBox, "ShowCheckBox");
			tn.Target = string.Empty;
			Assert.AreEqual (string.Empty, tn.Target, "Target");
			tn.Text = string.Empty;
			Assert.AreEqual (string.Empty, tn.Text, "Text");
			tn.Value = string.Empty;
			Assert.AreEqual (string.Empty, tn.Value, "Value");
			tn.ToolTip = string.Empty;
			Assert.AreEqual (string.Empty, tn.ToolTip, "ToolTip");
		}