当前位置: 首页>>代码示例>>C#>>正文


C# Framework.PageDelegates类代码示例

本文整理汇总了C#中MonoTests.SystemWeb.Framework.PageDelegates的典型用法代码示例。如果您正苦于以下问题:C# PageDelegates类的具体用法?C# PageDelegates怎么用?C# PageDelegates使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


PageDelegates类属于MonoTests.SystemWeb.Framework命名空间,在下文中一共展示了PageDelegates类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CrossPagePosting_BaseFixture

		public void CrossPagePosting_BaseFixture ()
		{
			WebTest t = new WebTest ("CrossPagePosting1.aspx");
			string html = t.Run ();

			if (html.IndexOf ("LinkButtonText") < 0)
				Assert.Fail ("Link button not created fail");

			PageDelegates pd = new PageDelegates ();
			pd.Load = Load;
			t.Invoker = new PageInvoker (pd);

			FormRequest fr = new FormRequest (t.Response, "form1");
			fr.Controls.Add ("__EVENTTARGET");
			fr.Controls.Add ("__EVENTARGUMENT");
			
			fr.Controls["__EVENTTARGET"].Value = "LinkButton1";
			fr.Controls["__EVENTARGUMENT"].Value = "";
			
			t.Request = fr;
			fr.Url = "CrossPagePosting2.aspx";
			html = t.Run ();
			if (html.IndexOf ("CrossedPostbackPage") < 0)
				Assert.Fail ("CrossPagePosting removeing to target page fail");
		}
开发者ID:Profit0004,项目名称:mono,代码行数:25,代码来源:CrossPagePostingTest.cs

示例2: GetAppSetting1

		public void GetAppSetting1 ()
		{
			PageDelegates pd = new PageDelegates ();
			pd.Load = GetAppSetting1_Load;
			WebTest test = new WebTest (new PageInvoker (pd));
			test.Run ();
		}
开发者ID:Profit0004,项目名称:mono,代码行数:7,代码来源:AppSettingsExpressionBuilderTest.cs

示例3: CreateOnPreInit

		/// <summary>
		/// Create a new <see cref="PageInvoker"/> which Delegates contain the
		/// given callback for PreInit event.
		/// </summary>
		/// <param name="callback">The user callback.</param>
		/// <returns>A new <see cref="PageInvoker"/> instance.</returns>
		public static PageInvoker CreateOnPreInit (PageDelegate callback)
		{
			PageDelegates pd = new PageDelegates ();
			pd.PreInit = callback;
			PageInvoker pi = new PageInvoker (pd);
			return pi;
		}
开发者ID:GirlD,项目名称:mono,代码行数:13,代码来源:PageInvoker.cs

示例4: CreateOnLoad

		/// <summary>
		/// Create a new <see cref="PageInvoker"/> which Delegates contain the
		/// given callback for Load event.
		/// </summary>
		/// <param name="callback">The user callback.</param>
		/// <returns>A new <see cref="PageInvoker"/> instance.</returns>
		public static PageInvoker CreateOnLoad (PageDelegate callback)
		{
			PageDelegates pd = new PageDelegates ();
			pd.Load = callback;
			PageInvoker pi = new PageInvoker (pd);
			return pi;
		}
开发者ID:GirlD,项目名称:mono,代码行数:13,代码来源:PageInvoker.cs

