Ejemplo n.º 1
0
		public void UrlPropertyTest ()
		{
			string res = new WebTest ("UrlProperty.aspx").Run ();

			Assert.IsTrue (res.IndexOf ("Property1 = testProp1") != -1,
				"Property1 should be assigned as is, actual result: "+res);
			Assert.IsTrue (res.IndexOf ("UrlProperty2 = ~/App_Themes/Theme1/testProp2") != -1,
				"UrlProperty2 should be assigned including theme subfolder, actual result: "+res);
		}
		public void TitlesRenderTest ()
		{
			string html = new WebTest (PageInvoker.CreateOnLoad (
				new PageDelegate (TitlesRenderTestInit))).Run ();

			Assert.IsTrue (html.IndexOf ("userid") > 0, "UserNameLabelText");
			Assert.IsTrue (html.IndexOf ("PasswordLabelText") > 0, "PasswordLabelText");
			Assert.IsTrue (html.IndexOf ("NewPasswordLabelText") > 0, "NewPasswordLabelText");
			Assert.IsTrue (html.IndexOf ("ConfirmNewPasswordLabelText") > 0, "ConfirmNewPasswordLabelText");
			Assert.IsTrue (html.IndexOf ("InstructionText") > 0, "InstructionText");
			Assert.IsTrue (html.IndexOf ("PasswordHintText") > 0, "PasswordHintText");
			Assert.IsTrue (html.IndexOf ("zzxcmnmncx") > 0, "zzxcmnmncx");
		}
Ejemplo n.º 3
0
		public void Theme_EnableThemingChild ()
		{

			PageDelegates pd = new PageDelegates ();
			pd.PreInit = new PageDelegate (SetTheme1);
			pd.Load = new PageDelegate (Theme1ChildLoad);
			PageInvoker pi = new PageInvoker (pd);

			string page = new WebTest (pi).Run ();

			Assert.IsTrue (page.IndexOf ("testing") > 0, "Theme_EnableThemingChild");
		}
Ejemplo n.º 4
0
		public void TitlesRenderTest ()
		{
			string html = new WebTest (PageInvoker.CreateOnLoad (
				new PageDelegate (TitlesRenderTestInit))).Run ();

			Assert.IsTrue (html.IndexOf ("userid") > 0, "UserNameLabelText");
			Assert.IsTrue (html.IndexOf ("pincode") > 0, "PasswordLabelText");
			Assert.IsTrue (html.IndexOf ("cpincode") > 0, "ConfirmPasswordLabelText");
			Assert.IsTrue (html.IndexOf ("zzxcmnmncx") > 0, "QuestionLabelText");
			Assert.IsTrue (html.IndexOf ("kjkjskjkjskjkj") > 0, "AnswerLabelText");
			Assert.IsTrue (html.IndexOf ("emailemail") > 0, "EmailLabelText");
		}
Ejemplo n.º 5
0
		public void StylesRenderTest ()
		{
			string html = new WebTest (PageInvoker.CreateOnLoad (
				new PageDelegate (StylesRenderTestInit))).Run ();

			Assert.IsTrue (html.IndexOf ("LightGoldenrodYellow;") > 0, "TextBoxStyle");
			Assert.IsTrue (html.LastIndexOf ("LightGoldenrodYellow;") > html.IndexOf ("LightGoldenrodYellow;"), "TextBoxStyle2");
			Assert.IsTrue (html.IndexOf ("732px") > 0, "TitleTextStyle");
			Assert.IsTrue (html.IndexOf ("LightSkyBlue;") > 0, "HyperLinkStyle");
			Assert.IsTrue (html.IndexOf ("MediumSeaGreen;") > 0, "InstructionTextStyle");
			Assert.IsTrue (html.IndexOf ("MediumSpringGreen;") > 0, "LabelStyle");
			Assert.IsTrue (html.IndexOf ("MintCream;") > 0, "PasswordHintStyle");
			Assert.IsTrue (html.IndexOf ("PeachPuff;") > 0, "CreateUserButtonStyle");

		}
Ejemplo n.º 6
0
		public void BasicRenderTest ()
		{
			string html = new WebTest (PageInvoker.CreateOnLoad (
				new PageDelegate (BasicRenderTestInit))).Run ();

			int st = 0;
			Assert.IsTrue ((st = html.IndexOf ("<table", st)) > 0, "base render test 1");
			Assert.IsTrue ((st = html.IndexOf ("PasswordRecovery1", st)) > 0, "base render test 2");
			Assert.IsTrue ((st = html.IndexOf ("border-collapse:collapse", st)) > 0, "base render test 3");
			Assert.IsTrue ((st = html.IndexOf ("<table", st)) > 0, "base render test 4");
			Assert.IsTrue ((st = html.IndexOf ("Forgot Your Password?", st)) > 0, "base render test 6");
			Assert.IsTrue ((st = html.IndexOf ("Enter your User Name to receive your password.", st)) > 0, "base render test 7");
			Assert.IsTrue ((st = html.IndexOf ("User Name:", st)) > 0, "base render test 8");
			Assert.IsTrue ((st = html.IndexOf ("Submit", st)) > 0, "base render test 9");
		}
