本文整理汇总了C#中MonoTests.SystemWeb.Framework.WebTest.IndexOf方法的典型用法代码示例。如果您正苦于以下问题:C# WebTest.IndexOf方法的具体用法?C# WebTest.IndexOf怎么用?C# WebTest.IndexOf使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MonoTests.SystemWeb.Framework.WebTest
的用法示例。
在下文中一共展示了WebTest.IndexOf方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: UrlPropertyTest
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);
}
示例2: TitlesRenderTest
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");
}
示例3: Theme_EnableThemingChild
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");
}
示例4: TitlesRenderTest
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");
}
示例5: StylesRenderTest
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");
}
示例6: BasicRenderTest
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");
}
示例7: ExtraTitlesRenderTest
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");
}
示例8: WizardStepBase_RenderTest
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&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('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_SideBarButton_1\" 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\" 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&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");
}
示例9: 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");
}
示例10: 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");
}
示例11: DuplicateControlsInClientComment
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");
}
示例12: 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");
}
示例13: 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");
}
示例14: 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");
}
示例15: MissingMasterFile
public void MissingMasterFile ()
{
string pageHtml = new WebTest ("MissingMasterFile.aspx").Run ();
Assert.IsTrue (pageHtml.IndexOf ("[System.Web.Compilation.ParseException]:") != -1, "#A1");
}