Exemple #1
0
		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)
		{
			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_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");
		}
Exemple #4
0
		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: &#39;SearchTermd&#39;)
	Returned null.
.: Missing property (key: &#39;SearchTerm&#39;)
	Returned value of type &#39;System.String&#39;: test
.: No converter (key: &#39;SearchTerm&#39;)
	Returned value of type &#39;System.String&#39;: test
.: Valid conversion to target (key: &#39;SearchTerm&#39;)
	Exception &#39;System.FormatException&#39; caught
.: Invalid conversion to target (key: &#39;SearchTerm&#39;)
	Exception &#39;System.Exception&#39; caught
.: Complex type converter (key: &#39;SearchTerm&#39;)
	Exception &#39;System.Exception&#39; caught
.: Null controlType (key: &#39;SearchTerm&#39;)
	Returned value of type &#39;System.String&#39;: test
.: Null propertyName (key: &#39;SearchTerm&#39;)
	Returned value of type &#39;System.String&#39;: test
.: Empty propertyName (key: &#39;SearchTerm&#39;)
	Returned value of type &#39;System.String&#39;: test
.: Non-string value (key: &#39;intValue&#39;)
	Returned value of type &#39;System.Int32&#39;: 123
.: Non-string value (key: &#39;boolValue&#39;)
	Returned value of type &#39;System.Boolean&#39;: False
.: Non-string value (key: &#39;doubleValue&#39;)
	Returned value of type &#39;System.Double&#39;: 1,23
</pre>";
			
			Helpers.ExtractAndCompareCodeFromHtml (result, originalHtml, "#A1");
		}
		void Default_Aspx (string result, TestRunItem runItem)
		{
			string originalHtml1 = @"[System.Web.HttpUnhandledException]: Exception of type &#39;System.Web.HttpUnhandledException&#39; 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)
		{
#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\">&nbsp;</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\">&nbsp;</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");
		}
Exemple #7
0
		void Default_Aspx (string result, TestRunItem runItem)
		{
			string originalHtml = @"<pre id=""output"">Default provider name: TestInMemoryProvider
Null context: TestInMemoryProvider
Default context: TestInMemoryProvider
</pre>";
			
			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: &#39;ctl00$label1&#39;
Item: 0; Relative to: repeater1; Result: &#39;repeater1$ctl00$label1&#39;
Item: 0; Relative to: __Page; Result: exception System.InvalidOperationException (expected)
	Item: 0; Relative to: repeater1$ctl00$innerRepeater1$ctl00; Result: &#39;ctl00$innerLabel1&#39;
	Item: 0; Relative to: repeater1; Result: &#39;repeater1$ctl00$innerRepeater1$ctl00$innerLabel1&#39;
	Item: 0; Relative to: repeater1$ctl00$innerRepeater1; Result: &#39;innerRepeater1$ctl00$innerLabel1&#39;
	Item: 0; Relative to: __Page; Result: exception System.InvalidOperationException (expected)
	Item: 1; Relative to: repeater1$ctl00$innerRepeater1$ctl01; Result: &#39;ctl01$innerLabel1&#39;
	Item: 1; Relative to: repeater1; Result: &#39;repeater1$ctl00$innerRepeater1$ctl01$innerLabel1&#39;
	Item: 1; Relative to: repeater1$ctl00$innerRepeater1; Result: &#39;innerRepeater1$ctl01$innerLabel1&#39;
	Item: 1; Relative to: __Page; Result: exception System.InvalidOperationException (expected)
	Item: 2; Relative to: repeater1$ctl00$innerRepeater1$ctl02; Result: &#39;ctl02$innerLabel1&#39;
	Item: 2; Relative to: repeater1; Result: &#39;repeater1$ctl00$innerRepeater1$ctl02$innerLabel1&#39;
	Item: 2; Relative to: repeater1$ctl00$innerRepeater1; Result: &#39;innerRepeater1$ctl02$innerLabel1&#39;
	Item: 2; Relative to: __Page; Result: exception System.InvalidOperationException (expected)
Item: 1; Relative to: repeater1$ctl02; Result: &#39;ctl02$label1&#39;
Item: 1; Relative to: repeater1; Result: &#39;repeater1$ctl02$label1&#39;
Item: 1; Relative to: __Page; Result: exception System.InvalidOperationException (expected)
	Item: 0; Relative to: repeater1$ctl02$innerRepeater1$ctl00; Result: &#39;ctl00$innerLabel1&#39;
	Item: 0; Relative to: repeater1; Result: &#39;repeater1$ctl02$innerRepeater1$ctl00$innerLabel1&#39;
	Item: 0; Relative to: repeater1$ctl02$innerRepeater1; Result: &#39;innerRepeater1$ctl00$innerLabel1&#39;
	Item: 0; Relative to: __Page; Result: exception System.InvalidOperationException (expected)
	Item: 1; Relative to: repeater1$ctl02$innerRepeater1$ctl01; Result: &#39;ctl01$innerLabel1&#39;
	Item: 1; Relative to: repeater1; Result: &#39;repeater1$ctl02$innerRepeater1$ctl01$innerLabel1&#39;
	Item: 1; Relative to: repeater1$ctl02$innerRepeater1; Result: &#39;innerRepeater1$ctl01$innerLabel1&#39;
	Item: 1; Relative to: __Page; Result: exception System.InvalidOperationException (expected)
	Item: 2; Relative to: repeater1$ctl02$innerRepeater1$ctl02; Result: &#39;ctl02$innerLabel1&#39;
	Item: 2; Relative to: repeater1; Result: &#39;repeater1$ctl02$innerRepeater1$ctl02$innerLabel1&#39;
	Item: 2; Relative to: repeater1$ctl02$innerRepeater1; Result: &#39;innerRepeater1$ctl02$innerLabel1&#39;
	Item: 2; Relative to: __Page; Result: exception System.InvalidOperationException (expected)
Item: 2; Relative to: repeater1$ctl04; Result: &#39;ctl04$label1&#39;
Item: 2; Relative to: repeater1; Result: &#39;repeater1$ctl04$label1&#39;
Item: 2; Relative to: __Page; Result: exception System.InvalidOperationException (expected)
	Item: 0; Relative to: repeater1$ctl04$innerRepeater1$ctl00; Result: &#39;ctl00$innerLabel1&#39;
	Item: 0; Relative to: repeater1; Result: &#39;repeater1$ctl04$innerRepeater1$ctl00$innerLabel1&#39;
	Item: 0; Relative to: repeater1$ctl04$innerRepeater1; Result: &#39;innerRepeater1$ctl00$innerLabel1&#39;
	Item: 0; Relative to: __Page; Result: exception System.InvalidOperationException (expected)
	Item: 1; Relative to: repeater1$ctl04$innerRepeater1$ctl01; Result: &#39;ctl01$innerLabel1&#39;
	Item: 1; Relative to: repeater1; Result: &#39;repeater1$ctl04$innerRepeater1$ctl01$innerLabel1&#39;
	Item: 1; Relative to: repeater1$ctl04$innerRepeater1; Result: &#39;innerRepeater1$ctl01$innerLabel1&#39;
	Item: 1; Relative to: __Page; Result: exception System.InvalidOperationException (expected)
	Item: 2; Relative to: repeater1$ctl04$innerRepeater1$ctl02; Result: &#39;ctl02$innerLabel1&#39;
	Item: 2; Relative to: repeater1; Result: &#39;repeater1$ctl04$innerRepeater1$ctl02$innerLabel1&#39;
	Item: 2; Relative to: repeater1$ctl04$innerRepeater1; Result: &#39;innerRepeater1$ctl02$innerLabel1&#39;
	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 ());
		}
Exemple #10
0
		void Default_Aspx (string result, TestRunItem runItem)
		{
			string originalHtml = "<div>12345snap test snap</div>\n<div>123454444</div>\n";
			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"" />&nbsp;<a href=""javascript:__doPostBack('ctl00$ContentPlaceHolder1$ListView1$DataPager1$ctl01$ctl00','')"">1</a>&nbsp;<a href=""javascript:__doPostBack('ctl00$ContentPlaceHolder1$ListView1$DataPager1$ctl01$ctl01','')"">2</a>&nbsp;<a href=""javascript:__doPostBack('ctl00$ContentPlaceHolder1$ListView1$DataPager1$ctl01$ctl02','')"">3</a>&nbsp;<a href=""javascript:__doPostBack('ctl00$ContentPlaceHolder1$ListView1$DataPager1$ctl01$ctl03','')"">4</a>&nbsp;<span>5</span>&nbsp;&nbsp;<a href=""javascript:__doPostBack('ctl00$ContentPlaceHolder1$ListView1$DataPager1$ctl01$ctl05','')"">...</a>&nbsp;<input type=""submit"" name=""ctl00$ContentPlaceHolder1$ListView1$DataPager1$ctl02$ctl00"" value=""Last"" />&nbsp;</span>";
			Helpers.ExtractAndCompareCodeFromHtml (result, originalHtml, "#A1");
		}
		void Default_Aspx_MoreThan40 (string result, TestRunItem runItem)
		{
			string originalHtml = "5.0";
			Helpers.ExtractAndCompareCodeFromHtml (result, originalHtml, "#A1");
		}
Exemple #13
0
		void Sub_Sub_Default_Aspx (string result, TestRunItem runItem)
		{
			string originalHtml = "/sub/sub/Hello";
			Helpers.ExtractAndCompareCodeFromHtml (result, originalHtml, "#A1");
		}
		void Default_Aspx (string result, TestRunItem runItem)
		{
			string originalHtml = @"<strong>Application error handled</strong>";
			
			Helpers.ExtractAndCompareCodeFromHtml (result, originalHtml, "#A1");
		}
Exemple #15
0
		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> &gt; </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 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_Ascending_ProductName (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\" style=\"background-color:Yellow;\"><a href=\"javascript:__doPostBack(&#39;GridView1&#39;,&#39;Sort$ProductName&#39;)\">Name</a></th><th scope=\"col\"><a href=\"javascript:__doPostBack(&#39;GridView1&#39;,&#39;Sort$ProductID&#39;)\">ID</a></th>\r\n\t\t</tr><tr>\r\n\t\t\t<td style=\"background-color:LightYellow;\">Apple</td><td>2</td>\r\n\t\t</tr><tr>\r\n\t\t\t<td style=\"background-color:LightYellow;\">Orange</td><td>3</td>\r\n\t\t</tr><tr>\r\n\t\t\t<td style=\"background-color:LightYellow;\">Pear</td><td>1</td>\r\n\t\t</tr>\r\n\t</table>\r\n</div>";
			Helpers.ExtractAndCompareCodeFromHtml (result, originalHtml, "#A1");
		}
Exemple #18
0
		void Default_Invalid_Aspx (string result, TestRunItem runItem)
		{
			Assert.IsTrue (Helpers.HasException (result, typeof (ProviderException)), "#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");
		}
Exemple #20
0
		void Default_Aspx (string result, TestRunItem runItem)
		{
			Assert.IsTrue (Helpers.HasException (result, typeof (ConfigurationErrorsException)), "#A1");
		}
Exemple #21
0
		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));
			}
			
		}
Exemple #22
0
		void Default_Aspx_Script (string result, TestRunItem runItem)
		{
			if (runItem == null)
				throw new ArgumentNullException ("runItem");

			CompareCallSets (runItem, "001");
		}
		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>&nbsp;<a href=""/Test_QueryMode.aspx?pageNumber=1"">1</a>&nbsp;<span>2</span>&nbsp;<a href=""/Test_QueryMode.aspx?pageNumber=3"">3</a>&nbsp;<a href=""/Test_QueryMode.aspx?pageNumber=4"">4</a>&nbsp;<a href=""/Test_QueryMode.aspx?pageNumber=5"">5</a>&nbsp;&nbsp;<a href=""/Test_QueryMode.aspx?pageNumber=6"">...</a>&nbsp;<a href=""/Test_QueryMode.aspx?pageNumber=10"">Last</a>&nbsp;</span>";
			Helpers.ExtractAndCompareCodeFromHtml (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");
		}
Exemple #25
0
		void Default_Aspx (string result, TestRunItem runItem)
		{
			string originalHtml = "<head><title>\r\n	Test\r\n</title><meta name=\"description\" content=\"This is meta description\" /><meta name=\"keywords\" content=\"meta,keywords,here\" /></head>";
			Helpers.ExtractAndCompareCodeFromHtml (result, originalHtml, "#A1");
		}
		void Default_Aspx_1 (string result, TestRunItem runItem)
		{
			CheckResults (runItem.TestRunData as List <string>, expectedMessages_1);
		}
		void Default_Aspx (string result, TestRunItem runItem)
		{
			string originalHtml = @"<p><strong>Parser Error Message: </strong><code>Cannot find type DoesNotExist</code></p><p><strong>Source Error: </strong></p>";

			Assert.IsTrue (result.IndexOf (originalHtml) != -1, "#A1");
		}
		void Default_Aspx_LessThan35 (string result, TestRunItem runItem)
		{
			Assert.IsTrue (result.IndexOf ("[System.Configuration.ConfigurationErrorsException]") != -1, "#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 Default_Aspx (string result, TestRunItem runItem)
		{
			string originalHtml = @"M1: <span id=""FormView1_M1Label"">0</span><br />M2: <span id=""FormView1_M2Label"">0</span>";
			Helpers.ExtractAndCompareCodeFromHtml (result, originalHtml, "#A1");
		}