Ejemplo n.º 7
0
		public void ExtraTitlesRenderTest ()
		{
			string html = new WebTest (PageInvoker.CreateOnLoad (
				new PageDelegate (ExtraTitlesRenderTestInit))).Run ();

			Assert.IsTrue (html.IndexOf ("http://www.HelpPageUrl.com") > 0, "HelpPageUrl");
			Assert.IsTrue (html.IndexOf ("HelpPageText") > 0, "HelpPageText");
			Assert.IsTrue (html.IndexOf ("http://www.HelpPageIconUrl.com") > 0, "HelpPageIconUrl");
		}
		public void WizardStepBase_RenderTest ()
		{
			// This render test include Title property test 
			string html = new WebTest (PageInvoker.CreateOnLoad (
				new PageDelegate (Render_Test))).Run ();
#if NET_4_0
			string origin = "<table cellspacing=\"0\" cellpadding=\"0\" style=\"border-collapse:collapse;\">\r\n\t<tr>\r\n\t\t<td style=\"height:100%;\"><a href=\"#ctl01_SkipLink\"><img alt=\"Skip Navigation Links.\" height=\"0\" width=\"0\" src=\"/NunitWeb/WebResource.axd?d=8VpphgAbakKUC_J8R6hR0Q2&amp;t=634067491135766272\" style=\"border-width:0px;\" /></a><table id=\"ctl01_SideBarContainer_SideBarList\" cellspacing=\"0\" style=\"border-collapse:collapse;\">\r\n\t\t\t<tr>\r\n\t\t\t\t<td style=\"font-weight:bold;\"><a id=\"ctl01_SideBarContainer_SideBarList_SideBarButton_0\" href=\"javascript:__doPostBack(&#39;ctl01$SideBarContainer$SideBarList$ctl00$SideBarButton&#39;,&#39;&#39;)\">my_title</a></td>\r\n\t\t\t</tr><tr>\r\n\t\t\t\t<td><a id=\"ctl01_SideBarContainer_SideBarList_SideBarButton_1\" href=\"javascript:__doPostBack(&#39;ctl01$SideBarContainer$SideBarList$ctl01$SideBarButton&#39;,&#39;&#39;)\">my_title_2</a></td>\r\n\t\t\t</tr>\r\n\t\t</table><a id=\"ctl01_SkipLink\"></a></td><td style=\"height:100%;\"><table cellspacing=\"0\" cellpadding=\"0\" style=\"height:100%;width:100%;border-collapse:collapse;\">\r\n\t\t\t<tr style=\"height:100%;\">\r\n\t\t\t\t<td>123</td>\r\n\t\t\t</tr><tr>\r\n\t\t\t\t<td align=\"right\"><table cellspacing=\"5\" cellpadding=\"5\">\r\n\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t<td align=\"right\"><input type=\"submit\" name=\"ctl01$StartNavigationTemplateContainerID$StartNextButton\" value=\"Next\" id=\"ctl01_StartNavigationTemplateContainerID_StartNextButton\" /></td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t</table></td>\r\n\t\t\t</tr>\r\n\t\t</table></td>\r\n\t</tr>\r\n</table>";
#else
			string origin = "<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" style=\"border-collapse:collapse;\">\r\n\t<tr>\r\n\t\t<td style=\"height:100%;\"><a href=\"#ctl01_SkipLink\"><img alt=\"Skip Navigation Links.\" height=\"0\" width=\"0\" src=\"/NunitWeb/WebResource.axd?d=4RHYfeNnynkXiM59uthjZg2&amp;t=633802729995006876\" style=\"border-width:0px;\" /></a><table id=\"ctl01_SideBarContainer_SideBarList\" cellspacing=\"0\" border=\"0\" style=\"border-collapse:collapse;\">\r\n\t\t\t<tr>\r\n\t\t\t\t<td style=\"font-weight:bold;\"><a id=\"ctl01_SideBarContainer_SideBarList_ctl00_SideBarButton\" href=\"javascript:__doPostBack('ctl01$SideBarContainer$SideBarList$ctl00$SideBarButton','')\">my_title</a></td>\r\n\t\t\t</tr><tr>\r\n\t\t\t\t<td><a id=\"ctl01_SideBarContainer_SideBarList_ctl01_SideBarButton\" href=\"javascript:__doPostBack('ctl01$SideBarContainer$SideBarList$ctl01$SideBarButton','')\">my_title_2</a></td>\r\n\t\t\t</tr>\r\n\t\t</table><a id=\"ctl01_SkipLink\"></a></td><td style=\"height:100%;\"><table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" style=\"height:100%;width:100%;border-collapse:collapse;\">\r\n\t\t\t<tr style=\"height:100%;\">\r\n\t\t\t\t<td>123</td>\r\n\t\t\t</tr><tr>\r\n\t\t\t\t<td align=\"right\"><table cellspacing=\"5\" cellpadding=\"5\" border=\"0\">\r\n\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t<td align=\"right\"><input type=\"submit\" name=\"ctl01$StartNavigationTemplateContainerID$StartNextButton\" value=\"Next\" id=\"ctl01_StartNavigationTemplateContainerID_StartNextButton\" /></td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t</table></td>\r\n\t\t\t</tr>\r\n\t\t</table></td>\r\n\t</tr>\r\n</table>";
#endif
			string renderedHtml = HtmlDiff.GetControlFromPageHtml (html);
			HtmlDiff.AssertAreEqual (origin, renderedHtml, "BaseRender");
			if (html.IndexOf ("my_title") < 0)
				Assert.Fail ("WizardStepBase title not rendered");
		}
		public void DetailsView_FooterTemplateRender ()
		{

			//Footer Template property is checked.
			string RenderedPageHtml = new WebTest ("FooterTemplateTest.aspx").Run ();
			string newHtmlValue = RenderedPageHtml.Substring (RenderedPageHtml.IndexOf ("starttest")+9, RenderedPageHtml.IndexOf ("endtest") - RenderedPageHtml.IndexOf ("starttest")-9); 
			string origHtmlValue = @" <div>
						  <div>
						<table cellspacing=""0"" rules=""all"" border=""1"" id=""DetailsView1"" style=""height:50px;width:125px;border-collapse:collapse;"">
						<tr>
						<td>ID</td><td>1001</td>
						</tr><tr>
						<td>FName</td><td>Mahesh</td>
						</tr><tr>
						<td>LName</td><td>Chand</td>
						</tr><tr>
						<td colspan=""2"">
						 Footer Template Test<a id=""DetailsView1_HyperLink1"">Footer</a>
						 </td>
						</tr><tr>
						<td colspan=""2""><table border=""0"">
						<tr>
						<td><span>1</span></td><td><a href=""javascript:__doPostBack('DetailsView1','Page$2')"">2</a></td><td><a href=""javascript:__doPostBack('DetailsView1','Page$3')"">3</a></td>
						</tr>
						</table></td>
						</tr>
						</table>
						</div>   
						 </div>";
  				

                       HtmlDiff.AssertAreEqual (origHtmlValue, newHtmlValue, "RenderFooterTemplate");
		}
