Esempio n. 1
0
        public void Render_User_WithoutForm()
        {
            ContextPage     page = new ContextPage(GetPrincipal("me"));
            TestLoginStatus ls   = new TestLoginStatus();

            ls.Page = page;
            ls.Render();
            // must be in a server form
        }
Esempio n. 2
0
        public void Render_StringFormat_TwoVars()
        {
            ContextPage   page = new ContextPage(GetPrincipal("me"));
            TestLoginName ln   = new TestLoginName();

            ln.Page         = page;
            ln.FormatString = "Hola {0} {1}!";
            Assert.AreEqual("Hola me!", ln.RenderContents(), "RenderContents");
        }
Esempio n. 3
0
        public void Render_StringFormat_Empty()
        {
            ContextPage   page = new ContextPage(GetPrincipal("me"));
            TestLoginName ln   = new TestLoginName();

            ln.Page         = page;
            ln.FormatString = String.Empty;
            Assert.AreEqual("me", ln.RenderContents(), "RenderContents");
        }
Esempio n. 4
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. 5
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");
        }
		public void Render_User_WithoutForm ()
		{
			ContextPage page = new ContextPage (GetPrincipal ("me"));
			TestLoginStatus ls = new TestLoginStatus ();
			ls.Page = page;
			ls.Render ();
			// must be in a server form
		}
Esempio n. 7
0
		public void Render_StringFormat_TwoVars ()
		{
			ContextPage page = new ContextPage (GetPrincipal ("me"));
			TestLoginName ln = new TestLoginName ();
			ln.Page = page;
			ln.FormatString = "Hola {0} {1}!";
			Assert.AreEqual ("Hola me!", ln.RenderContents (), "RenderContents");
		}
Esempio n. 8
0
		public void Render_StringFormat_Empty ()
		{
			ContextPage page = new ContextPage (GetPrincipal ("me"));
			TestLoginName ln = new TestLoginName ();
			ln.Page = page;
			ln.FormatString = String.Empty;
			Assert.AreEqual ("me", ln.RenderContents (), "RenderContents");
		}
Esempio n. 9
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. 10
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");
		}