mirror of
https://github.com/BepInEx/mono.git
synced 2026-11-16 17:10:20 -10:00
* WebTest.cs: made the Host property internal. It is used to access the host's application domain when necessary in some tests. * MyTemplateControls.cs: added 2008-10-09 Marek Habersack <[email protected]> * NunitWebResources/TemplateControlParsingTest.aspx: added 2008-10-09 Marek Habersack <[email protected]> * TemplateControlCompilerTest.cs: compile the file on 1.1 as well. Added a test for template parsing in compound controls. svn path=/trunk/mcs/; revision=115324
63 lines
1.6 KiB
C#
63 lines
1.6 KiB
C#
using System;
|
|
using MonoTests.SystemWeb.Framework;
|
|
using NUnit.Framework;
|
|
using System.Web.UI.WebControls;
|
|
using System.Reflection;
|
|
using System.ComponentModel;
|
|
using System.Threading;
|
|
|
|
namespace MonoTests.System.Web.Compilation {
|
|
public class ReadOnlyPropertyControl:TextBox {
|
|
[Bindable (true)]
|
|
public bool MyProp
|
|
{
|
|
get { return true; }
|
|
}
|
|
|
|
}
|
|
|
|
[TestFixture]
|
|
public class TemplateControlCompilerTest
|
|
{
|
|
[Test]
|
|
[NUnit.Framework.Category ("NunitWeb")]
|
|
#if !TARGET_JVM
|
|
[NUnit.Framework.Category ("NotWorking")]
|
|
#endif
|
|
public void ReadOnlyPropertyBindTest ()
|
|
{
|
|
WebTest.CopyResource (GetType (), "ReadOnlyPropertyBind.aspx", "ReadOnlyPropertyBind.aspx");
|
|
WebTest.CopyResource (GetType (), "ReadOnlyPropertyControl.ascx", "ReadOnlyPropertyControl.ascx");
|
|
new WebTest ("ReadOnlyPropertyBind.aspx").Run ();
|
|
}
|
|
|
|
[Test]
|
|
public void ChildTemplatesTest ()
|
|
{
|
|
try {
|
|
WebTest.Host.AppDomain.AssemblyResolve += new ResolveEventHandler (ResolveAssemblyHandler);
|
|
WebTest.CopyResource (GetType (), "TemplateControlParsingTest.aspx", "TemplateControlParsingTest.aspx");
|
|
new WebTest ("TemplateControlParsingTest.aspx").Run ();
|
|
} finally {
|
|
WebTest.Host.AppDomain.AssemblyResolve -= new ResolveEventHandler (ResolveAssemblyHandler);
|
|
}
|
|
}
|
|
|
|
[TestFixtureTearDown]
|
|
public void TearDown ()
|
|
{
|
|
Thread.Sleep (100);
|
|
WebTest.Unload ();
|
|
}
|
|
|
|
public static Assembly ResolveAssemblyHandler (object sender, ResolveEventArgs e)
|
|
{
|
|
if (e.Name != "System.Web_test")
|
|
return null;
|
|
|
|
return Assembly.GetExecutingAssembly ();
|
|
}
|
|
}
|
|
}
|
|
|