Ejemplo n.º 10
0
//#if TARGET_JVM //BUG #6518
//                [Category ("NotWorking")]
//#endif
		public void FormView_Render ()
		{
			string RenderedPageHtml = new WebTest ("FormViewTest1.aspx").Run ();
			string newHtmlValue = RenderedPageHtml.Substring (RenderedPageHtml.IndexOf ("test3") + 5, RenderedPageHtml.IndexOf ("test4") - RenderedPageHtml.IndexOf ("test3") - 5);
			string origHtmlValue = @"<table cellspacing=""0"" cellpadding=""2"" border=""0"" id=""FormView3"" style=""color:Black;background-color:LightGoldenrodYellow;border-color:Tan;border-width:1px;border-style:solid;border-collapse:collapse;"">
	<tr align=""center"" valign=""top"" style=""color:#C00000;background-color:Tan;font-weight:bold;"">
		<td colspan=""2"">
                <span id=""FormView3_Label5"">Header Template Test</span>
            </td>
	</tr><tr>
		<td colspan=""2"">
                <span id=""FormView3_Label4"">1</span>
            </td>
	</tr><tr align=""right"" style=""color:#FFC0FF;background-color:Tan;"">
		<td colspan=""2"">
                <span id=""FormView3_Label6"">FormView Footer</span>
            </td>
	</tr><tr align=""center"" style=""color:DarkSlateBlue;background-color:PaleGoldenrod;"">
		<td colspan=""2""><table border=""0"">
			<tr>
				<td><span>1</span></td><td><a href=""javascript:__doPostBack('FormView3','Page$2')"" style=""color:DarkSlateBlue;"">2</a></td><td><a href=""javascript:__doPostBack('FormView3','Page$3')"" style=""color:DarkSlateBlue;"">3</a></td><td><a href=""javascript:__doPostBack('FormView3','Page$4')"" style=""color:DarkSlateBlue;"">4</a></td><td><a href=""javascript:__doPostBack('FormView3','Page$5')"" style=""color:DarkSlateBlue;"">5</a></td><td><a href=""javascript:__doPostBack('FormView3','Page$6')"" style=""color:DarkSlateBlue;"">6</a></td>
			</tr>
		</table></td>
	</tr>
</table>";        
			HtmlDiff.AssertAreEqual (origHtmlValue, newHtmlValue, "RenderingDefaultPaging");
		}
