public void PerformDataBinding_WorksWithControlAdapter()
        {
            MyHierarchicalDataBoundControl c = new MyHierarchicalDataBoundControl();
            MyControlAdapter a = new MyControlAdapter();

            c.controlAdapter = a;
            c.DataBind();
        }
        [Category("NotDotNet")] // .NET doesn't use ResolveAdapter in this case
        public void PerformDataBinding_UsesAdapter()
        {
            MyHierarchicalDataBoundControl        c = new MyHierarchicalDataBoundControl();
            MyHierarchicalDataBoundControlAdapter a = new MyHierarchicalDataBoundControlAdapter();;

            c.controlAdapter = a;
            c.DataBind();
            Assert.IsTrue(a.perform_data_binding_called, "PerformDataBinding_UsesAdapter");
        }
        public void HierarchicalDataBoundControl_DataBindFlow()
        {
            Page p = new Page();
            MyHierarchicalDataBoundControl hc = new MyHierarchicalDataBoundControl();

            p.Controls.Add(hc);
            hc.DataBind();
            string expected = "[Start DataBind][Start PerformSelect][Start OnDataBinding][End OnDataBinding][Start PerformDataBinding][End PerformDataBinding][Start OnDataBound][End OnDataBound][End PerformSelect][End DataBind]";

            Assert.AreEqual(expected, hc.DataBindTrace, "DataBindFlow");
        }
        public void TestIHierarchicalEnumerableDataSource()
        {
            List <TestNode> list = new List <TestNode> ();

            list.Add(new TestNode("test", null, null));
            TestHierarchy hierarchy          = new TestHierarchy(list);
            MyHierarchicalDataBoundControl c = new MyHierarchicalDataBoundControl();

            c.DataSource = hierarchy;
            c.DataBind();
            HierarchicalDataSourceView view = c.GetData("");

            Assert.IsNotNull(view);
        }
		public void TestIHierarchicalEnumerableDataSource ()
		{
			List<TestNode> list = new List<TestNode> ();
			list.Add (new TestNode ("test", null, null));
			TestHierarchy hierarchy = new TestHierarchy (list);
			MyHierarchicalDataBoundControl c = new MyHierarchicalDataBoundControl ();
			c.DataSource = hierarchy;
			c.DataBind ();
			HierarchicalDataSourceView view = c.GetData ("");
			Assert.IsNotNull (view);
		}
		public void PerformDataBinding_WorksWithControlAdapter ()
		{
			MyHierarchicalDataBoundControl c = new MyHierarchicalDataBoundControl ();
			MyControlAdapter a = new MyControlAdapter();
			c.controlAdapter = a;
			c.DataBind ();
		}
		[Category ("NotDotNet")] // .NET doesn't use ResolveAdapter in this case
		public void PerformDataBinding_UsesAdapter ()
		{
			MyHierarchicalDataBoundControl c = new MyHierarchicalDataBoundControl ();
			MyHierarchicalDataBoundControlAdapter a = new MyHierarchicalDataBoundControlAdapter();;
			c.controlAdapter = a;
			c.DataBind ();
			Assert.IsTrue (a.perform_data_binding_called, "PerformDataBinding_UsesAdapter");
		}
		public void HierarchicalDataBoundControl_ValidateDataSource_Null ()
		{
			MyHierarchicalDataBoundControl hc = new MyHierarchicalDataBoundControl ();
			hc.DoValidateDataSource (null);
		}
		public void HierarchicalDataBoundControl_DataBindFlow () {
			Page p = new Page ();
			MyHierarchicalDataBoundControl hc = new MyHierarchicalDataBoundControl ();
			p.Controls.Add (hc);
			hc.DataBind ();
			string expected = "[Start DataBind][Start PerformSelect][Start OnDataBinding][End OnDataBinding][Start PerformDataBinding][End PerformDataBinding][Start OnDataBound][End OnDataBound][End PerformSelect][End DataBind]";
			Assert.AreEqual (expected, hc.DataBindTrace, "DataBindFlow");
		}
		public void SetUp ()
		{
			c = new MyHierarchicalDataBoundControl ();
			a = new MyHierarchicalDataBoundControlAdapter (c);
		}
        public void HierarchicalDataBoundControl_ValidateDataSource_Null()
        {
            MyHierarchicalDataBoundControl hc = new MyHierarchicalDataBoundControl();

            hc.DoValidateDataSource(null);
        }
 public void SetUp()
 {
     c = new MyHierarchicalDataBoundControl();
     a = new MyHierarchicalDataBoundControlAdapter(c);
 }