void Search_Test(string result, TestRunItem runItem) { string originalHtml = @"Search term is: <span id=""label1"">test</span><br /> Search term from expression is: <span id=""label2"">test</span><br /> <pre id=""testLog"">.: Missing key (key: 'SearchTermd') Returned null. .: Missing property (key: 'SearchTerm') Returned value of type 'System.String': test .: No converter (key: 'SearchTerm') Returned value of type 'System.String': test .: Valid conversion to target (key: 'SearchTerm') Exception 'System.FormatException' caught .: Invalid conversion to target (key: 'SearchTerm') Exception 'System.Exception' caught .: Complex type converter (key: 'SearchTerm') Exception 'System.Exception' caught .: Null controlType (key: 'SearchTerm') Returned value of type 'System.String': test .: Null propertyName (key: 'SearchTerm') Returned value of type 'System.String': test .: Empty propertyName (key: 'SearchTerm') Returned value of type 'System.String': test .: Non-string value (key: 'intValue') Returned value of type 'System.Int32': 123 .: Non-string value (key: 'boolValue') Returned value of type 'System.Boolean': False .: Non-string value (key: 'doubleValue') Returned value of type 'System.Double': 1,23 </pre>"; Helpers.ExtractAndCompareCodeFromHtml(result, originalHtml, "#A1"); }
void Default_Aspx (string result, TestRunItem runItem) { string originalHtml = @"<pre id=""log"">a: System.Web.UI.HtmlControls.HtmlAnchor button: System.Web.UI.HtmlControls.HtmlButton img: System.Web.UI.HtmlControls.HtmlImage link: System.Web.UI.HtmlControls.HtmlGenericControl meta: System.Web.UI.HtmlControls.HtmlGenericControl select: System.Web.UI.HtmlControls.HtmlSelect table: System.Web.UI.HtmlControls.HtmlTable td: System.Web.UI.HtmlControls.HtmlTableCell tr: System.Web.UI.HtmlControls.HtmlTableRow th: System.Web.UI.HtmlControls.HtmlTableCell textarea: System.Web.UI.HtmlControls.HtmlTextArea inputButton: System.Web.UI.HtmlControls.HtmlInputButton inputSubmit: System.Web.UI.HtmlControls.HtmlInputSubmit inputReset: System.Web.UI.HtmlControls.HtmlInputReset inputCheckbox: System.Web.UI.HtmlControls.HtmlInputCheckBox inputFile: System.Web.UI.HtmlControls.HtmlInputFile inputHidden: System.Web.UI.HtmlControls.HtmlInputHidden inputImage: System.Web.UI.HtmlControls.HtmlInputImage inputRadio: System.Web.UI.HtmlControls.HtmlInputRadioButton inputText: System.Web.UI.HtmlControls.HtmlInputText inputPassword: System.Web.UI.HtmlControls.HtmlInputPassword </pre>"; Helpers.ExtractAndCompareCodeFromHtml (result, originalHtml, "#A1"); }
void Default_AnotherInMemory_Aspx(string result, TestRunItem runItem) { string originalHtml = @"<pre id=""output"">Default provider name: AspNetInternalProvider Default context: TestAnotherInMemoryProvider </pre>"; Helpers.ExtractAndCompareCodeFromHtml(result, originalHtml, "#A1"); }
void Default_Aspx(string result, TestRunItem runItem) { string originalHtml1 = @"[System.Web.HttpUnhandledException]: Exception of type 'System.Web.HttpUnhandledException' was thrown."; string originalHtml2 = @"[System.InvalidOperationException]: test"; Assert.IsTrue(result.IndexOf(originalHtml1) != -1, "#A1"); Assert.IsTrue(result.IndexOf(originalHtml2) != -1, "#A2"); }
void Default_Aspx(string result, TestRunItem runItem) { string originalHtml = @"<div>Report:<pre id=""report"">Public static method called ExternalAssembly1 added </pre></div>"; Helpers.ExtractAndCompareCodeFromHtml(result, originalHtml, "#A1"); }
void Default_Aspx(string result, TestRunItem runItem) { if (runItem == null) { throw new ArgumentNullException("runItem"); } CompareCallSets(runItem, "000"); }
void Stuff_Aspx(string result, TestRunItem runItem) { string originalHtml = @"<pre id=""settings""> /Web.config [1]: '[toplevel]' /Web.config [2]: 'Stuff.aspx' </pre>"; Helpers.ExtractAndCompareCodeFromHtml(result, originalHtml, "#A1"); }
void Default_Aspx(string result, TestRunItem runItem) { #if NET_4_0 string originalHtml = "<div>\r\n\t<table cellspacing=\"0\" rules=\"all\" border=\"1\" id=\"GridView1\" style=\"border-collapse:collapse;\">\r\n\t\t<tr>\r\n\t\t\t<th scope=\"col\">ID</th><th scope=\"col\">FULLNAME</th><th scope=\"col\"> </th>\r\n\t\t</tr><tr>\r\n\t\t\t<td>1</td><td>Sheryl Hunter</td><td align=\"left\" style=\"width:60px;\"><input type=\"submit\" name=\"GridView1$ctl02$DeleteBtn\" value=\"Delete\" id=\"GridView1_DeleteBtn_0\" /></td>\r\n\t\t</tr><tr>\r\n\t\t\t<td>2</td><td>Dean Straight</td><td class=\"aspNetDisabled\" align=\"left\" style=\"width:60px;\"><input type=\"submit\" name=\"GridView1$ctl03$DeleteBtn\" value=\"Delete\" disabled=\"disabled\" id=\"GridView1_DeleteBtn_1\" /></td>\r\n\t\t</tr><tr>\r\n\t\t\t<td>3</td><td>Marjorie Green</td><td align=\"left\" style=\"width:60px;\"><input type=\"submit\" name=\"GridView1$ctl04$DeleteBtn\" value=\"Delete\" id=\"GridView1_DeleteBtn_2\" /></td>\r\n\t\t</tr>\r\n\t</table>\r\n</div>"; #else string originalHtml = "<div>\r\n\t<table cellspacing=\"0\" rules=\"all\" border=\"1\" id=\"GridView1\" style=\"border-collapse:collapse;\">\r\n\t\t<tr>\r\n\t\t\t<th scope=\"col\">ID</th><th scope=\"col\">FULLNAME</th><th scope=\"col\"> </th>\r\n\t\t</tr><tr>\r\n\t\t\t<td>1</td><td>Sheryl Hunter</td><td align=\"left\" style=\"width:60px;\"><input type=\"submit\" name=\"GridView1$ctl02$DeleteBtn\" value=\"Delete\" id=\"GridView1_ctl02_DeleteBtn\" /></td>\r\n\t\t</tr><tr>\r\n\t\t\t<td>2</td><td>Dean Straight</td><td disabled=\"disabled\" align=\"left\" style=\"width:60px;\"><input type=\"submit\" name=\"GridView1$ctl03$DeleteBtn\" value=\"Delete\" disabled=\"disabled\" id=\"GridView1_ctl03_DeleteBtn\" /></td>\r\n\t\t</tr><tr>\r\n\t\t\t<td>3</td><td>Marjorie Green</td><td align=\"left\" style=\"width:60px;\"><input type=\"submit\" name=\"GridView1$ctl04$DeleteBtn\" value=\"Delete\" id=\"GridView1_ctl04_DeleteBtn\" /></td>\r\n\t\t</tr>\r\n\t</table>\r\n</div>"; #endif Helpers.ExtractAndCompareCodeFromHtml(result, originalHtml, "#A1"); }
void Default_Aspx(string result, TestRunItem runItem) { string originalHtml = @"<pre id=""log"">Page; Relative to: null; Result: exception System.ArgumentNullException (expected) A control; Relative to: __Page; Result: exception System.InvalidOperationException (expected) TextBox; Relative to: __Page; Result: exception System.InvalidOperationException (expected) Item: 0; Relative to: repeater1$ctl00; Result: 'ctl00$label1' Item: 0; Relative to: repeater1; Result: 'repeater1$ctl00$label1' Item: 0; Relative to: __Page; Result: exception System.InvalidOperationException (expected) Item: 0; Relative to: repeater1$ctl00$innerRepeater1$ctl00; Result: 'ctl00$innerLabel1' Item: 0; Relative to: repeater1; Result: 'repeater1$ctl00$innerRepeater1$ctl00$innerLabel1' Item: 0; Relative to: repeater1$ctl00$innerRepeater1; Result: 'innerRepeater1$ctl00$innerLabel1' Item: 0; Relative to: __Page; Result: exception System.InvalidOperationException (expected) Item: 1; Relative to: repeater1$ctl00$innerRepeater1$ctl01; Result: 'ctl01$innerLabel1' Item: 1; Relative to: repeater1; Result: 'repeater1$ctl00$innerRepeater1$ctl01$innerLabel1' Item: 1; Relative to: repeater1$ctl00$innerRepeater1; Result: 'innerRepeater1$ctl01$innerLabel1' Item: 1; Relative to: __Page; Result: exception System.InvalidOperationException (expected) Item: 2; Relative to: repeater1$ctl00$innerRepeater1$ctl02; Result: 'ctl02$innerLabel1' Item: 2; Relative to: repeater1; Result: 'repeater1$ctl00$innerRepeater1$ctl02$innerLabel1' Item: 2; Relative to: repeater1$ctl00$innerRepeater1; Result: 'innerRepeater1$ctl02$innerLabel1' Item: 2; Relative to: __Page; Result: exception System.InvalidOperationException (expected) Item: 1; Relative to: repeater1$ctl02; Result: 'ctl02$label1' Item: 1; Relative to: repeater1; Result: 'repeater1$ctl02$label1' Item: 1; Relative to: __Page; Result: exception System.InvalidOperationException (expected) Item: 0; Relative to: repeater1$ctl02$innerRepeater1$ctl00; Result: 'ctl00$innerLabel1' Item: 0; Relative to: repeater1; Result: 'repeater1$ctl02$innerRepeater1$ctl00$innerLabel1' Item: 0; Relative to: repeater1$ctl02$innerRepeater1; Result: 'innerRepeater1$ctl00$innerLabel1' Item: 0; Relative to: __Page; Result: exception System.InvalidOperationException (expected) Item: 1; Relative to: repeater1$ctl02$innerRepeater1$ctl01; Result: 'ctl01$innerLabel1' Item: 1; Relative to: repeater1; Result: 'repeater1$ctl02$innerRepeater1$ctl01$innerLabel1' Item: 1; Relative to: repeater1$ctl02$innerRepeater1; Result: 'innerRepeater1$ctl01$innerLabel1' Item: 1; Relative to: __Page; Result: exception System.InvalidOperationException (expected) Item: 2; Relative to: repeater1$ctl02$innerRepeater1$ctl02; Result: 'ctl02$innerLabel1' Item: 2; Relative to: repeater1; Result: 'repeater1$ctl02$innerRepeater1$ctl02$innerLabel1' Item: 2; Relative to: repeater1$ctl02$innerRepeater1; Result: 'innerRepeater1$ctl02$innerLabel1' Item: 2; Relative to: __Page; Result: exception System.InvalidOperationException (expected) Item: 2; Relative to: repeater1$ctl04; Result: 'ctl04$label1' Item: 2; Relative to: repeater1; Result: 'repeater1$ctl04$label1' Item: 2; Relative to: __Page; Result: exception System.InvalidOperationException (expected) Item: 0; Relative to: repeater1$ctl04$innerRepeater1$ctl00; Result: 'ctl00$innerLabel1' Item: 0; Relative to: repeater1; Result: 'repeater1$ctl04$innerRepeater1$ctl00$innerLabel1' Item: 0; Relative to: repeater1$ctl04$innerRepeater1; Result: 'innerRepeater1$ctl00$innerLabel1' Item: 0; Relative to: __Page; Result: exception System.InvalidOperationException (expected) Item: 1; Relative to: repeater1$ctl04$innerRepeater1$ctl01; Result: 'ctl01$innerLabel1' Item: 1; Relative to: repeater1; Result: 'repeater1$ctl04$innerRepeater1$ctl01$innerLabel1' Item: 1; Relative to: repeater1$ctl04$innerRepeater1; Result: 'innerRepeater1$ctl01$innerLabel1' Item: 1; Relative to: __Page; Result: exception System.InvalidOperationException (expected) Item: 2; Relative to: repeater1$ctl04$innerRepeater1$ctl02; Result: 'ctl02$innerLabel1' Item: 2; Relative to: repeater1; Result: 'repeater1$ctl04$innerRepeater1$ctl02$innerLabel1' Item: 2; Relative to: repeater1$ctl04$innerRepeater1; Result: 'innerRepeater1$ctl02$innerLabel1' Item: 2; Relative to: __Page; Result: exception System.InvalidOperationException (expected) </pre>"; Helpers.ExtractAndCompareCodeFromHtml(result, originalHtml, "#A1"); }
void Default_Aspx(string result, TestRunItem runItem) { var messages = runItem.TestRunData as List <string>; Assert.IsNotNull(messages, "#A1"); int len = messages.Count; if (expectedMessages.Length != len) { Assert.Fail("Expected {0} messages, found {1}", expectedMessages.Length, len); } for (int i = 0; i < len; i++) { Assert.AreEqual(expectedMessages [i], messages [i], "#A2-" + i.ToString()); } }
/// <summary> /// Display the results for the given test run item. /// </summary> /// <param name="sender">Object that raised the event.</param> /// <param name="e">Event arguments.</param> private void listViewClasses_SelectionChanged(object sender, SelectionChangedEventArgs e) { try { TestRunItem item = listViewClasses.SelectedItem as TestRunItem; if (item == null || item.Results.Length == 0) { listViewMethods.ItemsSource = null; } else { listViewMethods.ItemsSource = item.Results; } } catch (Exception err) { App.HandleException(err); } }
/// <summary> /// Update the view. /// </summary> public void UpdateView() { TestRunItem item = listViewClasses.SelectedItem as TestRunItem; if (item != null) { if (item.Results.Length > 0 && listViewMethods.ItemsSource == null) { listViewMethods.ItemsSource = item.Results; } } TestRunItemResult result = listViewMethods.SelectedItem as TestRunItemResult; if (result != null) { textBoxResults.Text = String.Format("{1}{0}{0}{2}", Environment.NewLine, result.Message, result.StackTrace); } }
void CompareCallSets(TestRunItem runItem, string name) { var dict = runItem.TestRunData as List <Dictionary <string, object> >; if (dict == null || dict.Count == 0) { Assert.Fail("No call data recorded."); } RequestValidatorCallSet cs = RequestValidatorCallSetContainer.GetCallSet(name); if (cs == null) { Assert.Fail("Call set \"{0}\" not found.", name); } foreach (Dictionary <string, object> calls in dict) { if (!cs.ContainsCallSet(calls)) { Assert.Fail("{0}: call sequence not found:{1}{2}", name, Environment.NewLine, SummarizeCallSet(calls)); } } }
void Default_Bar_Aspx(string result, TestRunItem runItem) { string originalHtml = "<span id=\"sitemap\"><a href=\"#sitemap_SkipLink\"><img alt=\"Skip Navigation Links\" height=\"0\" width=\"0\" src=\"/WebResource.axd\" style=\"border-width:0px;\" /></a><span><a href=\"/Default.aspx\">Main</a></span><span> > </span><span><a href=\"/Default.aspx?mode=bar\">Bar</a></span><a id=\"sitemap_SkipLink\"></a></span><pre id=\"log\">\tSystem.Web.UI.WebControls.SiteMapNodeItem [sitemap$ctl00]\r\n\tSystem.Web.UI.WebControls.HyperLink [sitemap$ctl00$ctl00]\r\n\tSystem.Web.UI.WebControls.SiteMapNodeItem [sitemap$ctl01]\r\n\tSystem.Web.UI.WebControls.Literal [sitemap$ctl01$ctl00]\r\n\tSystem.Web.UI.WebControls.SiteMapNodeItem [sitemap$ctl02]\r\n\tSystem.Web.UI.WebControls.HyperLink [sitemap$ctl02$ctl00]\r\n</pre>"; Helpers.ExtractAndCompareCodeFromHtml(Helpers.StripWebResourceAxdQuery(result), originalHtml, "#A1"); }
void Default_Aspx(string result, TestRunItem runItem) { string originalHtml = "<pre id=\"log\">node is <strong>not</strong> null and it is the root node</pre>"; Helpers.ExtractAndCompareCodeFromHtml(Helpers.StripWebResourceAxdQuery(result), originalHtml, "#A1"); }
void Default_Aspx(string result, TestRunItem runItem) { Assert.AreNotEqual(-1, result.IndexOf("[System.Web.HttpException]: The pre-application start initialization method PublicStaticMethod on type ApplicationPreStartMethods.Tests.PreStartMethods"), "#A1"); }
void Default_Bar_Aspx(string result, TestRunItem runItem) { string originalHtml = "<span><a href=\"#ctl03_SkipLink\"><img alt=\"Skip Navigation Links\" height=\"0\" width=\"0\" src=\"/WebResource.axd\" style=\"border-width:0px;\" /></a><span><a href=\"/Default.aspx\">Main</a></span><span> > </span><span><a href=\"/Default.aspx?mode=bar\">Bar</a></span><a id=\"ctl03_SkipLink\"></a></span>"; Helpers.ExtractAndCompareCodeFromHtml(Helpers.StripWebResourceAxdQuery(result), originalHtml, "#A1"); }
void WithHeaderWhenEmpty_Aspx(string result, TestRunItem runItem) { string originalHtml = "<div>\r\n\t<table cellspacing=\"0\" rules=\"all\" border=\"1\" id=\"GridView1\" style=\"border-collapse:collapse;\">\r\n\t\t<tr>\r\n\t\t\t<th scope=\"col\">ProductID</th><th scope=\"col\">ProductName</th><th scope=\"col\">ProductComment</th>\r\n\t\t</tr>\r\n\t</table>\r\n</div><pre id=\"log\">OnRowCreated called</pre>"; Helpers.ExtractAndCompareCodeFromHtml(result, originalHtml, "#A1"); }
void Default_Aspx_MoreThan40(string result, TestRunItem runItem) { string originalHtml = "5.0"; Helpers.ExtractAndCompareCodeFromHtml(result, originalHtml, "#A1"); }
void Default_Aspx(string result, TestRunItem runItem) { string originalHtml = @"<h2>Object moved to <a href=""http://google.com/"">here</a></h2>"; Assert.IsTrue(result.IndexOf(originalHtml) != -1, "#A1"); }
void Sub_Sub_Default_Aspx(string result, TestRunItem runItem) { string originalHtml = "/sub/sub/Hello"; Helpers.ExtractAndCompareCodeFromHtml(result, originalHtml, "#A1"); }
void TestPostBackMode_Aspx_PagePrev(string result, TestRunItem runItem) { string originalHtml = @"<span id=""ctl00_ContentPlaceHolder1_ListView1_DataPager1""><input type=""submit"" name=""ctl00$ContentPlaceHolder1$ListView1$DataPager1$ctl00$ctl00"" value=""First"" /> <a href=""javascript:__doPostBack('ctl00$ContentPlaceHolder1$ListView1$DataPager1$ctl01$ctl00','')"">1</a> <a href=""javascript:__doPostBack('ctl00$ContentPlaceHolder1$ListView1$DataPager1$ctl01$ctl01','')"">2</a> <a href=""javascript:__doPostBack('ctl00$ContentPlaceHolder1$ListView1$DataPager1$ctl01$ctl02','')"">3</a> <a href=""javascript:__doPostBack('ctl00$ContentPlaceHolder1$ListView1$DataPager1$ctl01$ctl03','')"">4</a> <span>5</span> <a href=""javascript:__doPostBack('ctl00$ContentPlaceHolder1$ListView1$DataPager1$ctl01$ctl05','')"">...</a> <input type=""submit"" name=""ctl00$ContentPlaceHolder1$ListView1$DataPager1$ctl02$ctl00"" value=""Last"" /> </span>"; Helpers.ExtractAndCompareCodeFromHtml(result, originalHtml, "#A1"); }
void Default_Invalid_Aspx(string result, TestRunItem runItem) { Assert.IsTrue(Helpers.HasException(result, typeof(ProviderException)), "#A1"); }
void Test_01_Aspx(string result, TestRunItem runItem) { string originalHtml = "<a href=\"#MyMenu1_SkipLink\"><img alt=\"Skip Navigation Links\" src=\"/WebResource.axd\" width=\"0\" height=\"0\" style=\"border-width:0px;\" /></a><div id=\"MyMenu1\">\r\n\t<ul class=\"level1\">\r\n\t\t<li><a title=\"Root description\" class=\"popout level1\" href=\"./\">Root</a><ul class=\"level2\">\r\n\t\t\t<li><a title=\"Mono Project Home Page\" class=\"popout level2\" href=\"http://mono-project.com/\">Mono</a><ul class=\"level3\">\r\n\t\t\t\t<li><a title=\"How to report Mono bugs\" class=\"popout level3\" href=\"http://mono-project.com/Bugs\">Mono Bugs</a><ul class=\"level4\">\r\n\t\t\t\t\t<li><a title=\"Includes Mono bugs interface\" class=\"level4\" href=\"http://bugzilla.novell.com\">Novell Bugzilla</a></li>\r\n\t\t\t\t</ul></li>\r\n\t\t\t</ul></li><li><a title=\"Main page of the Example page\" class=\"popout level2\" href=\"http://www.example.com\">Example</a><ul class=\"level3\">\r\n\t\t\t\t<li><a title=\"Example language translation interface\" class=\"level3\" href=\"http://translate.example.com\">Translator</a></li><li><a title=\"Example code search engine\" class=\"level3\" href=\"http://codesearch.example.com\">Code Search</a></li>\r\n\t\t\t</ul></li>\r\n\t\t</ul></li>\r\n\t</ul>\r\n</div><a id=\"MyMenu1_SkipLink\"></a>"; Helpers.ExtractAndCompareCodeFromHtml(Helpers.StripWebResourceAxdQuery(result), originalHtml, "#A1"); }
void NoHeaderWhenEmpty_Aspx(string result, TestRunItem runItem) { string originalHtml = "<div>\r\n\r\n</div><pre id=\"log\"></pre>"; Helpers.ExtractAndCompareCodeFromHtml(result, originalHtml, "#A1"); }
void Default_Aspx(string result, TestRunItem runItem) { Assert.AreNotEqual(-1, result.IndexOf("[System.Web.HttpException]: The method specified by the PreApplicationStartMethodAttribute on assembly"), "#A1"); }
void TestQueryMode_Aspx_Page2(string result, TestRunItem runItem) { string originalHtml = @"<span id=""ctl00_ContentPlaceHolder1_ListView1_DataPager1""><a href=""/Test_QueryMode.aspx?pageNumber=1"">First</a> <a href=""/Test_QueryMode.aspx?pageNumber=1"">1</a> <span>2</span> <a href=""/Test_QueryMode.aspx?pageNumber=3"">3</a> <a href=""/Test_QueryMode.aspx?pageNumber=4"">4</a> <a href=""/Test_QueryMode.aspx?pageNumber=5"">5</a> <a href=""/Test_QueryMode.aspx?pageNumber=6"">...</a> <a href=""/Test_QueryMode.aspx?pageNumber=10"">Last</a> </span>"; Helpers.ExtractAndCompareCodeFromHtml(result, originalHtml, "#A1"); }
void Default_Aspx(string result, TestRunItem runItem) { Assert.IsTrue(Helpers.HasException(result, typeof(ConfigurationErrorsException)), "#A1"); }
void Default_Aspx(string result, TestRunItem runItem) { string originalHtml = @"<div>Default URL: /default.aspx<br />Login URL: /login.aspx</div>"; Helpers.ExtractAndCompareCodeFromHtml(result, originalHtml, "#A1"); }
void Default_Aspx_LessThan35(string result, TestRunItem runItem) { Assert.IsTrue(result.IndexOf("[System.Configuration.ConfigurationErrorsException]") != -1, "#A1"); }