Exemplo 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");
        }
Exemplo 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");
        }
Exemplo 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");
        }
Exemplo 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");
		}
Exemplo 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");
		}
Exemplo 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");
		}