public void SiteMapDataSource_DataSourceChanged()
        {
            PokerSiteMapDataSource p = new PokerSiteMapDataSource();

            ((IDataSource)p).DataSourceChanged += new EventHandler(SiteMapDataSourceTest_DataSourceChanged);

            eventChecker       = false;
            p.ShowStartingNode = false;
            Assert.IsTrue(eventChecker, "DataSourceChanged#1");

            eventChecker      = false;
            p.SiteMapProvider = "test";
            Assert.IsTrue(eventChecker, "DataSourceChanged#2");

            eventChecker           = false;
            p.StartFromCurrentNode = true;
            Assert.IsTrue(eventChecker, "DataSourceChanged#3");

            eventChecker         = false;
            p.StartingNodeOffset = 1;
            Assert.IsTrue(eventChecker, "DataSourceChanged#4");

            eventChecker      = false;
            p.StartingNodeUrl = "default.aspx";
            Assert.IsTrue(eventChecker, "DataSourceChanged#5");
        }
        public void SiteMapDataSource_GetViewNames()
        {
            PokerSiteMapDataSource p = new PokerSiteMapDataSource();

            Assert.AreEqual(1, p.GetViewNames().Count, "GetViewNames().Count");
            Assert.AreEqual("DefaultView", ((string [])p.GetViewNames()) [0], "GetViewNames () [0]");
        }
        public void SiteMapDataSource_GetList()
        {
            PokerSiteMapDataSource p = new PokerSiteMapDataSource();

            Assert.IsNotNull(p.GetList(), "GetList");
            Assert.IsTrue(p.ContainsListCollection, "ContainsListCollection");
        }
        public void SiteMapDataSource_ChangeProperties()
        {
            PokerSiteMapDataSource p = new PokerSiteMapDataSource();

            p.ShowStartingNode = false;
            Assert.AreEqual(false, p.ShowStartingNode, "ShowStartingNode");
            Assert.AreEqual(1, p.StateBag.Count, "ShowStartingNode#1");

            p.SiteMapProvider = "test";
            Assert.AreEqual("test", p.SiteMapProvider, "SiteMapProvider");
            Assert.AreEqual(2, p.StateBag.Count, "SiteMapProvider#1");
            // null properties doe's not affects on state bag count
            p.SiteMapProvider = null;
            Assert.AreEqual(2, p.StateBag.Count, "SiteMapProvider#2");

            p.StartFromCurrentNode = true;
            Assert.AreEqual(true, p.StartFromCurrentNode, "StartFromCurrentNode");
            Assert.AreEqual(3, p.StateBag.Count, "StartFromCurrentNode#1");

            p.StartingNodeOffset = 1;
            Assert.AreEqual(1, p.StartingNodeOffset, "StartingNodeOffset");
            Assert.AreEqual(4, p.StateBag.Count, "StartingNodeOffset#2");

            p.StartingNodeUrl = "default.aspx";
            Assert.AreEqual("default.aspx", p.StartingNodeUrl, "StartingNodeUrl");
            Assert.AreEqual(5, p.StateBag.Count, "StartingNodeUrl#1");
            // null properties doe's not affects on state bag count
            p.StartingNodeUrl = null;
            Assert.AreEqual(5, p.StateBag.Count, "StartingNodeUrl#2");
        }
        public void SiteMapDataSource_HierarchicalDataSourceView()
        {
            PokerSiteMapDataSource p = new PokerSiteMapDataSource();

            p.Provider = new mySiteMapProvider();
            HierarchicalDataSourceView h = p.DoHierarchicalDataSourceView("1");

            Assert.IsNotNull(h, "HierarchicalDataSourceView");
        }
        public void SiteMapDataSource_GetView()
        {
            PokerSiteMapDataSource p = new PokerSiteMapDataSource();

            p.Provider = new mySiteMapProvider();
            DataSourceView V = p.GetView("");

            Assert.IsNotNull(V, "GetView");
        }
        public void SiteMapDataSource_DefaultProperties()
        {
            PokerSiteMapDataSource p = new PokerSiteMapDataSource();

            Assert.AreEqual(true, p.ShowStartingNode, "ShowStartingNode");
            Assert.AreEqual(string.Empty, p.SiteMapProvider, "SiteMapProvider");
            Assert.AreEqual(false, p.StartFromCurrentNode, "StartFromCurrentNode");
            Assert.AreEqual(0, p.StartingNodeOffset, "StartingNodeOffset");
            Assert.AreEqual(string.Empty, p.StartingNodeUrl, "StartingNodeUrl");
        }