示例5: CallBackResulrValues

		[Category ("NotDotNet")] // for dot-net use __CALLBACKID insted __CALLBACKTARGET and __CALLBACKARGUMENT insted __CALLBACKPARAM
		public void CallBackResulrValues ()
		{
			WebTest t = new WebTest ("CallbackTest1.aspx");
			string html = t.Run ();
			PageDelegates pd = new PageDelegates ();
			pd.Load = Load;
			t.Invoker = new PageInvoker (pd);

			FormRequest fr = new FormRequest (t.Response, "form1");
			fr.Controls.Add ("__EVENTTARGET");
			fr.Controls.Add ("__EVENTARGUMENT");
			fr.Controls.Add ("__CALLBACKTARGET");
			fr.Controls.Add ("__CALLBACKARGUMENT");
			fr.Controls["__EVENTTARGET"].Value = "";
			fr.Controls["__EVENTARGUMENT"].Value = "";
			fr.Controls ["__CALLBACKTARGET"].Value = "__Page";
			fr.Controls ["__CALLBACKARGUMENT"].Value = "monitor";

			t.Request = fr;
			html = t.Run ();
			
			// Into result string the last 2 variables shows if events been done
			// first - RaiseCallbackEvent
			// second - GetCallbackResult

			if (html.IndexOf ("12|true|true") < 0)
				Assert.Fail ("CallBack#1");

			fr.Controls["__EVENTTARGET"].Value = "";
			fr.Controls["__EVENTARGUMENT"].Value = "";
			fr.Controls ["__CALLBACKTARGET"].Value = "__Page";
			fr.Controls ["__CALLBACKARGUMENT"].Value = "laptop";

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

			// Into result string the last 2 variables shows if events been done
			// first - RaiseCallbackEvent
			// second - GetCallbackResult

			if (html.IndexOf ("10|true|true") < 0)
				Assert.Fail ("CallBack#2");
		}
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:44,代码来源:CallBackTest.cs

示例6: Wizard_PostBackFireEvents_3

		public void Wizard_PostBackFireEvents_3 ()
		{
			WebTest t = new WebTest ();
			PageDelegates pd = new PageDelegates ();
			pd.PreInit = _postbackEvents;
			t.Invoker = new PageInvoker (pd);
			string html = t.Run ();
			FormRequest fr = new FormRequest (t.Response, "form1");

			//SideBarButton
			fr = new FormRequest (t.Response, "form1");
			fr.Controls.Add ("__EVENTTARGET");
			fr.Controls.Add ("__EVENTARGUMENT");

			fr.Controls ["__EVENTTARGET"].Value = "Wizard1$SideBarContainer$SideBarList$ctl01$SideBarButton";
			fr.Controls ["__EVENTARGUMENT"].Value = "";
			t.Request = fr;
			html = t.Run ();
			Assert.AreEqual ("SideBarButtonClick", t.UserData.ToString (), "SideBarButton");
		}
开发者ID:JokerMisfits,项目名称:linux-packaging-mono,代码行数:20,代码来源:WizardTest.cs

示例7: Wizard_PostBack

		public void Wizard_PostBack()
		{
			WebTest t = new WebTest ();
			PageDelegates pd = new PageDelegates ();
			pd.PreInit = _postback;
			pd.PreRenderComplete = _readControl;
			t.Invoker = new PageInvoker (pd);
			string result = t.Run ();
			if (result.IndexOf ("Start") < 0)
				Assert.Fail ("Rendering fault");

			ArrayList list =  t.UserData as ArrayList;
			Assert.IsNotNull (list, "PostBackDataNotCreated");
			
			FormRequest fr = new FormRequest (t.Response, "form1");
			fr.Controls.Add ("__EVENTTARGET");
			fr.Controls.Add ("__EVENTARGUMENT");

			fr.Controls["__EVENTTARGET"].Value = list[1].ToString();
			fr.Controls["__EVENTARGUMENT"].Value = "";
			
			t.Request = fr;
			result = t.Run ();
			if (result.IndexOf ("StepType") < 0)
				Assert.Fail ("MovedToStep1");

			fr = new FormRequest (t.Response, "form1");
			fr.Controls.Add ("__EVENTTARGET");
			fr.Controls.Add ("__EVENTARGUMENT");

			fr.Controls["__EVENTTARGET"].Value = list[2].ToString ();
			fr.Controls["__EVENTARGUMENT"].Value = "";

			t.Request = fr;
			result = t.Run ();
			if (result.IndexOf ("AutoType") < 0)
				Assert.Fail ("MovedToStep2");

			fr = new FormRequest (t.Response, "form1");
			fr.Controls.Add ("__EVENTTARGET");
			fr.Controls.Add ("__EVENTARGUMENT");

			fr.Controls["__EVENTTARGET"].Value = list[3].ToString ();
			fr.Controls["__EVENTARGUMENT"].Value = "";

			t.Request = fr;
			result = t.Run ();
			if (result.IndexOf ("FinishType") < 0)
				Assert.Fail ("MovedToStep3");

			fr = new FormRequest (t.Response, "form1");
			fr.Controls.Add ("__EVENTTARGET");
			fr.Controls.Add ("__EVENTARGUMENT");

			fr.Controls["__EVENTTARGET"].Value = list[4].ToString ();
			fr.Controls["__EVENTARGUMENT"].Value = "";

			t.Request = fr;
			result = t.Run ();
			if (result.IndexOf ("CompleteType") < 0)
				Assert.Fail ("MovedToStep4");
		}