Ejemplo n.º 11
0
		public void DuplicateControlsInClientComment ()
		{
			// Just test if it throws an exception
			string pageHtml = new WebTest ("DuplicateControlsInClientComment.aspx").Run ();
			Assert.IsTrue (pageHtml.IndexOf ("[System.Web.Compilation.ParseException]:") != -1, "#A1");
		}
Ejemplo n.º 12
0
//#if TARGET_JVM //BUG #6518
//                [Category ("NotWorking")]
//#endif
		public void FormView_RenderWithHeader()
		{
			string RenderedPageHtml = new WebTest ("FormViewTest1.aspx").Run ();
			string newHtmlValue = RenderedPageHtml.Substring (RenderedPageHtml.IndexOf ("test4") + 5, RenderedPageHtml.IndexOf ("endtest") - RenderedPageHtml.IndexOf ("test4") - 5);
			string origHtmlValue = @" <table cellspacing=""10"" cellpadding=""3"" align=""Right"" rules=""all"" border=""1"" id=""FormView4"" style=""background-color:White;border-color:#CCCCCC;border-width:1px;border-style:None;"">
						<tr align=""left"" style=""color:White;background-color:#006699;font-weight:bold;"">
						<td colspan=""2"">Using Header Text property</td>
						</tr><tr align=""center"" style=""color:#000066;background-color:Maroon;"">
						<td colspan=""2"">Using Footer Text property</td>
						</tr><tr align=""left"" style=""color:#000066;background-color:LightGrey;"">
						<td colspan=""2"">
						<a id=""FormView4_ctl01_LinkButton1"" href=""javascript:__doPostBack('FormView4$ctl01$LinkButton1','')"">Next</a>
						 <a id=""FormView4_ctl01_LinkButton2"" href=""javascript:__doPostBack('FormView4$ctl01$LinkButton2','')"">Prev</a>
						<span id=""FormView4_ctl01_Label7"">Page Index: 0</span>
						</td>
						</tr>
						</table>"; 			
			HtmlDiff.AssertAreEqual (origHtmlValue, newHtmlValue, "RenderingDefaultPaging");
		}
Ejemplo n.º 13
0
//#if TARGET_JVM //BUG #6518
//                [Category ("NotWorking")]
//#endif
		public void FormView_RenderFooterAndPager()
		{
			string RenderedPageHtml = new WebTest ("FormViewTest1.aspx").Run ();			
			string newHtmlValue = RenderedPageHtml.Substring (RenderedPageHtml.IndexOf ("test2") + 5, RenderedPageHtml.IndexOf ("test3") - RenderedPageHtml.IndexOf ("test2") - 5);
			string origHtmlValue = @" <table cellspacing=""0"" cellpadding=""4"" border=""0"" id=""FormView2"" style=""color:#333333;border-collapse:collapse;"">
						<tr style=""color:#333333;background-color:#F7F6F3;"">
						<td colspan=""2"">
						 <span id=""FormView2_Label2"">1</span>
						 </td>
						</tr><tr style=""color:White;background-color:#5D7B9D;font-weight:bold;"">
						<td colspan=""2"">
						<span id=""FormView2_Label3"">Footer Template Test</span>
						 </td>
						</tr><tr align=""center"" style=""color:White;background-color:#284775;"">
						<td colspan=""2"">
						<input type=""submit"" name=""FormView2$ctl01$Button1"" value=""Prev Item"" id=""FormView2_ctl01_Button1"" />
					        <input type=""submit"" name=""FormView2$ctl01$Button2"" value=""Next Item"" id=""FormView2_ctl01_Button2"" />
						 <input type=""submit"" name=""FormView2$ctl01$Button3"" value=""First Item"" id=""FormView2_ctl01_Button3"" />
						 <input type=""submit"" name=""FormView2$ctl01$Button4"" value=""Last Item"" id=""FormView2_ctl01_Button4"" />
						 </td>
						</tr>
						</table>    
						</div>";    
			HtmlDiff.AssertAreEqual (origHtmlValue, newHtmlValue, "FormView_RenderFooterAndPager");
		}
