本文整理汇总了C#中MonoTests.SystemWeb.Framework.WebTest.Substring方法的典型用法代码示例。如果您正苦于以下问题:C# WebTest.Substring方法的具体用法?C# WebTest.Substring怎么用?C# WebTest.Substring使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MonoTests.SystemWeb.Framework.WebTest
的用法示例。
在下文中一共展示了WebTest.Substring方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DetailsView_EditFieldsRender
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> </td><td><a></a></td>
</tr><tr>
<td>Image field</td><td></td>
</tr><tr>
<td> </td><td></td>
</tr><tr>
<td>Template Field</td><td style=""background-color:#FFE0C0;""> </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");
}
示例2: DetailsView_AssignedPropertiesRender
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.
}
示例3: DetailsView_RenderHeaderTemplate
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");
}
示例4: DetailsView_PagerTemplateRender
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");
}
示例5: DetailsView_FooterTemplateRender
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");
}
示例6: FormView_Render
//#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");
}
示例7: FormView_RenderWithHeader
//#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");
}
示例8: FormView_RenderFooterAndPager
//#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");
}
示例9: FormView_RenderSimpleTemplate
//#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 = @" <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");
}