开发者ID:JokerMisfits,项目名称:linux-packaging-mono,代码行数:62,代码来源:WizardTest.cs

示例8: ListItemsViewState4

		public void ListItemsViewState4 ()
		{
			PageDelegates pd = new PageDelegates ();
			pd.Init = ListItemsViewState_Init;
			pd.Load = ListItemsViewState_PageLoad4;
			WebTest test = new WebTest (new PageInvoker (pd));

			string html = test.Run ();
			Assert.IsTrue (html.IndexOf ("value=\"3\"") < 0, "ListItemsViewState4 #1");
			Assert.IsTrue (html.IndexOf ("value=\"heh\"") > 0, "ListItemsViewState4 #2");

			test.Request = new FormRequest (test.Response, "form1");
			html = test.Run ();
			Assert.IsTrue (html.IndexOf ("value=\"2\"") > 0, "ListItemsViewState4 #3");
			Assert.IsTrue (html.IndexOf ("value=\"3\"") < 0, "ListItemsViewState4 #4");
			Assert.IsTrue (html.IndexOf ("value=\"heh\"") > 0, "ListItemsViewState4 #5");
		}
开发者ID:Profit0004,项目名称:mono,代码行数:17,代码来源:ListBoxTest.cs

示例9: Wizard_PostBackFireEvents_2

		public void Wizard_PostBackFireEvents_2 ()
		{
			WebTest t = new WebTest ();
			PageDelegates pd = new PageDelegates ();
			pd.PreInit = _postbackEvents;
			t.Invoker = new PageInvoker (pd);
			string html = t.Run ();
			FormRequest fr = new FormRequest (t.Response, "form1");

			// Next
			fr.Controls.Add ("__EVENTTARGET");
			fr.Controls.Add ("__EVENTARGUMENT");
			fr.Controls.Add ("Wizard1$StartNavigationTemplateContainerID$StartNextButton");
			fr.Controls["__EVENTTARGET"].Value = "";
			fr.Controls["__EVENTARGUMENT"].Value = "";
			fr.Controls["Wizard1$StartNavigationTemplateContainerID$StartNextButton"].Value = "Next";
			t.Request = fr;
			html = t.Run ();
			Assert.AreEqual ("NextButtonClick", t.UserData.ToString (), "Next");

			// Finish
			fr = new FormRequest (t.Response, "form1");
			fr.Controls.Add ("__EVENTTARGET");
			fr.Controls.Add ("__EVENTARGUMENT");
			fr.Controls.Add ("Wizard1$FinishNavigationTemplateContainerID$FinishButton");
			fr.Controls["__EVENTTARGET"].Value = "";
			fr.Controls["__EVENTARGUMENT"].Value = "";
			fr.Controls["Wizard1$FinishNavigationTemplateContainerID$FinishButton"].Value = "Finish";
			t.Request = fr;
			t.Run ();
			Assert.AreEqual ("FinishButtonClick", t.UserData.ToString (), "Finish");

		}
开发者ID:JokerMisfits,项目名称:linux-packaging-mono,代码行数:33,代码来源:WizardTest.cs