Ejemplo n.º 14
0
//#if TARGET_JVM //BUG #6518
//                [Category ("NotWorking")]
//#endif
		public void FormView_RenderSimpleTemplate()
		{
			string RenderedPageHtml = new WebTest ("FormViewTest1.aspx").Run ();			
			string newHtmlValue = RenderedPageHtml.Substring (RenderedPageHtml.IndexOf ("test1") + 5, RenderedPageHtml.IndexOf ("test2") - RenderedPageHtml.IndexOf ("test1") - 5);  		
			string origHtmlValue = @" &nbsp;<table cellspacing=""2"" cellpadding=""3"" rules=""all"" border=""1"" id=""FormView1"" style=""background-color:#DEBA84;border-color:#DEBA84;border-width:1px;border-style:None;"">
						<tr style=""color:#8C4510;background-color:#FFF7E7;"">
						<td colspan=""2"">
						 <span id=""FormView1_Label1"">1</span>
						 </td>
						</tr><tr align=""center"" style=""color:#8C4510;"">
						<td colspan=""2""><table border=""0"">
						<tr>
						<td><span>1</span></td><td><a href=""javascript:__doPostBack('FormView1','Page$2')"" style=""color:#8C4510;"">2</a></td><td><a href=""javascript:__doPostBack('FormView1','Page$3')"" style=""color:#8C4510;"">3</a></td><td><a href=""javascript:__doPostBack('FormView1','Page$4')"" style=""color:#8C4510;"">4</a></td><td><a href=""javascript:__doPostBack('FormView1','Page$5')"" style=""color:#8C4510;"">5</a></td><td><a href=""javascript:__doPostBack('FormView1','Page$6')"" style=""color:#8C4510;"">6</a></td>
						</tr>
						</table></td>
						</tr>
						</table>";         
        
			HtmlDiff.AssertAreEqual (origHtmlValue, newHtmlValue, "RenderSimpleTemplate");                  

		}
