TemplateControlCompilerTest.cs 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. using System;
  2. using MonoTests.SystemWeb.Framework;
  3. using NUnit.Framework;
  4. using System.Web.UI.WebControls;
  5. using System.Reflection;
  6. using System.ComponentModel;
  7. using System.Threading;
  8. namespace MonoTests.System.Web.Compilation {
  9. public class ReadOnlyPropertyControl:TextBox {
  10. [Bindable (true)]
  11. public bool MyProp
  12. {
  13. get { return true; }
  14. }
  15. }
  16. [TestFixture]
  17. public class TemplateControlCompilerTest
  18. {
  19. [Test]
  20. [NUnit.Framework.Category ("NunitWeb")]
  21. #if !TARGET_JVM
  22. [NUnit.Framework.Category ("NotWorking")]
  23. #endif
  24. public void ReadOnlyPropertyBindTest ()
  25. {
  26. WebTest.CopyResource (GetType (), "ReadOnlyPropertyBind.aspx", "ReadOnlyPropertyBind.aspx");
  27. WebTest.CopyResource (GetType (), "ReadOnlyPropertyControl.ascx", "ReadOnlyPropertyControl.ascx");
  28. new WebTest ("ReadOnlyPropertyBind.aspx").Run ();
  29. }
  30. [Test]
  31. public void ChildTemplatesTest ()
  32. {
  33. try {
  34. WebTest.Host.AppDomain.AssemblyResolve += new ResolveEventHandler (ResolveAssemblyHandler);
  35. WebTest.CopyResource (GetType (), "TemplateControlParsingTest.aspx", "TemplateControlParsingTest.aspx");
  36. new WebTest ("TemplateControlParsingTest.aspx").Run ();
  37. } finally {
  38. WebTest.Host.AppDomain.AssemblyResolve -= new ResolveEventHandler (ResolveAssemblyHandler);
  39. }
  40. }
  41. [TestFixtureTearDown]
  42. public void TearDown ()
  43. {
  44. Thread.Sleep (100);
  45. WebTest.Unload ();
  46. }
  47. public static Assembly ResolveAssemblyHandler (object sender, ResolveEventArgs e)
  48. {
  49. if (e.Name != "System.Web_test")
  50. return null;
  51. return Assembly.GetExecutingAssembly ();
  52. }
  53. }
  54. }