示例10: Menu_PostBackFireEvents_2

		public void Menu_PostBackFireEvents_2 ()
		{
			WebTest t = new WebTest ("PostBackMenuTest.aspx");
			PageDelegates pd = new PageDelegates ();
			pd.Init = PostBackFireEvents_Init ;
			t.Invoker = new PageInvoker (pd);
			t.Run ();
			Assert.AreEqual ("MenuItemDataBound", t.UserData.ToString (), "MenuItemDataBound");
		}
开发者ID:JokerMisfits,项目名称:linux-packaging-mono,代码行数:9,代码来源:MenuTest.cs

示例11: Menu_Templates

		public void Menu_Templates () {
			PageDelegates pd = new PageDelegates ();
			pd.Init = Menu_Templates_PageInit;
			pd.PreRenderComplete = Menu_Templates_PagePreRenderComplete;
			PageInvoker pi = new PageInvoker (pd);
			new WebTest (pi).Run ();
		}
开发者ID:JokerMisfits,项目名称:linux-packaging-mono,代码行数:7,代码来源:MenuTest.cs

示例12: ImageField_NullDisplayText

		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>\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\">Data</th><th scope=\"col\">Field</th>\r\n\t\t</tr><tr>\r\n\t\t\t<td><span>NullDisplayText</span></td><td>&nbsp;</td>\r\n\t\t</tr><tr>\r\n\t\t\t<td><span>NullDisplayText</span></td><td>&nbsp;</td>\r\n\t\t</tr><tr>\r\n\t\t\t<td><span>NullDisplayText</span></td><td>&nbsp;</td>\r\n\t\t</tr><tr>\r\n\t\t\t<td><span>NullDisplayText</span></td><td>&nbsp;</td>\r\n\t\t</tr><tr>\r\n\t\t\t<td><span>NullDisplayText</span></td><td>&nbsp;</td>\r\n\t\t</tr>\r\n\t</table>\r\n</div>";
			string htmlControl = HtmlDiff.GetControlFromPageHtml (htmlPage);
			HtmlDiff.AssertAreEqual (htmlOrigin, htmlControl, "ImageFieldNullText");
		}
开发者ID:JokerMisfits,项目名称:linux-packaging-mono,代码行数:12,代码来源:ImageFieldTest.cs

示例13: Menu_PostBack

		[Category ("NotDotNet")] // implementation specific
		public void Menu_PostBack ()
		{
			PageDelegates pd = new PageDelegates ();
			pd.Init = Menu_SetTableMode;
			WebTest t = new WebTest ("PostBackMenuTest.aspx");
			t.Invoker = new PageInvoker (pd);

			string str = t.Run ();
			FormRequest fr = new FormRequest (t.Response, "form1");
			fr.Controls.Add ("__EVENTTARGET");
			fr.Controls.Add ("__EVENTARGUMENT");
			fr.Controls["__EVENTTARGET"].Value = "Menu1";
			fr.Controls ["__EVENTARGUMENT"].Value = "0_1";
			t.Request = fr;
			pd.PreRender = _MenuItemsPost;
			t.Invoker = new PageInvoker (pd);
			t.Run ();
		}
开发者ID:JokerMisfits,项目名称:linux-packaging-mono,代码行数:19,代码来源:MenuTest.cs

示例14: BasicPostbackTest

		public void BasicPostbackTest ()
		{
			PageInvoker pi = PageInvoker.CreateOnLoad (new PageDelegate (StylesRenderTestInit));
			WebTest test = new WebTest (pi);

			string html = test.Run ();
			test.Invoker = pi;

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

			fr.Controls.Add (new BaseControl (GetDecoratedId (html, "UserName"), "username"));
			fr.Controls.Add (new BaseControl (GetDecoratedId (html, "Password"), "password"));
			fr.Controls.Add (new BaseControl (GetDecoratedId (html, "ConfirmPassword"), "password"));
			fr.Controls.Add (new BaseControl (GetDecoratedId (html, "Email"), "email"));
			fr.Controls.Add (new BaseControl (GetDecoratedId (html, "Question"), "question"));
			fr.Controls.Add (new BaseControl (GetDecoratedId (html, "Answer"), "answer"));

			PageDelegates pd = new PageDelegates ();
			pd.PreRender = new PageDelegate (BasicPostTestPreRender);
			pd.Load = new PageDelegate (StylesRenderTestInit);
			pi.Delegates = pd;

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

			Assert.IsTrue (html.IndexOf ("username") > 0, "rendered user name");
			Assert.IsTrue (html.IndexOf ("password") > 0, "rendered user password");
			Assert.IsTrue (html.IndexOf ("password") > 0, "rendered user confirm password");
			Assert.IsTrue (html.IndexOf ("email") > 0, "rendered user email");
			Assert.IsTrue (html.IndexOf ("question") > 0, "rendered user question");
			Assert.IsTrue (html.IndexOf ("answer") > 0, "rendered user answer");

			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");
		}
