예제 #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");
        }
예제 #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");
        }
예제 #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");
        }
예제 #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");
		}
예제 #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");
		}
예제 #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");
		}