Ejemplo n.º 15
0
		public void MissingMasterFile ()
		{
			string pageHtml = new WebTest ("MissingMasterFile.aspx").Run ();
			Assert.IsTrue (pageHtml.IndexOf ("[System.Web.Compilation.ParseException]:") != -1, "#A1");
		}
		public void DetailsView_RenderHeaderTemplate ()
		{
			//Header Template property is checked
			string RenderedPageHtml = new WebTest ("DetailsViewTemplates.aspx").Run ();
			string newHtmlValue = RenderedPageHtml.Substring (RenderedPageHtml.IndexOf ("test1") + 5, RenderedPageHtml.IndexOf ("test2") - RenderedPageHtml.IndexOf ("test1") - 5);
                        string origHtmlValue = @" <div>
						 <div>
						<table cellspacing=""0"" rules=""all"" border=""1"" id=""DetailsView1"" style=""height:50px;width:125px;border-collapse:collapse;"">
						<tr>
						<td colspan=""2"">
						Header Template<input type=""submit"" name=""DetailsView1$Button1"" value=""Header button"" id=""DetailsView1_Button1"" />
						 </td>
						</tr><tr>
						<td>ID</td><td>1001</td>
						</tr><tr>
						<td>FName</td><td>Mahesh</td>
						</tr><tr>
						<td>LName</td><td>Chand</td>
						</tr><tr>
						<td colspan=""2""><a href=""javascript:__doPostBack('DetailsView1','Delete$0')"">Delete</a></td>
							</tr><tr>
						<td colspan=""2""><table border=""0"">
						<tr>
						<td><span>1</span></td><td><a href=""javascript:__doPostBack('DetailsView1','Page$2')"">2</a></td><td><a href=""javascript:__doPostBack('DetailsView1','Page$3')"">3</a></td>
						</tr>
						</table></td>
						</tr>
						</table>
						</div>";      
                
        
		HtmlDiff.AssertAreEqual (origHtmlValue, newHtmlValue, "RenderHeaderTemplate");
		}
		public void WizardStepBase_RenderTest ()
		{
			// This render test include Title property test 
			string html = new WebTest (PageInvoker.CreateOnLoad (
				new PageDelegate (Render_Test))).Run ();
			string origin = @"<table cellspacing=""0"" cellpadding=""0"" border=""0"" style=""border-collapse:collapse;"">
								<tr>
									<td style=""height:100%;""><a href=""#ctl01_SkipLink""><img alt=""Skip Navigation Links."" height=""0"" width=""0"" src=""/NunitWeb/WebResource.axd?d=u9knZDluAzVeq3S7b_Cm7w2&amp;t=632875336762459244"" style=""border-width:0px;"" /></a><table id=""ctl01_SideBarContainer_SideBarList"" cellspacing=""0"" border=""0"" style=""border-collapse:collapse;"">
										<tr>
											<td style=""font-weight:bold;""><a id=""ctl01_SideBarContainer_SideBarList_ctl00_SideBarButton"" href=""javascript:__doPostBack('ctl01$SideBarContainer$SideBarList$ctl00$SideBarButton','')"">my_title</a></td>
										</tr><tr>
											<td><a id=""ctl01_SideBarContainer_SideBarList_ctl01_SideBarButton"" href=""javascript:__doPostBack('ctl01$SideBarContainer$SideBarList$ctl01$SideBarButton','')"">my_title_2</a></td>
										</tr>
									</table><a id=""ctl01_SkipLink""></a></td><td style=""height:100%;""><table cellspacing=""0"" cellpadding=""0"" border=""0"" style=""height:100%;width:100%;border-collapse:collapse;"">
										<tr style=""height:100%;"">
											<td>123</td>
										</tr><tr>
											<td align=""right""><table cellspacing=""5"" cellpadding=""5"" border=""0"">
												<tr>
													<td align=""right""><input type=""submit"" name=""ctl01$StartNavigationTemplateContainerID$StartNextButton"" value=""Next"" id=""ctl01_StartNavigationTemplateContainerID_StartNextButton"" /></td>
												</tr>
											</table></td>
										</tr>
									</table></td>
								</tr>
							</table>";
			HtmlDiff.AssertAreEqual (origin, HtmlDiff.GetControlFromPageHtml (html), "BaseRender");
			if (html.IndexOf ("my_title") < 0) {
				Assert.Fail ("WizardStepBase title not rendered");
			}
			
		}
		public void DetailsView_PagerTemplateRender ()
		{
			//Pager Template property is checked
			string RenderedPageHtml = new WebTest ("DetailsViewTemplates.aspx").Run ();
			string newHtmlValue = RenderedPageHtml.Substring (RenderedPageHtml.IndexOf ("test2") + 5, RenderedPageHtml.IndexOf ("test3") - RenderedPageHtml.IndexOf ("test2") - 5);
			string origHtmlValue = @" <div>
						<table cellspacing=""0"" rules=""all"" border=""1"" id=""DetailsView2"" style=""height:50px;width:125px;border-collapse:collapse;"">
						<tr>
						<td>ID</td><td>1001</td>
						</tr><tr>
						<td>FName</td><td>Mahesh</td>
						</tr><tr>
						<td>LName</td><td>Chand</td>
						</tr><tr>
						<td colspan=""2"">
						 <input type=""submit"" name=""DetailsView2$ctl01$Button2"" value=""Prev"" id=""DetailsView2_ctl01_Button2"" />
						  <input type=""submit"" name=""DetailsView2$ctl01$Button3"" value=""Next"" id=""DetailsView2_ctl01_Button3"" />
						</td>
						</tr>
						</table>
						</div>";
    
			HtmlDiff.AssertAreEqual (origHtmlValue, newHtmlValue, "RenderPagerTemplate");
		}
Ejemplo n.º 19
0
		public void TitlesRenderTest ()
		{
			string html = new WebTest (PageInvoker.CreateOnLoad (
				new PageDelegate (TitlesRenderTestInit))).Run ();

			Assert.IsTrue (html.IndexOf ("userid") > 0, "UserNameLabelText");
			Assert.IsTrue (html.IndexOf ("forgot") > 0, "UserNameTitleText");
			Assert.IsTrue (html.IndexOf ("UserNameInstructionText") > 0, "UserNameInstructionText");
			Assert.IsTrue (html.IndexOf ("zzxcmnmncx") > 0, "SubmitButtonText");
		}
		public void DetailsView_EditFieldsRender ()
		{
			string RenderedPageHtml = new WebTest ("DetailsViewTemplates.aspx").Run ();
			string newHtmlValue = RenderedPageHtml.Substring (RenderedPageHtml.IndexOf ("test3") + 5, RenderedPageHtml.IndexOf ("endtest") - RenderedPageHtml.IndexOf ("test3") - 5);
			string origHtmlValue = @" </div>
							<div>
						<table cellspacing=""0"" rules=""all"" border=""1"" id=""DetailsView3"" style=""height:50px;width:125px;border-collapse:collapse;"">
						<tr>
						<td>ID</td><td>1001</td>
						</tr><tr>
						<td>FName</td><td>Mahesh</td>
						</tr><tr>
						<td>LName</td><td>Chand</td>
						</tr><tr>
						<td colspan=""2""><a href=""javascript:__doPostBack('DetailsView3','$0')"">TestButtonField</a></td>
						</tr><tr>
						<td>&nbsp;</td><td><a></a></td>
						</tr><tr>
						<td>Image field</td><td></td>
						</tr><tr>
						<td>&nbsp;</td><td></td>
						</tr><tr>
						<td>Template Field</td><td style=""background-color:#FFE0C0;"">&nbsp;</td>
						</tr><tr>
						<td colspan=""2""><table border=""0"">
						<tr>
						<td><span>1</span></td><td><a href=""javascript:__doPostBack('DetailsView3','Page$2')"">2</a></td><td><a href=""javascript:__doPostBack('DetailsView3','Page$3')"">3</a></td>
						</tr>
						</table></td>
						</tr>
						</table>
						</div>";
   
							
			HtmlDiff.AssertAreEqual (origHtmlValue, newHtmlValue, "RenderDataFields");
		}