开发者ID:Profit0004,项目名称:mono,代码行数:41,代码来源:CreateUserWizardTest.cs

示例15: ImageField_GetFormattedAlternateText

		public void ImageField_GetFormattedAlternateText ()
		{
			WebTest t = new WebTest ();
			PageDelegates pd = new PageDelegates ();
			pd.PreRender = _ImageFieldInit;
			t.Invoker = new PageInvoker (pd);
			
			string htmlPage = t.Run ();
#if NET_4_0
			string htmlOrigin = "<div>\r\n\t<table cellspacing=\"0\" rules=\"all\" border=\"1\" id=\"Grid\" style=\"border-collapse:collapse;\">\r\n\t\t<tr>\r\n\t\t\t<th scope=\"col\">Data</th>\r\n\t\t</tr><tr>\r\n\t\t\t<td><img src=\"Item%200\" alt=\"Item: Item 0\" /></td>\r\n\t\t</tr><tr>\r\n\t\t\t<td><img src=\"Item%201\" alt=\"Item: Item 1\" /></td>\r\n\t\t</tr><tr>\r\n\t\t\t<td><img src=\"Item%202\" alt=\"Item: Item 2\" /></td>\r\n\t\t</tr><tr>\r\n\t\t\t<td><img src=\"Item%203\" alt=\"Item: Item 3\" /></td>\r\n\t\t</tr><tr>\r\n\t\t\t<td><img src=\"Item%204\" alt=\"Item: Item 4\" /></td>\r\n\t\t</tr>\r\n\t</table>\r\n</div>";
#else
			string htmlOrigin = "<div>\r\n\t<table cellspacing=\"0\" rules=\"all\" border=\"1\" id=\"Grid\" style=\"border-collapse:collapse;\">\r\n\t\t<tr>\r\n\t\t\t<th scope=\"col\">Data</th>\r\n\t\t</tr><tr>\r\n\t\t\t<td><img src=\"Item%200\" alt=\"Item: Item 0\" style=\"border-width:0px;\" /></td>\r\n\t\t</tr><tr>\r\n\t\t\t<td><img src=\"Item%201\" alt=\"Item: Item 1\" style=\"border-width:0px;\" /></td>\r\n\t\t</tr><tr>\r\n\t\t\t<td><img src=\"Item%202\" alt=\"Item: Item 2\" style=\"border-width:0px;\" /></td>\r\n\t\t</tr><tr>\r\n\t\t\t<td><img src=\"Item%203\" alt=\"Item: Item 3\" style=\"border-width:0px;\" /></td>\r\n\t\t</tr><tr>\r\n\t\t\t<td><img src=\"Item%204\" alt=\"Item: Item 4\" style=\"border-width:0px;\" /></td>\r\n\t\t</tr>\r\n\t</table>\r\n</div>";
#endif
			string htmlControl = HtmlDiff.GetControlFromPageHtml (htmlPage);
			HtmlDiff.AssertAreEqual (htmlOrigin, htmlControl, "GetFormattedAlternateText");
		}
开发者ID:JokerMisfits,项目名称:linux-packaging-mono,代码行数:16,代码来源:ImageFieldTest.cs


注:本文中的MonoTests.SystemWeb.Framework.PageDelegates类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。