public void CheckBoxList_Bug377703_1()
        {
            WebTest t = new WebTest("CheckBoxList_Bug377703_1.aspx");

            t.Invoker = PageInvoker.CreateOnInit(CheckBoxList_Bug377703_1_OnInit);
            string origHtmlFirst  = "<table id=\"cbxl1\">\r\n\t<tr>\r\n\t\t<td><input id=\"cbxl1_0\" type=\"checkbox\" name=\"cbxl1$0\" value=\"x\" /><label for=\"cbxl1_0\">x</label></td>\r\n\t</tr><tr>\r\n\t\t<td><input id=\"cbxl1_1\" type=\"checkbox\" name=\"cbxl1$1\" value=\"y\" /><label for=\"cbxl1_1\">y</label></td>\r\n\t</tr><tr>\r\n\t\t<td><input id=\"cbxl1_2\" type=\"checkbox\" name=\"cbxl1$2\" value=\"z\" /><label for=\"cbxl1_2\">z</label></td>\r\n\t</tr>\r\n</table>";
            string origHtmlSecond = "<table id=\"cbxl1\">\r\n\t<tr>\r\n\t\t<td><input id=\"cbxl1_0\" type=\"checkbox\" name=\"cbxl1$0\" checked=\"checked\" value=\"x\" /><label for=\"cbxl1_0\">x</label></td>\r\n\t</tr><tr>\r\n\t\t<td><input id=\"cbxl1_1\" type=\"checkbox\" name=\"cbxl1$1\" value=\"y\" /><label for=\"cbxl1_1\">y</label></td>\r\n\t</tr><tr>\r\n\t\t<td><input id=\"cbxl1_2\" type=\"checkbox\" name=\"cbxl1$2\" value=\"z\" /><label for=\"cbxl1_2\">z</label></td>\r\n\t</tr>\r\n</table>";
            string html           = t.Run();
            string listHtml       = HtmlDiff.GetControlFromPageHtml(html);

            HtmlDiff.AssertAreEqual(origHtmlFirst, listHtml, "#A1");

            FormRequest fr = new FormRequest(t.Response, "form1");

            fr.Controls.Add("cbxl1$0");
            fr.Controls ["cbxl1$0"].Value = "x";
            fr.Controls.Add("ctl01");
            fr.Controls ["ctl01"].Value = "Click me twice to have the first Item become empty";

            t.Request = fr;
            html      = t.Run();

            fr = new FormRequest(t.Response, "form1");
            fr.Controls.Add("cbxl1$0");
            fr.Controls ["cbxl1$0"].Value = "x";
            fr.Controls.Add("ctl01");
            fr.Controls ["ctl01"].Value = "Click me twice to have the first Item become empty";

            t.Request = fr;
            html      = t.Run();

            listHtml = HtmlDiff.GetControlFromPageHtml(html);
            HtmlDiff.AssertAreEqual(origHtmlSecond, listHtml, "#A2");
        }
		public void Render ()
		{
			string RenderedPageHtml = new WebTest (PageInvoker.CreateOnLoad (Render_Load)).Run ();
			string RenderedControlHtml = HtmlDiff.GetControlFromPageHtml (RenderedPageHtml);
			string OriginControlHtml = "<table id=\"ctl01\">\r\n\t<tr>\r\n\t\t<td><input id=\"ctl01_0\" type=\"radio\" name=\"ctl01\" value=\"value1\" /><label for=\"ctl01_0\">text2</label></td>\r\n\t</tr>\r\n</table>";
			HtmlDiff.AssertAreEqual (OriginControlHtml, RenderedControlHtml, "Render");
		}