Ejemplo n.º 21
0
		public void BasicRenderTest ()
		{
			string html = new WebTest (PageInvoker.CreateOnLoad (
				new PageDelegate (BasicRenderTestInit))).Run ();

			int st = 0;
			Assert.IsTrue ((st = html.IndexOf ("<table", st)) > 0, "base render test 1");
			Assert.IsTrue ((st = html.IndexOf ("CreateUserWizard1", st)) > 0, "base render test 2");
			Assert.IsTrue ((st = html.IndexOf ("border-collapse:collapse", st)) > 0, "base render test 3");
			Assert.IsTrue ((st = html.IndexOf ("<table", st)) > 0, "base render test 4");
			Assert.IsTrue ((st = html.IndexOf ("height:100%", st)) > 0, "base render test 5");
			Assert.IsTrue ((st = html.IndexOf ("Sign Up for Your New Account", st)) > 0, "base render test 6");
			Assert.IsTrue ((st = html.IndexOf ("UserName", st)) > 0, "base render test 7");
			Assert.IsTrue ((st = html.IndexOf ("User Name:", st)) > 0, "base render test 8");
			Assert.IsTrue ((st = html.IndexOf ("UserName", st)) > 0, "base render test 9");
			Assert.IsTrue ((st = html.IndexOf ("Password", st)) > 0, "base render test 10");
			Assert.IsTrue ((st = html.IndexOf ("Password:"******"base render test 11");
			Assert.IsTrue ((st = html.IndexOf ("Password", st)) > 0, "base render test 12");
			Assert.IsTrue ((st = html.IndexOf ("ConfirmPassword", st)) > 0, "base render test 13");
			Assert.IsTrue ((st = html.IndexOf ("Confirm Password:"******"base render test 14");
			Assert.IsTrue ((st = html.IndexOf ("ConfirmPassword", st)) > 0, "base render test 15");
			Assert.IsTrue ((st = html.IndexOf ("Email", st)) > 0, "base render test 16");
			Assert.IsTrue ((st = html.IndexOf ("E-mail:", st)) > 0, "base render test 17");
			Assert.IsTrue ((st = html.IndexOf ("Email", st)) > 0, "base render test 18");
			Assert.IsTrue ((st = html.IndexOf ("Question", st)) > 0, "base render test 19");
			Assert.IsTrue ((st = html.IndexOf ("Security Question:", st)) > 0, "base render test 20");
			Assert.IsTrue ((st = html.IndexOf ("Question", st)) > 0, "base render test 21");
			Assert.IsTrue ((st = html.IndexOf ("Answer", st)) > 0, "base render test 22");
			Assert.IsTrue ((st = html.IndexOf ("Security Answer:", st)) > 0, "base render test 23");
			Assert.IsTrue ((st = html.IndexOf ("Answer", st)) > 0, "base render test 24");
			Assert.IsTrue ((st = html.IndexOf ("<input", st)) > 0, "base render test 25");
			Assert.IsTrue ((st = html.IndexOf ("submit", st)) > 0, "base render test 26");
			Assert.IsTrue ((st = html.IndexOf ("NextButton", st)) > 0, "base render test 27");
		}
		public void DetailsView_AssignedPropertiesRender ()
		{
			string RenderedPageHtml = new WebTest ("DetailsViewProperties1.aspx").Run ();
			string newHtmlValue = RenderedPageHtml.Substring (RenderedPageHtml.IndexOf ("starttest") + 9, RenderedPageHtml.IndexOf ("endtest") - RenderedPageHtml.IndexOf ("starttest") - 9);
			string origHtmlValue = @" <div>
			<div>
			<table cellspacing=""20"" cellpadding=""30"" rules=""all"" border=""1"" id=""DetailsView1"" style=""height:50px;width:125px;background-image:url(Blue_hills.jpg);"">
			<caption align=""Bottom"">
			Caption Test
			</caption><tr>
			<td>ID</td><td>1001</td>
			</tr><tr>
			<td>FName</td><td>Mahesh</td>
			</tr><tr>
			<td>LName</td><td>Chand</td>
			</tr>
			</table>
			</div>   
			 </div>";
			HtmlDiff.AssertAreEqual (origHtmlValue, newHtmlValue, "RenderDetailsViewProperties1");
			Assert.AreEqual (true,origHtmlValue.Contains (@"cellpadding=""30"""),"CellpaddingRender");
			Assert.AreEqual (true, origHtmlValue.Contains (@"cellspacing=""20"""), "CellspacingRender");
			Assert.AreEqual (true, origHtmlValue.Contains ("Caption Test"), "CaptionRender");
			Assert.AreEqual (true, origHtmlValue.Contains (@"caption align=""Bottom"""), "CaptionalignRender");
			Assert.AreEqual (true, origHtmlValue.Contains ("Blue_hills.jpg"), "BackImageRender");
			//GridLines and HorizontalAlign were set but can not be shown in this rendering.
		}
Ejemplo n.º 23
0
		public void ExtraTitlesRenderTest ()
		{
			string html = new WebTest (PageInvoker.CreateOnLoad (
				new PageDelegate (ExtraTitlesRenderTestInit))).Run ();

			Assert.IsTrue (html.IndexOf ("PasswordHintText") > 0, "PasswordHintText");
			Assert.IsTrue (html.IndexOf ("InstructionText") > 0, "InstructionText");
			Assert.IsTrue (html.IndexOf ("http://www.HelpPageUrl.com") > 0, "HelpPageUrl");
			Assert.IsTrue (html.IndexOf ("HelpPageText") > 0, "HelpPageText");
			Assert.IsTrue (html.IndexOf ("http://www.HelpPageIconUrl.com") > 0, "HelpPageIconUrl");
			Assert.IsTrue (html.IndexOf ("CreateUserButtonText") > 0, "CreateUserButtonText");
			Assert.IsTrue (html.IndexOf ("CreateUserStep.Title") > 0, "CreateUserStep.Title");
		}
Ejemplo n.º 24
0
		public void Theme_SetThemeException ()
		{
			string page=new WebTest (PageInvoker.CreateOnPreInit (SetThemeExeption)).Run ();
			Assert.IsTrue (page.IndexOf("System.Web.HttpException") >= 0, "System.Web.HttpException was expected, actual result: "+page);
		}
Ejemplo n.º 25
0
		public void ButtonsRenderTest ()
		{
			string html = new WebTest (PageInvoker.CreateOnLoad (
				new PageDelegate (ButtonsRenderTestInit))).Run ();

			Assert.IsTrue (html.IndexOf ("Pink;") > 0, "CreateUserButtonStyle");
			Assert.IsTrue (html.IndexOf ("14px") > 0, "CreateUserButtonStyle");
			Assert.IsTrue (html.IndexOf ("CreateUserButtonText") > 0, "CreateUserButtonText");
		}
		public void BasicRenderTest ()
		{
			string html = new WebTest (PageInvoker.CreateOnLoad (
				new PageDelegate (BasicRenderTestInit))).Run ();

			int st = 0;
			Assert.IsTrue ((st = html.IndexOf ("<table", st)) > 0, "base render test 1");
			Assert.IsTrue ((st = html.IndexOf ("ChangePassword1", st)) > 0, "base render test 2");
			Assert.IsTrue ((st = html.IndexOf ("border-collapse:collapse", st)) > 0, "base render test 3");
			Assert.IsTrue ((st = html.IndexOf ("<table", st)) > 0, "base render test 4");
			Assert.IsTrue ((st = html.IndexOf ("Change Your Password", st)) > 0, "base render test 5");
			Assert.IsTrue ((st = html.IndexOf ("User Name:", st)) > 0, "base render test 6");
			Assert.IsTrue ((st = html.IndexOf ("Password:"******"base render test 7");
			Assert.IsTrue ((st = html.IndexOf ("New Password:"******"base render test 8");
			Assert.IsTrue ((st = html.IndexOf ("Change Password", st)) > 0, "base render test 9");
		}