Example #1
0
        public void SiteMapPath_ViewState()
        {
            PokerSiteMapPath p = new PokerSiteMapPath();

            p.ShowToolTips = false;
            Style currentNodeStyle = new Style();

            p.CurrentNodeStyle.ForeColor = Color.AliceBlue;
            Style NodeStyle = new Style();

            p.NodeStyle.BackColor = Color.Aqua;
            p.PathDirection       = PathDirection.CurrentToRoot;
            Assert.AreEqual(PathDirection.CurrentToRoot, p.PathDirection, "PathDirection");
            p.PathSeparator = " - ";
            Style RootNodeStyle = new Style();

            p.RootNodeStyle.BackColor = Color.Red;
            p.ParentLevelsDisplayed   = 2;
            p.RenderCurrentNodeAsLink = true;
            p.SiteMapProvider         = "test";
            p.SkipLinkText            = "test";

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

            copy.LoadState(state);
            Assert.IsFalse(copy.ShowToolTips, "ShowToolTips");
            Assert.AreEqual(Color.AliceBlue, copy.CurrentNodeStyle.ForeColor, "CurrentNodeStyle");
            Assert.AreEqual(Color.Aqua, p.NodeStyle.BackColor, "NodeStyle");
            Assert.AreEqual(" - ", p.PathSeparator, "PathSeparator");
            Assert.IsFalse(p.RootNodeStyle.IsEmpty, "RootNodeStyle#1");
            Assert.AreEqual(Color.Red, p.RootNodeStyle.BackColor, "RootNodeStyle#2");
            Assert.AreEqual(2, p.ParentLevelsDisplayed, "ParentLevelsDisplayed");
            Assert.IsTrue(p.RenderCurrentNodeAsLink, "RenderCurrentNodeAsLink");
            Assert.AreEqual("test", p.SiteMapProvider, "SiteMapProvider");
            Assert.AreEqual("test", p.SkipLinkText, "Skip Navigation Links");
        }
		public void SiteMapPath_ViewState ()
		{
			PokerSiteMapPath p = new PokerSiteMapPath ();
			p.ShowToolTips = false;
			Style currentNodeStyle = new Style ();
			p.CurrentNodeStyle.ForeColor = Color.AliceBlue;
			Style NodeStyle = new Style ();
			p.NodeStyle.BackColor = Color.Aqua;
			p.PathDirection = PathDirection.CurrentToRoot;
			Assert.AreEqual (PathDirection.CurrentToRoot, p.PathDirection, "PathDirection");
			p.PathSeparator = " - ";
			Style RootNodeStyle = new Style ();
			p.RootNodeStyle.BackColor = Color.Red;
			p.ParentLevelsDisplayed = 2;
			p.RenderCurrentNodeAsLink = true;
			p.SiteMapProvider = "test";
			p.SkipLinkText = "test";

			object state = p.SaveState ();
			PokerSiteMapPath copy = new PokerSiteMapPath ();
			copy.LoadState (state);
			Assert.IsFalse (copy.ShowToolTips, "ShowToolTips");
			Assert.AreEqual (Color.AliceBlue, copy.CurrentNodeStyle.ForeColor, "CurrentNodeStyle");
			Assert.AreEqual (Color.Aqua, p.NodeStyle.BackColor, "NodeStyle");
			Assert.AreEqual (" - ", p.PathSeparator, "PathSeparator");
			Assert.IsFalse (p.RootNodeStyle.IsEmpty, "RootNodeStyle#1");
			Assert.AreEqual (Color.Red, p.RootNodeStyle.BackColor, "RootNodeStyle#2");
			Assert.AreEqual (2, p.ParentLevelsDisplayed, "ParentLevelsDisplayed");
			Assert.IsTrue (p.RenderCurrentNodeAsLink, "RenderCurrentNodeAsLink");
			Assert.AreEqual ("test", p.SiteMapProvider, "SiteMapProvider");
			Assert.AreEqual ("test", p.SkipLinkText, "Skip Navigation Links");
		}