2
0

ClientScriptManagerTest.cs 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557
  1. //
  2. // Tests for System.Web.UI.ClientScriptManagerTest.cs
  3. //
  4. // Author:
  5. // Yoni Klein ([email protected])
  6. //
  7. //
  8. // Copyright (C) 2005 Novell, Inc (http://www.novell.com)
  9. //
  10. // Permission is hereby granted, free of charge, to any person obtaining
  11. // a copy of this software and associated documentation files (the
  12. // "Software"), to deal in the Software without restriction, including
  13. // without limitation the rights to use, copy, modify, merge, publish,
  14. // distribute, sublicense, and/or sell copies of the Software, and to
  15. // permit persons to whom the Software is furnished to do so, subject to
  16. // the following conditions:
  17. //
  18. // The above copyright notice and this permission notice shall be
  19. // included in all copies or substantial portions of the Software.
  20. //
  21. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  22. // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  23. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  24. // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
  25. // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
  26. // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
  27. // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  28. #if NET_2_0
  29. using System;
  30. using System.Web;
  31. using System.Web.UI;
  32. using System.Web.UI.WebControls;
  33. using NUnit.Framework;
  34. using MonoTests.stand_alone.WebHarness;
  35. using MonoTests.SystemWeb.Framework;
  36. using System.Text;
  37. using System.Threading;
  38. namespace MonoTests.System.Web.UI
  39. {
  40. public class MyPage : Page, ICallbackEventHandler
  41. {
  42. #region ICallbackEventHandler Members
  43. public string GetCallbackResult ()
  44. {
  45. throw new Exception ("The method or operation is not implemented.");
  46. }
  47. public void RaiseCallbackEvent (string eventArgument)
  48. {
  49. throw new Exception ("The method or operation is not implemented.");
  50. }
  51. #endregion
  52. }
  53. [TestFixture]
  54. public class ClientScriptManagerTest
  55. {
  56. [TestFixtureSetUp]
  57. public void Set_Up ()
  58. {
  59. #if DOT_NET
  60. WebTest.CopyResource (GetType (), "MonoTests.System.Web.UI.WebControls.Resources.EventValidationTest1.aspx", "EventValidationTest1.aspx");
  61. WebTest.CopyResource (GetType (), "MonoTests.System.Web.UI.WebControls.Resources.EventValidationTest2.aspx", "EventValidationTest2.aspx");
  62. #else
  63. WebTest.CopyResource (GetType (), "EventValidationTest1.aspx", "EventValidationTest1.aspx");
  64. WebTest.CopyResource (GetType (), "EventValidationTest2.aspx", "EventValidationTest2.aspx");
  65. #endif
  66. }
  67. [SetUp]
  68. public void SetupTestCase ()
  69. {
  70. Thread.Sleep (100);
  71. }
  72. [Test]
  73. public void ClientScriptManager_GetCallbackEventReference_1 ()
  74. {
  75. MyPage p = new MyPage ();
  76. ClientScriptManager cs = p.ClientScript;
  77. StringBuilder context1 = new StringBuilder ();
  78. context1.Append ("function ReceiveServerData1(arg, context)");
  79. context1.Append ("{");
  80. context1.Append ("Message1.innerText = arg;");
  81. context1.Append ("value1 = arg;");
  82. context1.Append ("}");
  83. // Define callback references.
  84. String cbReference = cs.GetCallbackEventReference (p, "arg",
  85. "ReceiveServerData1", context1.ToString ());
  86. Assert.AreEqual ("WebForm_DoCallback('__Page',arg,ReceiveServerData1,function ReceiveServerData1(arg, context){Message1.innerText = arg;value1 = arg;},null,false)", cbReference, "GetCallbackEventReferenceFail1");
  87. }
  88. [Test]
  89. public void ClientScriptManager_GetCallbackEventReference_2 ()
  90. {
  91. MyPage p = new MyPage ();
  92. ClientScriptManager cs = p.ClientScript;
  93. StringBuilder context1 = new StringBuilder ();
  94. context1.Append ("function ReceiveServerData1(arg, context)");
  95. context1.Append ("{");
  96. context1.Append ("Message1.innerText = arg;");
  97. context1.Append ("value1 = arg;");
  98. context1.Append ("}");
  99. // Define callback references.
  100. String cbReference = cs.GetCallbackEventReference (p, "arg",
  101. "ReceiveServerData1", context1.ToString (), true);
  102. Assert.AreEqual ("WebForm_DoCallback('__Page',arg,ReceiveServerData1,function ReceiveServerData1(arg, context){Message1.innerText = arg;value1 = arg;},null,true)", cbReference, "GetCallbackEventReferenceFail2");
  103. }
  104. [Test]
  105. public void ClientScriptManager_GetCallbackEventReference_3 ()
  106. {
  107. MyPage p = new MyPage ();
  108. ClientScriptManager cs = p.ClientScript;
  109. StringBuilder context1 = new StringBuilder ();
  110. context1.Append ("function ReceiveServerData1(arg, context)");
  111. context1.Append ("{");
  112. context1.Append ("Message1.innerText = arg;");
  113. context1.Append ("value1 = arg;");
  114. context1.Append ("}");
  115. // Define callback references.
  116. String cbReference = cs.GetCallbackEventReference (p, "arg",
  117. "ReceiveServerData1", context1.ToString (), "ErrorCallback", false);
  118. Assert.AreEqual ("WebForm_DoCallback('__Page',arg,ReceiveServerData1,function ReceiveServerData1(arg, context){Message1.innerText = arg;value1 = arg;},ErrorCallback,false)", cbReference, "GetCallbackEventReferenceFail3");
  119. }
  120. [Test]
  121. public void ClientScriptManager_GetPostBackEventReference_1 ()
  122. {
  123. MyPage p = new MyPage ();
  124. ClientScriptManager cs = p.ClientScript;
  125. String result = cs.GetPostBackEventReference (new PostBackOptions (p, "args"));
  126. Assert.AreEqual ("__doPostBack('__Page','args')", result, "GetPostBackEventReference#1");
  127. }
  128. [Test]
  129. public void ClientScriptManager_GetPostBackEventReference_2 ()
  130. {
  131. MyPage p = new MyPage ();
  132. ClientScriptManager cs = p.ClientScript;
  133. String result = cs.GetPostBackEventReference (p, "args");
  134. Assert.AreEqual ("__doPostBack('__Page','args')", result, "GetPostBackEventReference#2");
  135. }
  136. [Test]
  137. public void ClientScriptManager_GetPostBackClientHyperlink ()
  138. {
  139. MyPage p = new MyPage ();
  140. ClientScriptManager cs = p.ClientScript;
  141. String hyperlink = cs.GetPostBackClientHyperlink (p, "args");
  142. Assert.AreEqual ("javascript:__doPostBack('__Page','args')", hyperlink, "GetPostBackClientHyperlink");
  143. }
  144. [Test]
  145. [Category("NunitWeb")]
  146. public void ClientScriptManager_GetWebResourceUrl ()
  147. {
  148. string html = new WebTest (PageInvoker.CreateOnLoad (GetWebResourceUrlLoad)).Run();
  149. }
  150. public static void GetWebResourceUrlLoad (Page p)
  151. {
  152. ClientScriptManager cs = p.ClientScript;
  153. String cbReference = cs.GetWebResourceUrl (typeof (MonoTests.System.Web.UI.ClientScriptManagerTest), "ClientScript.js");
  154. if (cbReference.IndexOf("/NunitWeb/WebResource.axd?")<0)
  155. Assert.Fail ("GetWebResourceUrlFail");
  156. }
  157. [Test]
  158. public void ClientScriptManager_IsClientScriptBlockRegistered ()
  159. {
  160. Page p = new Page ();
  161. ClientScriptManager cs = p.ClientScript;
  162. String csname2 = "ButtonClickScript";
  163. Type cstype = p.GetType ();
  164. StringBuilder cstext2 = new StringBuilder ();
  165. cstext2.Append ("<script type=text/javascript> function DoClick() {");
  166. cstext2.Append ("alert('Text from client script.')} </");
  167. cstext2.Append ("script>");
  168. cs.RegisterClientScriptBlock (cstype, csname2, cstext2.ToString ());
  169. Assert.AreEqual (true, cs.IsClientScriptBlockRegistered (cstype, csname2), "ClientScriptBlockRegisterFail#1");
  170. }
  171. [Test]
  172. public void ClientScriptManager_IsRegisterClientScriptInclude ()
  173. {
  174. Page p = new Page ();
  175. String csname = "ButtonClickScript";
  176. String csurl = "ClientScript.js";
  177. Type cstype = p.GetType ();
  178. ClientScriptManager cs = p.ClientScript;
  179. cs.RegisterClientScriptInclude (cstype, csname, csurl);
  180. bool registry = cs.IsClientScriptIncludeRegistered (cstype, csname);
  181. Assert.AreEqual (true, registry, "RegisterClientScriptIncludeFail");
  182. }
  183. [Test]
  184. public void ClientScriptManager_IsRegisterOnSubmitStatement ()
  185. {
  186. Page p = new Page ();
  187. String csname = "ButtonClickScript";
  188. Type cstype = p.GetType ();
  189. ClientScriptManager cs = p.ClientScript;
  190. cs.RegisterClientScriptInclude (cstype, csname, "document.write('Text from OnSubmit statement');");
  191. bool registry = cs.IsClientScriptIncludeRegistered (cstype, csname);
  192. Assert.AreEqual (true, registry, "RegisterClientScriptIncludeFail");
  193. }
  194. [Test]
  195. [Category ("NunitWeb")]
  196. [Category ("NotWorking")] // implementation specific
  197. public void ClientScriptManager_RegisterOnSubmitStatement ()
  198. {
  199. WebTest t = new WebTest (PageInvoker.CreateOnLoad (RegisterOnSubmitStatement));
  200. string html = t.Run ();
  201. if (html.IndexOf ("WebForm_OnSubmit()") < 0)
  202. Assert.Fail ("RegisterOnSubmitStatement");
  203. }
  204. public static void RegisterOnSubmitStatement (Page p)
  205. {
  206. String csname = "OnSubmitScript";
  207. Type cstype = p.GetType ();
  208. ClientScriptManager cs = p.ClientScript;
  209. String cstext = "document.write('Text from OnSubmit statement');";
  210. cs.RegisterOnSubmitStatement (cstype, csname, cstext);
  211. }
  212. [Test]
  213. [Category ("NunitWeb")]
  214. public void ClientScriptManager_RegisterClientScriptInclude ()
  215. {
  216. WebTest t = new WebTest (PageInvoker.CreateOnLoad (RegisterClientScriptInclude));
  217. string html = t.Run ();
  218. if (html.IndexOf ("script_include.js") < 0)
  219. Assert.Fail ("RegisterClientScriptIncludeFail");
  220. }
  221. public static void RegisterClientScriptInclude (Page p)
  222. {
  223. String csname = "ButtonClickScript";
  224. String csurl = "script_include.js";
  225. Type cstype = p.GetType ();
  226. ClientScriptManager cs = p.ClientScript;
  227. cs.RegisterClientScriptInclude (cstype, csname, csurl);
  228. }
  229. [Test]
  230. [Category("NunitWeb")]
  231. public void ClientScriptManager_ClientScriptBlockRegister()
  232. {
  233. WebTest t = new WebTest (PageInvoker.CreateOnLoad (ClientScriptBlockRegister));
  234. string html = t.Run ();
  235. if( html.IndexOf("DoClick()") < 0)
  236. Assert.Fail ("ClientScriptBlockRegisterFail#2");
  237. }
  238. public static void ClientScriptBlockRegister (Page p)
  239. {
  240. ClientScriptManager cs = p.ClientScript;
  241. String csname2 = "ButtonClickScript";
  242. Type cstype = p.GetType ();
  243. StringBuilder cstext2 = new StringBuilder ();
  244. cstext2.Append ("<script type=text/javascript> function DoClick() {");
  245. cstext2.Append ("alert('Text from client script.')} </");
  246. cstext2.Append ("script>");
  247. cs.RegisterClientScriptBlock (cstype, csname2, cstext2.ToString ());
  248. }
  249. [Test]
  250. public void ClientScriptManager_IsRegisterStartupScript ()
  251. {
  252. Page p = new Page ();
  253. String csname1 = "PopupScript";
  254. Type cstype = p.GetType ();
  255. ClientScriptManager cs = p.ClientScript;
  256. String cstext1 = "alert('Hello World');";
  257. cs.RegisterStartupScript (cstype, csname1, cstext1);
  258. Assert.AreEqual (true, cs.IsStartupScriptRegistered (cstype, csname1), "StartupScriptRegisteredFail");
  259. }
  260. [Test]
  261. [Category ("NunitWeb")]
  262. public void ClientScriptManager_RegisterStartupScript ()
  263. {
  264. WebTest t = new WebTest (PageInvoker.CreateOnLoad (RegisterStartupScript));
  265. string html = t.Run ();
  266. if (html.IndexOf ("alert('Hello World');") < 0)
  267. Assert.Fail ("RegisterStartupScriptFail#1");
  268. }
  269. public static void RegisterStartupScript (Page p)
  270. {
  271. String csname1 = "PopupScript";
  272. Type cstype = p.GetType ();
  273. ClientScriptManager cs = p.ClientScript;
  274. String cstext1 = "alert('Hello World');";
  275. cs.RegisterStartupScript (cstype, csname1, cstext1,true);
  276. }
  277. [Test]
  278. [Category ("NunitWeb")]
  279. public void ClientScriptManager_RegisterArrayDeclaration ()
  280. {
  281. WebTest t = new WebTest (PageInvoker.CreateOnLoad (RegisterArrayDeclaration));
  282. string html = t.Run ();
  283. if (html.IndexOf ("var MyArray = new Array(\"1\", \"2\", \"text\");") < 0)
  284. Assert.Fail ("RegisterArrayDeclarationFail#1");
  285. }
  286. public static void RegisterArrayDeclaration (Page p)
  287. {
  288. Type cstype = p.GetType ();
  289. ClientScriptManager cs = p.ClientScript;
  290. String arrName = "MyArray";
  291. String arrValue = "\"1\", \"2\", \"text\"";
  292. // Register the array with the Page class.
  293. cs.RegisterArrayDeclaration (arrName, arrValue);
  294. }
  295. [Test]
  296. [Category ("NunitWeb")]
  297. [Category ("NotWorking")] // Not Implemented
  298. public void ClientScriptManager_RegisterExpandAttribute ()
  299. {
  300. WebTest t = new WebTest (PageInvoker.CreateOnLoad (RegisterExpandAttribute));
  301. string html = t.Run ();
  302. if (html.IndexOf ("Message.title = \"New title from client script.\"") < 0)
  303. Assert.Fail ("RegisterExpandAttributeFail");
  304. }
  305. public static void RegisterExpandAttribute (Page p)
  306. {
  307. ClientScriptManager cs = p.ClientScript;
  308. cs.RegisterExpandoAttribute ("Message", "title", "New title from client script.", true);
  309. }
  310. [Test]
  311. [Category ("NunitWeb")]
  312. public void ClientScriptManager_RegisterHiddenField ()
  313. {
  314. WebTest t = new WebTest (PageInvoker.CreateOnLoad (RegisterHiddenField));
  315. string html = t.Run ();
  316. if (html.IndexOf ("<input type=\"hidden\" name=\"MyHiddenField\" id=\"MyHiddenField\" value=\"3\" />") < 0)
  317. Assert.Fail ("RegisterHiddenFieldFail");
  318. }
  319. public static void RegisterHiddenField (Page p)
  320. {
  321. ClientScriptManager cs = p.ClientScript;
  322. // Define the hidden field name and initial value.
  323. String hiddenName = "MyHiddenField";
  324. String hiddenValue = "3";
  325. // Register the hidden field with the Page class.
  326. cs.RegisterHiddenField (hiddenName, hiddenValue);
  327. }
  328. [Test]
  329. [Category ("NunitWeb")]
  330. [Category ("NotDotNet")] // for dot-net use __CALLBACKID insted __CALLBACKTARGET and __CALLBACKARGUMENT insted __CALLBACKPARAM
  331. public void ClientScriptManager_RegisterForEventValidation_1 ()
  332. {
  333. WebTest t = new WebTest ("EventValidationTest1.aspx");
  334. string html = t.Run ();
  335. FormRequest fr = new FormRequest (t.Response, "form1");
  336. fr.Controls.Add ("__EVENTTARGET");
  337. fr.Controls.Add ("__EVENTARGUMENT");
  338. fr.Controls.Add ("__CALLBACKTARGET");
  339. fr.Controls.Add ("__CALLBACKARGUMENT");
  340. fr.Controls["__EVENTTARGET"].Value = "";
  341. fr.Controls["__EVENTARGUMENT"].Value = "";
  342. fr.Controls ["__CALLBACKTARGET"].Value = "__Page";
  343. t.Request = fr;
  344. html = t.Run ();
  345. if(html.IndexOf("Correct event raised callback.")<0)
  346. Assert.Fail ("RegisterForEventValidationFail#1");
  347. }
  348. [Test]
  349. [Category ("NunitWeb")]
  350. [Category ("NotDotNet")] // for dot-net use __CALLBACKID insted __CALLBACKTARGET and __CALLBACKPARAM insted __CALLBACKARGUMENT
  351. public void ClientScriptManager_RegisterForEventValidation_2 ()
  352. {
  353. WebTest t = new WebTest ("EventValidationTest2.aspx");
  354. string html = t.Run ();
  355. FormRequest fr = new FormRequest (t.Response, "form1");
  356. fr.Controls.Add ("__EVENTTARGET");
  357. fr.Controls.Add ("__EVENTARGUMENT");
  358. fr.Controls.Add ("__CALLBACKTARGET");
  359. fr.Controls.Add ("__CALLBACKARGUMENT");
  360. fr.Controls["__EVENTTARGET"].Value = "";
  361. fr.Controls["__EVENTARGUMENT"].Value = "";
  362. fr.Controls ["__CALLBACKTARGET"].Value = "__Page";
  363. t.Request = fr;
  364. html = t.Run ();
  365. if (html.IndexOf ("Incorrect event raised callback.") < 0)
  366. Assert.Fail ("RegisterForEventValidationFail#2");
  367. }
  368. // Expected Exceptions
  369. [Test]
  370. [ExpectedException (typeof (InvalidOperationException))]
  371. public void ClientScriptManager_RegisterForEventValidationException ()
  372. {
  373. Page p = new Page ();
  374. ClientScriptManager cs = p.ClientScript;
  375. cs.RegisterForEventValidation ("ID", "args");
  376. }
  377. [Test]
  378. [ExpectedException (typeof (ArgumentException))]
  379. public void ClientScriptManager_ValidateEventException_1 ()
  380. {
  381. Page p = new Page ();
  382. ClientScriptManager cs = p.ClientScript;
  383. cs.ValidateEvent ("Exception");
  384. }
  385. [Test]
  386. [ExpectedException (typeof (ArgumentException))]
  387. public void ClientScriptManager_ValidateEventException_2 ()
  388. {
  389. Page p = new Page ();
  390. ClientScriptManager cs = p.ClientScript;
  391. cs.ValidateEvent ("Exception", "args");
  392. }
  393. [Test]
  394. [ExpectedException (typeof (ArgumentNullException))]
  395. public void ClientScriptManager_IsRegisterStartupScriptException ()
  396. {
  397. Page p = new Page ();
  398. String csname1 = "PopupScript";
  399. ClientScriptManager cs = p.ClientScript;
  400. cs.RegisterStartupScript (null, csname1, "");
  401. }
  402. [Test]
  403. [ExpectedException (typeof (ArgumentNullException))]
  404. public void ClientScriptManager_RegisterOnSubmitStatementException ()
  405. {
  406. Page p = new Page ();
  407. String csname = "OnSubmitScript";
  408. ClientScriptManager cs = p.ClientScript;
  409. String cstext = "document.write('Text from OnSubmit statement');";
  410. cs.RegisterOnSubmitStatement (null, csname, cstext);
  411. }
  412. [Test]
  413. [ExpectedException (typeof (ArgumentNullException))]
  414. public void ClientScriptManager_RegisterClientScriptIncludeException_1 ()
  415. {
  416. Page p = new Page ();
  417. String csname = "ButtonClickScript";
  418. Type cstype = p.GetType ();
  419. String csurl = "";
  420. ClientScriptManager cs = p.ClientScript;
  421. cs.RegisterClientScriptInclude (null, csname, csurl);
  422. bool registry = cs.IsClientScriptIncludeRegistered (csname);
  423. }
  424. [Test]
  425. [ExpectedException (typeof (ArgumentNullException))]
  426. public void ClientScriptManager_RegisterClientScriptIncludeException_2 ()
  427. {
  428. Page p = new Page ();
  429. String csname = "ButtonClickScript";
  430. String csurl = "ClientScript.js";
  431. ClientScriptManager cs = p.ClientScript;
  432. cs.RegisterClientScriptInclude (null, csname, csurl);
  433. bool registry = cs.IsClientScriptIncludeRegistered (csname);
  434. }
  435. [Test]
  436. [ExpectedException (typeof (ArgumentNullException))]
  437. public void ClientScriptManager_ClientScriptBlockRegisterException_2 ()
  438. {
  439. Page p = new Page ();
  440. ClientScriptManager cs = p.ClientScript;
  441. String csname2 = "ButtonClickScript";
  442. cs.RegisterClientScriptBlock (null, csname2, "");
  443. }
  444. [Test]
  445. [ExpectedException (typeof (ArgumentNullException))]
  446. public void ClientScriptManager_GetWebResourceUrlException_1 ()
  447. {
  448. Page p = new Page ();
  449. ClientScriptManager cs = p.ClientScript;
  450. String cbReference = cs.GetWebResourceUrl (null, "test");
  451. }
  452. [Test]
  453. [ExpectedException (typeof (ArgumentNullException))]
  454. public void ClientScriptManager_GetWebResourceUrlException_2 ()
  455. {
  456. Page p = new Page ();
  457. ClientScriptManager cs = p.ClientScript;
  458. String cbReference = cs.GetWebResourceUrl (typeof (ClientScriptManagerTest), "");
  459. }
  460. [Test]
  461. [ExpectedException (typeof (InvalidOperationException))]
  462. public void ClientScriptManager_GetCallbackEventReferenceException_1 ()
  463. {
  464. Page p = new Page ();
  465. ClientScriptManager cs = p.ClientScript;
  466. // Define callback references.
  467. String cbReference = cs.GetCallbackEventReference (p, "arg",
  468. "ReceiveServerData1", "");
  469. }
  470. [Test]
  471. [ExpectedException (typeof (ArgumentNullException))]
  472. public void ClientScriptManager_GetCallbackEventReferenceException_2 ()
  473. {
  474. Page p = new Page ();
  475. ClientScriptManager cs = p.ClientScript;
  476. // Define callback references.
  477. String cbReference = cs.GetCallbackEventReference (null, "arg",
  478. "ReceiveServerData1", "");
  479. }
  480. [TestFixtureTearDown]
  481. public void Unload()
  482. {
  483. WebTest.Unload();
  484. }
  485. }
  486. }
  487. #endif