Ejemplo n.º 8
0
		public void SiteMapDataSource_DefaultProperties ()
		{

			PokerSiteMapDataSource p = new PokerSiteMapDataSource ();
			Assert.AreEqual (true, p.ShowStartingNode, "ShowStartingNode");
			Assert.AreEqual (string.Empty, p.SiteMapProvider, "SiteMapProvider");
			Assert.AreEqual (false, p.StartFromCurrentNode, "StartFromCurrentNode");
			Assert.AreEqual (0, p.StartingNodeOffset, "StartingNodeOffset");
			Assert.AreEqual (string.Empty, p.StartingNodeUrl, "StartingNodeUrl");
			
		}
        public void SiteMapDataSource_ViewState()
        {
            PokerSiteMapDataSource p = new PokerSiteMapDataSource();

            p.SiteMapProvider = "test";

            p.StartFromCurrentNode = false;
            p.StartingNodeOffset   = 1;
            p.StartingNodeUrl      = "default.aspx";

            object state = p.SaveState();
            PokerSiteMapDataSource copy = new PokerSiteMapDataSource();

            copy.LoadState(state);

            Assert.AreEqual("test", copy.SiteMapProvider, "SiteMapProvider");
            Assert.AreEqual(false, copy.StartFromCurrentNode, "StartFromCurrentNode");
            Assert.AreEqual(1, copy.StartingNodeOffset, "StartingNodeOffset");
            Assert.AreEqual("default.aspx", copy.StartingNodeUrl, "StartingNodeUrl");
        }
Ejemplo n.º 10
0
		public void SiteMapDataSource_HierarchicalDataSourceView ()
		{
			PokerSiteMapDataSource p = new PokerSiteMapDataSource ();
			p.Provider = new mySiteMapProvider ();
			HierarchicalDataSourceView h = p.DoHierarchicalDataSourceView ("1");
			Assert.IsNotNull (h, "HierarchicalDataSourceView");
		}
Ejemplo n.º 11
0
		public void SiteMapDataSource_ViewState ()
		{
			PokerSiteMapDataSource p = new PokerSiteMapDataSource ();
			p.SiteMapProvider = "test";

			p.StartFromCurrentNode = false;
			p.StartingNodeOffset = 1;
			p.StartingNodeUrl = "default.aspx";

			object state = p.SaveState ();
			PokerSiteMapDataSource copy = new PokerSiteMapDataSource ();
			copy.LoadState (state);

			Assert.AreEqual ("test", copy.SiteMapProvider, "SiteMapProvider");
			Assert.AreEqual (false, copy.StartFromCurrentNode, "StartFromCurrentNode");
			Assert.AreEqual (1, copy.StartingNodeOffset, "StartingNodeOffset");
			Assert.AreEqual ("default.aspx", copy.StartingNodeUrl, "StartingNodeUrl");
		}
Ejemplo n.º 12
0
		public void SiteMapDataSource_GetView ()
		{
			PokerSiteMapDataSource p = new PokerSiteMapDataSource ();
			p.Provider = new mySiteMapProvider ();
			DataSourceView V  = p.GetView("");
			Assert.IsNotNull (V, "GetView");
		}
