Esempio n. 1
0
        public void Render_NoPage()
        {
            TestLoginName ln = new TestLoginName();

            Assert.AreEqual(String.Empty, ln.Render(), "Render");
            Assert.AreEqual(String.Empty, ln.RenderContents(), "RenderContents");
            Assert.AreEqual(String.Empty, ln.RenderBeginTag(), "RenderBeginTag");
            Assert.AreEqual(String.Empty, ln.RenderEndTag(false), "RenderEndTag");
        }
Esempio n. 2
0
        public void Render_Anonymous_IPrincipal()
        {
            ContextPage   page = new ContextPage(GetPrincipal(String.Empty));
            TestLoginName ln   = new TestLoginName();

            ln.Page = page;
            Assert.AreEqual(String.Empty, ln.Render(), "Render");
            Assert.AreEqual(String.Empty, ln.RenderContents(), "RenderContents");
            Assert.AreEqual(String.Empty, ln.RenderBeginTag(), "RenderBeginTag");
            Assert.AreEqual(String.Empty, ln.RenderEndTag(false), "RenderEndTag");
        }
Esempio n. 3
0
        public void Render_UnauthenticatedUser()
        {
            ContextPage   page = new ContextPage(GetUnauthenticatedPrincipal("me"));
            TestLoginName ln   = new TestLoginName();

            ln.Page = page;
            Assert.IsFalse(page.User.Identity.IsAuthenticated, "IsAuthenticated");
            Assert.AreEqual("<span>me</span>", ln.Render(), "Render");
            Assert.AreEqual("me", ln.RenderContents(), "RenderContents");
            Assert.AreEqual("<span>", ln.RenderBeginTag(), "RenderBeginTag");
            Assert.AreEqual("<span></span>", ln.RenderEndTag(true), "RenderEndTag");
        }
Esempio n. 4
0
		public void Render_UnauthenticatedUser ()
		{
			ContextPage page = new ContextPage (GetUnauthenticatedPrincipal ("me"));
			TestLoginName ln = new TestLoginName ();
			ln.Page = page;
			Assert.IsFalse (page.User.Identity.IsAuthenticated, "IsAuthenticated");
			Assert.AreEqual ("<span>me</span>", ln.Render (), "Render");
			Assert.AreEqual ("me", ln.RenderContents (), "RenderContents");
			Assert.AreEqual ("<span>", ln.RenderBeginTag (), "RenderBeginTag");
			Assert.AreEqual ("<span></span>", ln.RenderEndTag (true), "RenderEndTag");
		}
Esempio n. 5
0
		public void Render_Anonymous_IPrincipal ()
		{
			ContextPage page = new ContextPage (GetPrincipal (String.Empty));
			TestLoginName ln = new TestLoginName ();
			ln.Page = page;
			Assert.AreEqual (String.Empty, ln.Render (), "Render");
			Assert.AreEqual (String.Empty, ln.RenderContents (), "RenderContents");
			Assert.AreEqual (String.Empty, ln.RenderBeginTag (), "RenderBeginTag");
			Assert.AreEqual (String.Empty, ln.RenderEndTag (false), "RenderEndTag");
		}
Esempio n. 6
0
		public void Render_NoPage ()
		{
			TestLoginName ln = new TestLoginName ();
			Assert.AreEqual (String.Empty, ln.Render (), "Render");
			Assert.AreEqual (String.Empty, ln.RenderContents (), "RenderContents");
			Assert.AreEqual (String.Empty, ln.RenderBeginTag (), "RenderBeginTag");
			Assert.AreEqual (String.Empty, ln.RenderEndTag (false), "RenderEndTag");
		}