Exemple #3
0
        public void Bug_535701_1()
        {
            string originalHtml_1 = @"<span id=""ListViewTest"">
        0 1 2 3 4 5 6 7 8 9 
        </span>
        <span id=""DataPager1""><a disabled=""disabled"">First</a>&nbsp;<a disabled=""disabled"">Previous</a>&nbsp;<span>1</span>&nbsp;<a href=""javascript:__doPostBack('DataPager1$ctl01$ctl01','')"">2</a>&nbsp;<a href=""javascript:__doPostBack('DataPager1$ctl02$ctl00','')"">Next</a>&nbsp;<a href=""javascript:__doPostBack('DataPager1$ctl02$ctl01','')"">Last</a>&nbsp;</span>";
            string originalHtml_2 = @"<span id=""ListViewTest"">
        10 11 12 
        </span>
        <span id=""DataPager1""><a href=""javascript:__doPostBack('DataPager1$ctl00$ctl00','')"">First</a>&nbsp;<a href=""javascript:__doPostBack('DataPager1$ctl00$ctl01','')"">Previous</a>&nbsp;<a href=""javascript:__doPostBack('DataPager1$ctl01$ctl00','')"">1</a>&nbsp;<span>2</span>&nbsp;<a disabled=""disabled"">Next</a>&nbsp;<a disabled=""disabled"">Last</a>&nbsp;</span>";

            WebTest t            = new WebTest("ListViewTotalRowCount_Bug535701_1.aspx");
            string  pageHtml     = t.Run();
            string  renderedHtml = HtmlDiff.GetControlFromPageHtml(pageHtml);

            Assert.AreEqual(originalHtml_1, renderedHtml, "#A1");

            FormRequest fr = new FormRequest(t.Response, "form1");

            fr.Controls.Add("__EVENTTARGET");
            fr.Controls ["__EVENTTARGET"].Value = "DataPager1$ctl01$ctl01";
            t.Request = fr;

            pageHtml     = t.Run();
            renderedHtml = HtmlDiff.GetControlFromPageHtml(pageHtml);

            Assert.AreEqual(originalHtml_2, renderedHtml, "#A2");
        }
Exemple #4
0
        public void CheckBoxList_Bug578770()
        {
            WebTest t = new WebTest("CheckBoxList_Bug578770.aspx");

            t.Invoker = PageInvoker.CreateOnInit(CheckBoxList_Bug578770_OnInit);
            string origHtml = @"<table id=""test"" border=""0"">

	<tr>
		<td><span disabled=""disabled""><input id=""test_0"" type=""checkbox"" name=""test$0"" disabled=""disabled"" /><label for=""test_0"">Sun</label></span></td>
	</tr><tr>
		<td><input id=""test_1"" type=""checkbox"" name=""test$1"" /><label for=""test_1"">Mon</label></td>
	</tr><tr>
		<td><input id=""test_2"" type=""checkbox"" name=""test$2"" /><label for=""test_2"">Tue</label></td>
	</tr><tr>

		<td><input id=""test_3"" type=""checkbox"" name=""test$3"" /><label for=""test_3"">Wed</label></td>
	</tr><tr>
		<td><input id=""test_4"" type=""checkbox"" name=""test$4"" /><label for=""test_4"">Thu</label></td>
	</tr><tr>
		<td><input id=""test_5"" type=""checkbox"" name=""test$5"" /><label for=""test_5"">Fri</label></td>
	</tr><tr>
		<td><input id=""test_6"" type=""checkbox"" name=""test$6"" /><label for=""test_6"">Sat</label></td>

	</tr>
</table>";
            string html     = t.Run();
            string listHtml = HtmlDiff.GetControlFromPageHtml(html);

            HtmlDiff.AssertAreEqual(origHtml, listHtml, "#A1");
        }
Exemple #5
0
        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");
            }
        }