Ejemplo n.º 13
0
		public void SiteMapDataSource_GetViewNames () {
			PokerSiteMapDataSource p = new PokerSiteMapDataSource ();
			Assert.AreEqual (1, p.GetViewNames ().Count, "GetViewNames().Count");
			Assert.AreEqual ("DefaultView", ((string []) p.GetViewNames ()) [0], "GetViewNames () [0]");
		}
Ejemplo n.º 14
0
		public void SiteMapDataSource_GetList ()
		{
			PokerSiteMapDataSource p = new PokerSiteMapDataSource ();
			Assert.IsNotNull (p.GetList (), "GetList");
			Assert.IsTrue (p.ContainsListCollection, "ContainsListCollection");
		}
        public void SiteMapDataSource_ContainsListCollection()
        {
            PokerSiteMapDataSource p = new PokerSiteMapDataSource();

            Assert.AreEqual(true, p.ContainsListCollection, "ContainsListCollection");
        }
Ejemplo n.º 16
0
		public void SiteMapDataSource_ContainsListCollection ()
		{	
			PokerSiteMapDataSource p = new PokerSiteMapDataSource ();
			Assert.AreEqual (true, p.ContainsListCollection, "ContainsListCollection");
		}
Ejemplo n.º 17
0
		public void SiteMapDataSource_ChangeProperties ()
		{
			PokerSiteMapDataSource p = new PokerSiteMapDataSource ();
			p.ShowStartingNode = false;
			Assert.AreEqual (false, p.ShowStartingNode, "ShowStartingNode");
			Assert.AreEqual (1, p.StateBag.Count, "ShowStartingNode#1");

			p.SiteMapProvider = "test";
			Assert.AreEqual ("test", p.SiteMapProvider, "SiteMapProvider");
			Assert.AreEqual (2, p.StateBag.Count, "SiteMapProvider#1");
			// null properties doe's not affects on state bag count
			p.SiteMapProvider = null;
			Assert.AreEqual (2, p.StateBag.Count, "SiteMapProvider#2");

			p.StartFromCurrentNode = true;
			Assert.AreEqual (true, p.StartFromCurrentNode, "StartFromCurrentNode");
			Assert.AreEqual (3, p.StateBag.Count, "StartFromCurrentNode#1");

			p.StartingNodeOffset = 1;
			Assert.AreEqual (1, p.StartingNodeOffset, "StartingNodeOffset");
			Assert.AreEqual (4, p.StateBag.Count, "StartingNodeOffset#2");

			p.StartingNodeUrl = "default.aspx";
			Assert.AreEqual ("default.aspx", p.StartingNodeUrl, "StartingNodeUrl");
			Assert.AreEqual (5, p.StateBag.Count, "StartingNodeUrl#1");
			// null properties doe's not affects on state bag count
			p.StartingNodeUrl = null;
			Assert.AreEqual (5, p.StateBag.Count, "StartingNodeUrl#2");
		}
Ejemplo n.º 18
0
		public void SiteMapDataSource_DataSourceChanged ()
		{
			PokerSiteMapDataSource p = new PokerSiteMapDataSource ();
			((IDataSource) p).DataSourceChanged += new EventHandler (SiteMapDataSourceTest_DataSourceChanged);
			
			eventChecker = false;
			p.ShowStartingNode = false;
			Assert.IsTrue (eventChecker, "DataSourceChanged#1");

			eventChecker = false;
			p.SiteMapProvider = "test";
			Assert.IsTrue (eventChecker, "DataSourceChanged#2");

			eventChecker = false;
			p.StartFromCurrentNode = true;
			Assert.IsTrue (eventChecker, "DataSourceChanged#3");

			eventChecker = false;
			p.StartingNodeOffset = 1;
			Assert.IsTrue (eventChecker, "DataSourceChanged#4");

			eventChecker = false;
			p.StartingNodeUrl = "default.aspx";
			Assert.IsTrue (eventChecker, "DataSourceChanged#5");
		}