Exemple #6
0
        public void ImageField_ConvertEmptyStringToNull()
        {
            WebTest       t  = new WebTest();
            PageDelegates pd = new PageDelegates();

            pd.PreRender = _ConvertEmptyStringToNull;
            t.Invoker    = new PageInvoker(pd);
            string htmlPage    = t.Run();
            string htmlOrigin  = @"<div>
						<table cellspacing=""0"" rules=""all"" border=""1"" style=""border-collapse:collapse;"">
							<tr>
								<th scope=""col"">Data</th><th scope=""col"">Field</th>
							</tr><tr>
								<td><img src="""" style=""border-width:0px;"" /></td><td>&nbsp;</td>
							</tr><tr>
								<td><img src="""" style=""border-width:0px;"" /></td><td>&nbsp;</td>
							</tr><tr>
								<td><img src="""" style=""border-width:0px;"" /></td><td>&nbsp;</td>
							</tr><tr>
								<td><img src="""" style=""border-width:0px;"" /></td><td>&nbsp;</td>
							</tr><tr>
								<td><img src="""" style=""border-width:0px;"" /></td><td>&nbsp;</td>
							</tr>
						</table>
					</div>"                    ;
            string htmlControl = HtmlDiff.GetControlFromPageHtml(htmlPage);

            HtmlDiff.AssertAreEqual(htmlOrigin, htmlControl, "ConvertEmptyStringToNull");
        }
Exemple #7
0
        public void ImageField_NullDisplayText()
        {
            WebTest       t  = new WebTest();
            PageDelegates pd = new PageDelegates();

            pd.PreRender = _ImageFieldNullText;
            t.Invoker    = new PageInvoker(pd);

            string htmlPage    = t.Run();
            string htmlOrigin  = @"<div>
						<table cellspacing=""0"" rules=""all"" border=""1"" style=""border-collapse:collapse;"">
							<tr>
								<th scope=""col"">Data</th><th scope=""col"">Field</th>
							</tr><tr>
								<td><span>NullDisplayText</span></td><td>&nbsp;</td>
							</tr><tr>
								<td><span>NullDisplayText</span></td><td>&nbsp;</td>
							</tr><tr>
								<td><span>NullDisplayText</span></td><td>&nbsp;</td>
							</tr><tr>
								<td><span>NullDisplayText</span></td><td>&nbsp;</td>
							</tr><tr>
								<td><span>NullDisplayText</span></td><td>&nbsp;</td>
							</tr>
						</table>
					</div>"                    ;
            string htmlControl = HtmlDiff.GetControlFromPageHtml(htmlPage);

            HtmlDiff.AssertAreEqual(htmlOrigin, htmlControl, "ImageFieldNullText");
        }
Exemple #8
0
        public void CheckBoxField_Bug595568_7()
        {
            string originalHtml = @"<div> 
	<table id=""gridView"" cellspacing=""0"" rules=""all"" border=""1"" style=""border-collapse:collapse;""> 
			<tr> 
				<th scope=""col"">&nbsp;</th> 
			</tr><tr> 
				<td><input id=""gridView_ctl02_ctl00"" type=""checkbox"" name=""gridView$ctl02$ctl00"" /><select size=""4""> 
 
				</select></td> 
			</tr><tr> 
				<td><input id=""gridView_ctl03_ctl00"" type=""checkbox"" name=""gridView$ctl03$ctl00"" /><select size=""4""> 
 
				</select></td> 
			</tr><tr> 
				<td><input id=""gridView_ctl04_ctl00"" type=""checkbox"" name=""gridView$ctl04$ctl00"" /><select size=""4""> 
 
				</select></td> 
			</tr> 
		</table> 
	</div>"    ;

            WebTest t            = new WebTest("CheckBoxField_Bug595568_7.aspx");
            string  pageHtml     = t.Run();
            string  renderedHtml = HtmlDiff.GetControlFromPageHtml(pageHtml);

            HtmlDiff.AssertAreEqual(originalHtml, renderedHtml, "#A1");
        }
Exemple #9
0
        public void ImageField_GetFormattedAlternateText()
        {
            WebTest       t  = new WebTest();
            PageDelegates pd = new PageDelegates();

            pd.PreRender = _ImageFieldInit;
            t.Invoker    = new PageInvoker(pd);

            string htmlPage    = t.Run();
            string htmlOrigin  = @"<div>
						<table cellspacing=""0"" rules=""all"" border=""1"" id=""Grid"" style=""border-collapse:collapse;"">
							<tr>
								<th scope=""col"">Data</th>
							</tr><tr>
								<td><img src=""Item%200"" alt=""Item: Item 0"" style=""border-width:0px;"" /></td>
							</tr><tr>
								<td><img src=""Item%201"" alt=""Item: Item 1"" style=""border-width:0px;"" /></td>
							</tr><tr>
								<td><img src=""Item%202"" alt=""Item: Item 2"" style=""border-width:0px;"" /></td>
							</tr><tr>
								<td><img src=""Item%203"" alt=""Item: Item 3"" style=""border-width:0px;"" /></td>
							</tr><tr>
								<td><img src=""Item%204"" alt=""Item: Item 4"" style=""border-width:0px;"" /></td>
							</tr>
						</table>
					</div>"                    ;
            string htmlControl = HtmlDiff.GetControlFromPageHtml(htmlPage);

            HtmlDiff.AssertAreEqual(htmlOrigin, htmlControl, "GetFormattedAlternateText");
        }
        public void Bug_535701_2()
        {
            string  originalHtml_1 = @"<span id=""ListViewTest2"">
        12345678910
        </span>
        <span id=""DataPager1""><a class=""aspNetDisabled"">First</a>&nbsp;<a class=""aspNetDisabled"">Previous</a>&nbsp;<span>1</span>&nbsp;<a href=""javascript:__doPostBack(&#39;DataPager1$ctl01$ctl01&#39;,&#39;&#39;)"">2</a>&nbsp;<a href=""javascript:__doPostBack(&#39;DataPager1$ctl02$ctl00&#39;,&#39;&#39;)"">Next</a>&nbsp;<a href=""javascript:__doPostBack(&#39;DataPager1$ctl02$ctl01&#39;,&#39;&#39;)"">Last</a>&nbsp;</span>
            
        <br /><div>
        DataPager.TotalRowCount = 14<br />
        Actual TotalRowCount = 14</div>";
            string  originalHtml_2 = @"<span id=""ListViewTest2"">
        11121314
        </span>
        <span id=""DataPager1""><a href=""javascript:__doPostBack(&#39;DataPager1$ctl00$ctl00&#39;,&#39;&#39;)"">First</a>&nbsp;<a href=""javascript:__doPostBack(&#39;DataPager1$ctl00$ctl01&#39;,&#39;&#39;)"">Previous</a>&nbsp;<a href=""javascript:__doPostBack(&#39;DataPager1$ctl01$ctl00&#39;,&#39;&#39;)"">1</a>&nbsp;<span>2</span>&nbsp;<a class=""aspNetDisabled"">Next</a>&nbsp;<a class=""aspNetDisabled"">Last</a>&nbsp;</span>
            
        <br /><div>
        DataPager.TotalRowCount = 14<br />
        Actual TotalRowCount = 14</div>";
            WebTest t            = new WebTest("ListViewTotalRowCount_Bug535701_2.aspx");
            string  pageHtml     = t.Run();
            string  renderedHtml = HtmlDiff.GetControlFromPageHtml(pageHtml);

            Assert.AreEqual(originalHtml_1.Replace("\r\n", "\n"), renderedHtml, "#A1");

            FormRequest fr = new FormRequest(t.Response, "form1");

            fr.Controls.Add("__EVENTTARGET");
            fr.Controls ["__EVENTTARGET"].Value = "DataPager1$ctl01$ctl01";
            t.Request = fr;

            pageHtml     = t.Run();
            renderedHtml = HtmlDiff.GetControlFromPageHtml(pageHtml);

            Assert.AreEqual(originalHtml_2.Replace("\r\n", "\n"), renderedHtml, "#A2");
        }
Exemple #11
0
        [Category("NotWorking")]          // File watcher is not supported
#endif
        public void Save()
        {
            string origin = @"<div>
						<h2>BookStore</h2><hr>
						<table>
						  <tr>
						    <td>Book</td>
						    <td><font color=""blue"">ThisIsATest</font></td>
						    <td></td>
						    <td></td>
						    <td>24.95</td>
						  </tr>
						</table><hr>
						<h2>BookStore</h2><hr>
						<table>
						  <tr>
						    <td>Book</td>
						    <td><font color=""blue"">The Handmaid's Tale</font></td>
						    <td></td>
						    <td></td>
						    <td>29.95</td>
						  </tr>
						</table><hr></div>"                        ;
            string result = new WebTest("XMLDataSourceTest4.aspx").Run();

            HtmlDiff.AssertAreEqual(origin, HtmlDiff.GetControlFromPageHtml(result), "TransformArgumentListFail");
        }
Exemple #12
0
        public void StateFormatter_CollectionFormatter()
        {
            WebTest t = new WebTest("StateFormatter_CollectionConverter.aspx");

            t.Run();

            var fr = new FormRequest(t.Response, "form1");

            fr.Controls.Add("btnSearch");
            fr.Controls.Add("ddlDate");
            fr.Controls.Add("txtSearchValue");

            fr.Controls ["btnSearch"].Value = "Search";
            fr.Controls ["ddlDate"].Value   = "2009";

            t.Request = fr;
            string pageHtml     = t.Run();
            string renderedHtml = HtmlDiff.GetControlFromPageHtml(pageHtml);
            string originalHtml = @"<div>

		<table id=""gvECCN"" cellspacing=""0"" rules=""all"" border=""1"" style=""border-collapse:collapse;"">
				<tr>
					<th align=""left"" scope=""col"">&nbsp;</th><th align=""left"" scope=""col"">Schedule B</th><th align=""left"" scope=""col"">Count</th><th align=""left"" scope=""col"">Total</th><th align=""left"" scope=""col"">Percent</th>
				</tr><tr>
					<td style=""height:18px;width:30px;"">1</td><td style=""width:140px;"">test</td><td style=""width:90px;"">1</td><td style=""width:100px;"">100</td><td style=""width:90px;"">250.00 %</td>

				</tr>
			</table>
		</div>"        ;

            HtmlDiff.AssertAreEqual(originalHtml, renderedHtml, "#A1");
        }
Exemple #13
0
        public void SiteMapPath_DefaultRender()
        {
            string RenderedPageHtml    = new WebTest(PageInvoker.CreateOnLoad(DoTestDefaultRender)).Run();
            string RenderedControlHtml = HtmlDiff.GetControlFromPageHtml(RenderedPageHtml);
            string OriginControlHtml   = "<span><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><span><a title=\"test\" href=\"/NunitWeb/MyPageWithMaster.aspx\">root</a></span><span> &gt; </span><span>node1</span><a id=\"ctl01_SkipLink\"></a></span>";

            HtmlDiff.AssertAreEqual(OriginControlHtml, RenderedControlHtml, "RenderDefault");
        }
Exemple #14
0
        public void SiteMapPath_RenderProperty()
        {
            string RenderedPageHtml    = new WebTest(PageInvoker.CreateOnLoad(DoTestPropertyRender)).Run();
            string RenderedControlHtml = HtmlDiff.GetControlFromPageHtml(RenderedPageHtml);
            string OriginControlHtml   = "<span style=\"display:inline-block;color:Red;background-color:Red;border-color:Red;border-width:3px;border-style:Dashed;\"><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><span>node1</span><span>-</span><span><a title=\"test\" href=\"/NunitWeb/MyPageWithMaster.aspx\">root</a></span><a id=\"ctl01_SkipLink\"></a></span>";

            HtmlDiff.AssertAreEqual(OriginControlHtml, RenderedControlHtml, "RenderProperty");
        }
Exemple #15
0
        public void GlobalizationEncodingName()
        {
            string pageHtml     = new WebTest("GlobalizationEncodingName.aspx").Run();
            string renderedHtml = HtmlDiff.GetControlFromPageHtml(pageHtml);
            string originalHtml = "GOOD";

            Assert.AreEqual(originalHtml, renderedHtml, "#A1");
        }
Exemple #16
0
        [Category("NotWorking")]         // https://github.com/mono/mono/issues/7568
        public void GlobalResourcesLocalization()
        {
            string pageHtml     = new WebTest("GlobalResourcesLocalization.aspx").Run();
            string renderedHtml = HtmlDiff.GetControlFromPageHtml(pageHtml);
            string originalHtml = "<input type=\"submit\" name=\"button1\" value=\"Recharger\" id=\"button1\" />";

            HtmlDiff.AssertAreEqual(originalHtml, renderedHtml, "#A1");
        }
        public void TreeNode_Render()
        {
            WebTest t         = new WebTest(PageInvoker.CreateOnLoad(pageLoadRender));
            string  strTarget = "<a href=\"#treeview1_SkipLink\"><img alt=\"Skip Navigation Links.\" src=\"/NunitWeb/WebResource.axd?d=8VpphgAbakKUC_J8R6hR0Q2&amp;t=634067491135766272\" width=\"0\" height=\"0\" style=\"border-width:0px;\" /></a><div id=\"treeview1\">\r\n\t<table cellpadding=\"0\" cellspacing=\"0\" style=\"border-width:0;\">\r\n\t\t<tr>\r\n\t\t\t<td><a href=\"javascript:__doPostBack(&#39;treeview1&#39;,&#39;tvalue&#39;)\"><img src=\"/NunitWeb/WebResource.axd?d=Me-CdxEHiTTT3lXTDd0I2qLe7WfoYyDfWfVSkV5Suzs1&amp;t=634067491135766272\" alt=\"Collapse text\" style=\"border-width:0;\" /></a></td><td><a href=\"navigateUrl\" target=\"target\" title=\"ToolTip\" id=\"treeview1t0i\" tabindex=\"-1\"><img src=\"imageUrl\" alt=\"ImageToolTip\" style=\"border-width:0;\" /></a></td><td style=\"white-space:nowrap;\"><input type=\"checkbox\" name=\"treeview1n0CheckBox\" id=\"treeview1n0CheckBox\" checked=\"checked\" title=\"ToolTip\" /><a class=\"treeview1_0\" href=\"navigateUrl\" target=\"target\" title=\"ToolTip\" id=\"treeview1t0\">text</a></td>\r\n\t\t</tr>\r\n\t</table><table cellpadding=\"0\" cellspacing=\"0\" style=\"border-width:0;\">\r\n\t\t<tr>\r\n\t\t\t<td><div style=\"width:20px;height:1px\"></div></td><td><img src=\"/NunitWeb/WebResource.axd?d=Me-CdxEHiTTT3lXTDd0I2ilpe6vhhhJjssENmbNkrSY1&amp;t=634067491135766272\" alt=\"\" /></td><td style=\"white-space:nowrap;\"><a class=\"treeview1_0\" href=\"javascript:__doPostBack(&#39;treeview1&#39;,&#39;svalue\\\\childenode&#39;)\" id=\"treeview1t1\">childenode</a></td>\r\n\t\t</tr>\r\n\t</table>\r\n</div><a id=\"treeview1_SkipLink\"></a>";
            string  str       = HtmlDiff.GetControlFromPageHtml(t.Run());

            HtmlDiff.AssertAreEqual(strTarget, str, "Render");
        }
Exemple #18
0
        public void NewlineInCodeExpression()
        {
            string pageHtml     = new WebTest("NewlineInCodeExpression.aspx").Run();
            string renderedHtml = HtmlDiff.GetControlFromPageHtml(pageHtml);
            string originalHtml = "<a href=\"test\">bla</a>";

            HtmlDiff.AssertAreEqual(originalHtml, renderedHtml, "#A1");
        }
Exemple #19
0
        public void ServerSideControlsInScriptBlock()
        {
            string pageHtml     = new WebTest("ServerSideControlsInScriptBlock.aspx").Run();
            string renderedHtml = HtmlDiff.GetControlFromPageHtml(pageHtml);
            string originalHtml = @"<script type=""text/javascript"">alert (escape(""reporting/location?report=ViewsByDate&minDate=minDate&maxDate=maxDate""));</script>";

            HtmlDiff.AssertAreEqual(originalHtml, renderedHtml, "#A1");
        }
Exemple #20
0
        public void LinkInHeadWithEmbeddedExpression()
        {
            string pageHtml     = new WebTest("LinkInHeadWithEmbeddedExpression.aspx").Run();
            string renderedHtml = HtmlDiff.GetControlFromPageHtml(pageHtml);
            string originalHtml = "<link href=\"Themes/Default/Content/Site.css\" rel=\"stylesheet\" type=\"text/css\" />";

            HtmlDiff.AssertAreEqual(originalHtml, renderedHtml, "#A1");
        }
Exemple #21
0
        public void NoBindForMethodsWithBindInNameTest()
        {
            string pageHtml     = new WebTest("NoBindForMethodsWithBindInName.aspx").Run();
            string renderedHtml = HtmlDiff.GetControlFromPageHtml(pageHtml);
            string originalHtml = "<span id=\"grid_ctl02_lblTest\">Test</span>";

            HtmlDiff.AssertAreEqual(originalHtml, renderedHtml, "#A1");
        }
Exemple #22
0
        public void OneLetterIdentifierInCodeRender()
        {
            string pageHtml     = new WebTest("OneLetterIdentifierInCodeRender.aspx").Run();
            string renderedHtml = HtmlDiff.GetControlFromPageHtml(pageHtml);
            string originalHtml = @"bDoR called";

            HtmlDiff.AssertAreEqual(originalHtml, renderedHtml, "#A1");
        }
        public void TreeNode_NavigateUrl()
        {
            WebTest t         = new WebTest(PageInvoker.CreateOnLoad(pageLoadNavigateUrl));
            string  strTarget = "<a href=\"#treeview1_SkipLink\"><img alt=\"Skip Navigation Links.\" src=\"/NunitWeb/WebResource.axd?d=8VpphgAbakKUC_J8R6hR0Q2&amp;t=634067491135766272\" width=\"0\" height=\"0\" style=\"border-width:0px;\" /></a><div id=\"treeview1\">\r\n\t<table cellpadding=\"0\" cellspacing=\"0\" style=\"border-width:0;\">\r\n\t\t<tr>\r\n\t\t\t<td><img src=\"/NunitWeb/WebResource.axd?d=Me-CdxEHiTTT3lXTDd0I2ilpe6vhhhJjssENmbNkrSY1&amp;t=634067491135766272\" alt=\"\" /></td><td style=\"white-space:nowrap;\"><a class=\"treeview1_0\" href=\"NavigateUrl\" id=\"treeview1t0\">TreeNode1</a></td>\r\n\t\t</tr>\r\n\t</table>\r\n</div><a id=\"treeview1_SkipLink\"></a>";
            string  str       = HtmlDiff.GetControlFromPageHtml(t.Run());

            HtmlDiff.AssertAreEqual(strTarget, str, "PostbackNavigate");
        }
Exemple #24
0
        public void BoundField_NullValueRender()
        {
            string html     = new WebTest(PageInvoker.CreateOnLoad(new PageDelegate(BasicRenderTestInit))).Run();
            string orightml = "<div>\r\n\t<table cellspacing=\"0\" rules=\"all\" border=\"1\" style=\"border-collapse:collapse;\">\r\n\t\t<tr>\r\n\t\t\t<th scope=\"col\">&nbsp;</th><th scope=\"col\">&nbsp;</th>\r\n\t\t</tr><tr>\r\n\t\t\t<td>Norway</td><td>Norway</td>\r\n\t\t</tr><tr>\r\n\t\t\t<td>Sweden</td><td>Sweden</td>\r\n\t\t</tr><tr>\r\n\t\t\t<td>EMPTY</td><td>&nbsp;</td>\r\n\t\t</tr><tr>\r\n\t\t\t<td>Italy</td><td>Italy</td>\r\n\t\t</tr>\r\n\t</table>\r\n</div>";

            html = HtmlDiff.GetControlFromPageHtml(html);
            HtmlDiff.AssertAreEqual(orightml, html, "NullValueRender");
        }
        public void HtmlTitleCodeRender_Bug662918()
        {
            string origHtml     = "<head><title>\r\n\tTitle text\r\n</title></head>";
            string pageHtml     = new WebTest("HtmlTitleCodeRender_Bug662918.aspx").Run();
            string renderedHtml = HtmlDiff.GetControlFromPageHtml(pageHtml);

            HtmlDiff.AssertAreEqual(origHtml, renderedHtml, "#A1");
        }
        public void Bug_604053()
        {
            string  originalHtml = "<span id=\"Bug604053ListView1\"><table id=\"Bug604053ListView1_itemPlaceholderContainer\" border=\"0\" style=\"\"><tr style=\"\"><th>\n\t\t\t\t\t\t\t\t\t\t\tM1</th><th>\n\t\t\t\t\t\t\t\t\t\t\tM2</th>\r\n\t</tr>\n\t\t\t\t\t<tr style=\"\">\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t<span id=\"Bug604053ListView1_ctl10_M1Label_0\">0</span>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t<span id=\"Bug604053ListView1_ctl10_M2Label_0\">0</span>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\r\n\t\t\n\t\t\t\t\t<tr style=\"\">\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t<span id=\"Bug604053ListView1_ctl12_M1Label_1\">1</span>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t<span id=\"Bug604053ListView1_ctl12_M2Label_1\">1</span>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\r\n\r\n\r\n</table>\r\n\n\t\t\t\t\t<table><tr><td>\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t</td>\r\n\t</tr><tr><td style=\"\">\n\t\t\t\t\t\t\t\t<span id=\"Bug604053ListView1_DataPager1\"><input type=\"submit\" name=\"Bug604053ListView1$DataPager1$ctl00$ctl00\" value=\"First\" disabled=\"disabled\" />&nbsp;<span>1</span>&nbsp;<a href=\"javascript:__doPostBack(&#39;Bug604053ListView1$DataPager1$ctl01$ctl01&#39;,&#39;&#39;)\">2</a>&nbsp;<a href=\"javascript:__doPostBack(&#39;Bug604053ListView1$DataPager1$ctl01$ctl02&#39;,&#39;&#39;)\">3</a>&nbsp;<a href=\"javascript:__doPostBack(&#39;Bug604053ListView1$DataPager1$ctl01$ctl03&#39;,&#39;&#39;)\">4</a>&nbsp;<a href=\"javascript:__doPostBack(&#39;Bug604053ListView1$DataPager1$ctl01$ctl04&#39;,&#39;&#39;)\">5</a>&nbsp;<input type=\"submit\" name=\"Bug604053ListView1$DataPager1$ctl02$ctl00\" value=\"Last\" />&nbsp;</span>\n\t\t\t\t\t\t\t</td>\r\n\t</tr>\r\n\r\n</table>\r\n\n\t\t\t\t</span>\n\t\t\t<span id=\"Bug604053ListView2\"><table id=\"Bug604053ListView2_itemPlaceholderContainer\" border=\"0\" style=\"\"><tr style=\"\"><th>\n\t\t\t\t\t\t\t\t\t\t\tM1</th><th>\n\t\t\t\t\t\t\t\t\t\t\tM2</th>\r\n\t</tr>\n\t\t\t\t\t<tr style=\"\">\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t<span id=\"Bug604053ListView2_ctl10_M1Label_0\">0</span>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t<span id=\"Bug604053ListView2_ctl10_M2Label_0\">0</span>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\r\n\t\t\n\t\t\t\t\t<tr style=\"\">\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t<span id=\"Bug604053ListView2_ctl12_M1Label_1\">1</span>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t<span id=\"Bug604053ListView2_ctl12_M2Label_1\">1</span>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\r\n\r\n\r\n</table>\r\n\n\t\t\t\t\t<table><tr><td>\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t</td>\r\n\t</tr><tr><td style=\"\">\n\t\t\t\t\t\t\t\t<span id=\"Bug604053ListView2_DataPager1\"><input type=\"submit\" name=\"Bug604053ListView2$DataPager1$ctl00$ctl00\" value=\"First\" disabled=\"disabled\" />&nbsp;<input type=\"submit\" name=\"Bug604053ListView2$DataPager1$ctl00$ctl01\" value=\"Previous\" disabled=\"disabled\" />&nbsp;<input type=\"submit\" name=\"Bug604053ListView2$DataPager1$ctl00$ctl02\" value=\"Next\" />&nbsp;<input type=\"submit\" name=\"Bug604053ListView2$DataPager1$ctl00$ctl03\" value=\"Last\" />&nbsp;</span>\n\t\t\t\t\t\t\t</td>\r\n\t</tr>\r\n\r\n</table>\r\n\n\t\t\t\t</span>";
            WebTest t            = new WebTest("ListViewTotalRowCount_Bug604053.aspx");
            string  pageHtml     = t.Run();
            string  renderedHtml = HtmlDiff.GetControlFromPageHtml(pageHtml);

            Assert.AreEqual(originalHtml, renderedHtml, "#A1");
        }
Exemple #27
0
        public void CheckBoxField_Bug595568_7()
        {
            string  originalHtml = "<div>\r\n\t<table cellspacing=\"0\" rules=\"all\" border=\"1\" id=\"gridView\" style=\"border-collapse:collapse;\">\r\n\t\t<tr>\r\n\t\t\t<th scope=\"col\">&nbsp;</th>\r\n\t\t</tr><tr>\r\n\t\t\t<td><input id=\"gridView_ctl00_0\" type=\"checkbox\" name=\"gridView$ctl02$ctl00\" /><select size=\"4\" name=\"gridView$ctl02$ctl01\">\r\n\r\n\t\t\t</select></td>\r\n\t\t</tr><tr>\r\n\t\t\t<td><input id=\"gridView_ctl00_1\" type=\"checkbox\" name=\"gridView$ctl03$ctl00\" /><select size=\"4\" name=\"gridView$ctl03$ctl01\">\r\n\r\n\t\t\t</select></td>\r\n\t\t</tr><tr>\r\n\t\t\t<td><input id=\"gridView_ctl00_2\" type=\"checkbox\" name=\"gridView$ctl04$ctl00\" /><select size=\"4\" name=\"gridView$ctl04$ctl01\">\r\n\r\n\t\t\t</select></td>\r\n\t\t</tr>\r\n\t</table>\r\n</div>";
            WebTest t            = new WebTest("CheckBoxField_Bug595568_7.aspx");
            string  pageHtml     = t.Run();
            string  renderedHtml = HtmlDiff.GetControlFromPageHtml(pageHtml);

            HtmlDiff.AssertAreEqual(originalHtml, renderedHtml, "#A1");
        }
Exemple #28
0
        public void EnumConverter_Bug578586()
        {
            WebTest t            = new WebTest("EnumConverter_Bug578586.aspx");
            string  pageHtml     = t.Run();
            string  renderedHtml = HtmlDiff.GetControlFromPageHtml(pageHtml);
            string  originalHtml = @"<input type=""text"" value=""FlagOne"" name=""test"" id=""test"" />";

            HtmlDiff.AssertAreEqual(originalHtml, renderedHtml, "#A1");
        }
Exemple #29
0
        public void TagsNestedInClientTag()
        {
            string pageHtml     = new WebTest("TagsNestedInClientTag.aspx").Run();
            string renderedHtml = HtmlDiff.GetControlFromPageHtml(pageHtml);
            string originalHtml = @"<script language=""javascript"" src=""/js/test.js"" type=""text/javascript""></script>
<sometag language=""javascript"" src=""/js/test.js"" type=""text/javascript""></sometag>";

            HtmlDiff.AssertAreEqual(originalHtml, renderedHtml, "#A1");
        }
Exemple #30
0
        public void ButtonColor_Bug325489()
        {
            WebTest t            = new WebTest("ButtonColor_Bug325489.aspx");
            string  origHtml     = @"<input type=""submit"" name=""button1"" value="""" id=""button1"" style=""background-color:#316AC5;"" />";
            string  html         = t.Run();
            string  renderedHtml = HtmlDiff.GetControlFromPageHtml(html);

            HtmlDiff.AssertAreEqual(origHtml, renderedHtml, "#A1");
        }