Imported Upstream version 3.6.0

Former-commit-id: da6be194a6b1221998fc28233f2503bd61dd9d14
This commit is contained in:
Jo Shields
2014-08-13 10:39:27 +01:00
commit a575963da9
50588 changed files with 8155799 additions and 0 deletions

View File

@@ -0,0 +1,61 @@
//
// AppResourcesCompilerTest.cs
//
// Author:
// Marek Habersack <mhabersack@novell.com>
//
// Copyright (C) 2009 Novell, Inc (http://novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#if NET_2_0
using System;
using System.Web;
using System.Web.Compilation;
using System.Threading;
using NUnit.Framework;
using MonoTests.SystemWeb.Framework;
using MonoTests.stand_alone.WebHarness;
namespace MonoTests.System.Web.Compilation
{
[TestFixture]
public class AppResourcesCompilerTest
{
[TestFixtureSetUp]
public void SetUp ()
{
WebTest.CopyResource (this.GetType (), "GlobalResourcesLocalization.aspx", "GlobalResourcesLocalization.aspx");
}
[Test (Description="Bug #548768")]
public void GlobalResourcesLocalization ()
{
string pageHtml = new WebTest ("GlobalResourcesLocalization.aspx").Run ();
string renderedHtml = HtmlDiff.GetControlFromPageHtml (pageHtml);
string originalHtml = "<input type=\"submit\" name=\"button1\" value=\"Recharger\" id=\"button1\" />";
HtmlDiff.AssertAreEqual (originalHtml, renderedHtml, "#A1");
}
}
}
#endif

View File

@@ -0,0 +1,240 @@
//
// Tests for System.Web.UI.WebControls.ListBoxTest.cs
//
// Author:
// Vladimir Krasnov (vladimirk@mainsoft.com)
//
//
// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#if NET_2_0
using NUnit.Framework;
using System;
using System.IO;
using System.Drawing;
using System.Collections.Specialized;
using System.Globalization;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using MonoTests.stand_alone.WebHarness;
using MonoTests.SystemWeb.Framework;
using System.Web.Compilation;
namespace MonoTests.System.Web.Compilation
{
public class SettingTestingType
{
private string strProp;
private int intProp;
private DateTime dateTimeProp;
private Type typeProp;
public string StrProp {
get { return strProp; }
set { strProp = value; }
}
public int IntProp {
get { return intProp; }
set { intProp = value; }
}
public DateTime DateTimeProp {
get { return dateTimeProp; }
set { dateTimeProp = value; }
}
public Type TypeProp {
get { return typeProp; }
set { typeProp = value; }
}
}
[TestFixture]
public class AppSettingsExpressionBuilderTest
{
[Test] // GetAppSetting (String)
[Category ("NunitWeb")]
public void GetAppSetting1 ()
{
PageDelegates pd = new PageDelegates ();
pd.Load = GetAppSetting1_Load;
WebTest test = new WebTest (new PageInvoker (pd));
test.Run ();
}
[Test] // GetAppSetting (String)
public void GetAppSetting1_Key_DoesNotExist ()
{
try {
AppSettingsExpressionBuilder.GetAppSetting ("DoesNotExist");
Assert.Fail ("#1");
} catch (InvalidOperationException ex) {
// The application setting 'DoesNotExist' was
// not found in the applications configuration
Assert.AreEqual (typeof (InvalidOperationException), ex.GetType (), "#2");
Assert.IsNull (ex.InnerException, "#3");
Assert.IsNotNull (ex.Message, "#4");
Assert.IsTrue (ex.Message.IndexOf ("'DoesNotExist'") != -1, "#5");
}
}
[Test] // GetAppSetting (String)
public void GetAppSetting1_Key_Null ()
{
try {
AppSettingsExpressionBuilder.GetAppSetting ((string) null);
Assert.Fail ("#1");
} catch (InvalidOperationException ex) {
// The application setting '' was not found in
// the applications configuration
Assert.AreEqual (typeof (InvalidOperationException), ex.GetType (), "#2");
Assert.IsNull (ex.InnerException, "#3");
Assert.IsNotNull (ex.Message, "#4");
Assert.IsTrue (ex.Message.IndexOf ("''") != -1, "#5");
}
}
[Test] // GetAppSetting (String, Type, String)
[Category ("NunitWeb")]
public void GetAppSetting2 ()
{
PageDelegates pd = new PageDelegates ();
pd.Load = GetAppSetting2_Load;
WebTest test = new WebTest (new PageInvoker (pd));
test.Run ();
}
[Test] // GetAppSetting (String, Type, String)
public void GetAppSetting2_Key_Null ()
{
try {
AppSettingsExpressionBuilder.GetAppSetting (
(string) null,
typeof (SettingTestingType),
"StrProp");
Assert.Fail ("#1");
} catch (InvalidOperationException ex) {
// The application setting '' was not found in
// the applications configuration
Assert.AreEqual (typeof (InvalidOperationException), ex.GetType (), "#2");
Assert.IsNull (ex.InnerException, "#3");
Assert.IsNotNull (ex.Message, "#4");
Assert.IsTrue (ex.Message.IndexOf ("''") != -1, "#5");
}
}
[Test]
public void SupportsEvaluate ()
{
AppSettingsExpressionBuilder aseb = new AppSettingsExpressionBuilder ();
Assert.IsTrue (aseb.SupportsEvaluate);
}
public static void GetAppSetting1_Load (Page p)
{
object o = AppSettingsExpressionBuilder.GetAppSetting ("strvalue");
Assert.AreEqual (typeof (string), o.GetType (), "#A1");
Assert.AreEqual ("str", o, "#A2");
o = AppSettingsExpressionBuilder.GetAppSetting ("intvalue");
Assert.AreEqual (typeof (string), o.GetType (), "#B1");
Assert.AreEqual ("123", o, "#B2");
}
public static void GetAppSetting2_Load (Page p)
{
object o = AppSettingsExpressionBuilder.GetAppSetting ("strvalue", typeof (SettingTestingType), "StrProp");
Assert.AreEqual (typeof (string), o.GetType (), "#A1");
Assert.AreEqual ("str", o, "#A2");
// property does not exist
o = AppSettingsExpressionBuilder.GetAppSetting ("strvalue", typeof (SettingTestingType), "NotExistsProp");
Assert.AreEqual (typeof (string), o.GetType (), "#B1");
Assert.AreEqual ("str", o, "#B2");
o = AppSettingsExpressionBuilder.GetAppSetting ("intvalue", typeof (SettingTestingType), "IntProp");
Assert.AreEqual (typeof (int), o.GetType (), "#C1");
Assert.AreEqual (123, o, "#C2");
// conversion
o = AppSettingsExpressionBuilder.GetAppSetting ("intvalue", typeof (SettingTestingType), "StrProp");
Assert.AreEqual (typeof (string), o.GetType (), "#D1");
Assert.AreEqual ("123", o, "#D2");
// property does not exist
o = AppSettingsExpressionBuilder.GetAppSetting ("intvalue", typeof (SettingTestingType), "NotExistsProp");
Assert.AreEqual (typeof (string), o.GetType (), "#E1");
Assert.AreEqual ("123", o, "#E2");
// targetType null
o = AppSettingsExpressionBuilder.GetAppSetting ("intvalue", (Type) null, "NotExistsProp");
Assert.AreEqual (typeof (string), o.GetType (), "#F1");
Assert.AreEqual ("123", o, "#F2");
// conversion failed
try {
AppSettingsExpressionBuilder.GetAppSetting ("intvalue",
typeof (SettingTestingType), "DateTimeProp");
Assert.Fail ("#G1");
} catch (FormatException ex) {
// String was not recognized as a valid DateTime
Assert.AreEqual (typeof (FormatException), ex.GetType (), "#G2");
Assert.IsNotNull (ex.Message, "#G3");
}
// conversion not supported
try {
AppSettingsExpressionBuilder.GetAppSetting ("intvalue",
typeof (SettingTestingType), "TypeProp");
Assert.Fail ("#H1");
} catch (InvalidOperationException ex) {
// Could not convert the AppSetting '123' to the
// type 'Type' on property 'TypeProp'
Assert.AreEqual (typeof (InvalidOperationException), ex.GetType (), "#H2");
Assert.IsNull (ex.InnerException, "#H3");
Assert.IsNotNull (ex.Message, "#H4");
Assert.IsTrue (ex.Message.IndexOf ("'123'") != -1, "#H5");
Assert.IsTrue (ex.Message.IndexOf ("'Type'") != -1, "#H6");
Assert.IsTrue (ex.Message.IndexOf ("'TypeProp'") != -1, "#H7");
}
// propertyName null
try {
AppSettingsExpressionBuilder.GetAppSetting ("intvalue",
typeof (SettingTestingType), (string) null);
Assert.Fail ("#I1");
} catch (ArgumentNullException ex) {
Assert.AreEqual (typeof (ArgumentNullException), ex.GetType (), "#I2");
Assert.IsNull (ex.InnerException, "#I3");
Assert.IsNotNull (ex.Message, "#I4");
//Assert.AreEqual ("key", ex.ParamName, "#I5");
}
}
}
}
#endif

View File

@@ -0,0 +1,64 @@
//
// BuildManagerTest.cs
//
// Author:
// Marek Habersack <mhabersack@novell.com>
//
// Copyright (C) 2010 Novell, Inc (http://novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
using System.IO;
using System.Reflection;
using System.Web;
using System.Web.Compilation;
using System.Web.Hosting;
using NUnit.Framework;
using MonoTests.Common;
namespace MonoTests.System.Web.Compilation
{
[TestFixture]
[Serializable]
public class BuildManagerTest
{
#if NET_4_0
[Test]
[Ignore ("Pending investigation if it is indeed the correct test.")]
public void GetGlobalAsaxType ()
{
AssertExtensions.Throws<InvalidOperationException> (() => {
BuildManager.GetGlobalAsaxType ();
}, "#A1");
}
[Test]
public void TargetFramework ()
{
Assert.AreEqual (".NETFramework,Version=v4.0", BuildManager.TargetFramework.FullName, "#A1-1");
Assert.AreEqual (".NETFramework", BuildManager.TargetFramework.Identifier, "#A1-2");
Assert.AreEqual ("", BuildManager.TargetFramework.Profile, "#A1-3");
Assert.AreEqual (new Version (4, 0), BuildManager.TargetFramework.Version, "#A1-4");
}
#endif
}
}

View File

@@ -0,0 +1,81 @@
//
// RouteValueExpressionBuilder.cs
//
// Authors:
// Marek Habersack <mhabersack@novell.com>
//
// Copyright (C) 2010 Novell, Inc. (http://novell.com/)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#if NET_4_0
using System;
using System.CodeDom;
using System.IO;
using System.Reflection;
using System.Web;
using System.Web.Compilation;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Routing;
using NUnit.Framework;
using MonoTests.SystemWeb.Framework;
using MonoTests.stand_alone.WebHarness;
using MonoTests.Common;
namespace MonoTests.System.Web.Compilation
{
[TestFixture]
public class BuildProviderTest
{
[Test]
public void RegisterBuildProvider ()
{
AssertExtensions.Throws<ArgumentException> (() => {
BuildProvider.RegisterBuildProvider (null, typeof (FooBuildProvider));
}, "#A1-1");
AssertExtensions.Throws<ArgumentException> (() => {
BuildProvider.RegisterBuildProvider (String.Empty, typeof (FooBuildProvider));
}, "#A1-2");
AssertExtensions.Throws<ArgumentNullException> (() => {
BuildProvider.RegisterBuildProvider (".foo", null);
}, "#A1-3");
AssertExtensions.Throws<ArgumentException> (() => {
BuildProvider.RegisterBuildProvider (".foo", typeof (string));
}, "#A1-4");
// This would have worked if we called the method during the pre-application start stage
// (we have a test for this in the standalone test suite)
AssertExtensions.Throws<InvalidOperationException> (() => {
BuildProvider.RegisterBuildProvider (".foo", typeof (BuildProvider));
}, "#A1-5");
}
}
class FooBuildProvider : BuildProvider
{
}
}
#endif

View File

@@ -0,0 +1,90 @@
2010-01-19 Marek Habersack <mhabersack@novell.com>
* TemplateControlCompilerTest.cs: added test for bug #568631
2009-08-26 Marek Habersack <mhabersack@novell.com>
* TemplateControlCompilerTest.cs: added test for bug #400807
2009-08-25 Marek Habersack <mhabersack@novell.com>
* TemplateControlCompilerTest.cs: added test for bug #323719
Added test for bug #367273
2009-08-18 Marek Habersack <mhabersack@novell.com>
* TemplateControlCompilerTest.cs: added test for bug #525104 and
improved test for bug #517656
2009-07-08 Marek Habersack <mhabersack@novell.com>
* TemplateControlCompilerTest.cs: added test for bug #520024
2009-07-06 Raja R Harinath <harinath@hurrynot.org>
* TemplateControlCompilerTest.cs (InvalidPropertyBindTest1):
Don't use 'typeof' on a System.Web internal exception type.
(InvalidPropertyBindTest3): Likewise.
2009-06-30 Marek Habersack <mhabersack@novell.com>
* TemplateControlCompilerTest.cs: added test for bug #517656
2009-06-04 Marek Habersack <mhabersack@novell.com>
* TemplateControlCompilerTest.cs: added test for bug #508888
2009-05-10 Marek Habersack <mhabersack@novell.com>
* TemplateControlCompilerTest.cs: added a test for expressions in
list control items.
2009-04-28 Marek Habersack <mhabersack@novell.com>
* TemplateControlCompilerTest.cs: added test for bug #498637
2009-04-16 Marek Habersack <mhabersack@novell.com>
* TemplateControlCompilerTest.cs: added test for bug #493639
2008-12-08 Marek Habersack <mhabersack@novell.com>
* TemplateControlCompilerTest.cs: added another valid Bind
expression test.
2008-12-01 Marek Habersack <mhabersack@novell.com>
* TemplateControlCompilerTest.cs: Added test for bug #449970
2008-11-21 Marek Habersack <mhabersack@novell.com>
* TemplateControlCompilerTest.cs: added simple data source for
Bind tests.
Added 8 tests for valid and invalid Bind expressions.
2008-10-09 Marek Habersack <mhabersack@novell.com>
* TemplateControlCompilerTest.cs: compile the file on 1.1 as well.
Added a test for template parsing in compound controls.
2008-02-08 Gert Driesen <drieseng@users.sourceforge.net>
* AppSettingsExpressionBuilderTest.cs: Added and improved tests for
GetAppSetting overloads.
2007-12-23 Vladimir Krasnov <vladimirk@mainsoft.com>
* added AppSettingsExpressionBuilderTest.cs
2006-06-21 Andrew Skiba <andrews@mainsoft.com>
* TemplateControlCompilerTest.cs: NunitWeb refactoring
2006-06-18 Andrew Skiba <andrews@mainsoft.com>
* TemplateControlCompilerTest.cs: new test.
2006-01-20 Chris Toshok <toshok@ximian.com>
* ClientBuildManagerParameterTest.cs: new test.

View File

@@ -0,0 +1,58 @@
//
// ClientBuildManagerParameterTest.cs
// - unit tests for System.Web.Compilation.ClientBuildManagerParameter
//
// Author:
// Chris Toshok <toshok@ximian.com>
//
// Copyright (C) 2006 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#if NET_2_0
using NUnit.Framework;
using System;
using System.Configuration;
using System.Web.Compilation;
using System.Web;
using System.Web.UI;
namespace MonoTests.System.Web.Compilation {
[TestFixture]
public class ClientBuildManagerParameterTest {
[Test]
public void Defaults ()
{
ClientBuildManagerParameter p = new ClientBuildManagerParameter ();
Assert.AreEqual (PrecompilationFlags.Default, p.PrecompilationFlags, "A1");
Assert.IsNull (p.StrongNameKeyContainer, "A2");
Assert.IsNull (p.StrongNameKeyFile, "A3");
}
}
}
#endif

View File

@@ -0,0 +1,289 @@
//
// RouteUrlExpressionBuilder.cs
//
// Authors:
// Marek Habersack <mhabersack@novell.com>
//
// Copyright (C) 2010 Novell, Inc. (http://novell.com/)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#if NET_4_0
using System;
using System.CodeDom;
using System.IO;
using System.Reflection;
using System.Web;
using System.Web.Compilation;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Routing;
using NUnit.Framework;
using MonoTests.SystemWeb.Framework;
using MonoTests.stand_alone.WebHarness;
using MonoTests.Common;
namespace MonoTests.System.Web.Compilation
{
[TestFixture]
public class RouteUrlExpressionBuilderTest
{
[Test]
public void EvaluateExpression ()
{
RouteTable.Routes.Clear ();
RouteTable.Routes.Add (new Route ("{foo}-foo", new PageRouteHandler ("~/default.aspx")));
RouteTable.Routes.Add ("bar1", new Route ("{bar}-foo", new PageRouteHandler ("~/bar.aspx")));
RouteTable.Routes.Add ("bar2", new Route ("some-{bar}", new PageRouteHandler ("~/some-bar.aspx")));
var bldr = new RouteUrlExpressionBuilder ();
var entry = CreatePropertyEntry ("foo=test", "RouteUrl");
var context = new ExpressionBuilderContext (new FakePage ());
object obj = bldr.EvaluateExpression (null, entry, null, context);
Assert.AreEqual ("/test-foo", obj, "#A1");
entry = CreatePropertyEntry ("bar=test", "RouteUrl");
obj = bldr.EvaluateExpression (null, entry, null, context);
Assert.AreEqual ("/test-foo", obj, "#A2-1");
entry = CreatePropertyEntry ("bar=test,routename=bar2", "RouteUrl");
obj = bldr.EvaluateExpression (null, entry, null, context);
Assert.AreEqual ("/some-test", obj, "#A2-2");
entry = CreatePropertyEntry ("bar=test,routename=bar1", "RouteUrl");
obj = bldr.EvaluateExpression (null, entry, null, context);
Assert.AreEqual ("/test-foo", obj, "#A2-3");
entry = CreatePropertyEntry ("bar=test,routename=noroute", "RouteUrl");
try {
obj = bldr.EvaluateExpression (null, entry, null, context);
Assert.Fail ("#A3");
} catch (ArgumentException) {
// success
}
entry = CreatePropertyEntry ("nosuchparam=test", "RouteUrl");
obj = bldr.EvaluateExpression (null, entry, null, context);
Assert.IsNull (obj, "#A4");
AssertExtensions.Throws<NullReferenceException> (() => {
bldr.EvaluateExpression (null, null, null, context);
}, "#A5-1");
AssertExtensions.Throws<NullReferenceException> (() => {
bldr.EvaluateExpression (null, entry, null, null);
}, "#A5-2");
}
BoundPropertyEntry CreatePropertyEntry (string expression, string expressionPrefix)
{
var entry = Activator.CreateInstance (typeof (BoundPropertyEntry), true) as BoundPropertyEntry;
entry.Expression = expression;
entry.ExpressionPrefix = expressionPrefix;
return entry;
}
[Test]
public void GetRouteUrl ()
{
AssertExtensions.Throws<ArgumentNullException> (() => {
RouteUrlExpressionBuilder.GetRouteUrl (null, "bar=test");
}, "#A1-1");
var t = new WebTest (PageInvoker.CreateOnLoad (GetRouteUrl_Load));
t.Run ();
}
public static void GetRouteUrl_Load (Page p)
{
RouteTable.Routes.Clear ();
RouteTable.Routes.Add (new Route ("{foo}-foo", new PageRouteHandler ("~/default.aspx")));
RouteTable.Routes.Add ("bar1", new Route ("{bar}-foo", new PageRouteHandler ("~/bar.aspx")));
var ctl = new Control ();
string url = RouteUrlExpressionBuilder.GetRouteUrl (new Control (), "foobar=test");
Assert.IsNull (url, "#A2");
url = RouteUrlExpressionBuilder.GetRouteUrl (new Control (), "bar=test");
Assert.IsNotNull (url, "#A3-1");
Assert.AreEqual ("/NunitWeb/test-foo", url, "#A3-2");
url = RouteUrlExpressionBuilder.GetRouteUrl (new Control (), "routename=bar1,bar=test");
Assert.IsNotNull (url, "#A4-1");
Assert.AreEqual ("/NunitWeb/test-foo", url, "#A4-2");
url = RouteUrlExpressionBuilder.GetRouteUrl (new Control (), "ROUTEname=bar1,bar=test");
Assert.IsNotNull (url, "#A5-1");
Assert.AreEqual ("/NunitWeb/test-foo", url, "#A5-2");
url = RouteUrlExpressionBuilder.GetRouteUrl (new Control (), " routename = bar1, bar = test ");
Assert.IsNotNull (url, "#A6-1");
Assert.AreEqual ("/NunitWeb/test-foo", url, "#A6-2");
AssertExtensions.Throws<InvalidOperationException> (() => {
url = RouteUrlExpressionBuilder.GetRouteUrl (new Control (), "routename");
}, "#A7-1");
AssertExtensions.Throws<InvalidOperationException> (() => {
url = RouteUrlExpressionBuilder.GetRouteUrl (new Control (), String.Empty);
}, "#A7-2");
AssertExtensions.Throws<InvalidOperationException> (() => {
url = RouteUrlExpressionBuilder.GetRouteUrl (new Control (), null);
}, "#A7-2");
}
[Test]
public void TryParseRouteExpression ()
{
string routeName;
var rvd = new RouteValueDictionary ();
Assert.IsFalse (RouteUrlExpressionBuilder.TryParseRouteExpression (null, rvd, out routeName), "#A1-1");
Assert.IsFalse (RouteUrlExpressionBuilder.TryParseRouteExpression (String.Empty, rvd, out routeName), "#A1-2");
Assert.IsFalse (RouteUrlExpressionBuilder.TryParseRouteExpression ("route", rvd, out routeName), "#A1-3");
Assert.IsTrue (RouteUrlExpressionBuilder.TryParseRouteExpression ("route=", rvd, out routeName), "#A1-4");
Assert.AreEqual (1, rvd.Count, "#A1-4-1");
Assert.AreEqual (String.Empty, rvd ["route"], "#A1-4-2");
AssertExtensions.Throws<NullReferenceException> (() => {
RouteUrlExpressionBuilder.TryParseRouteExpression ("foo=bar", null, out routeName);
}, "#A1-5");
rvd.Clear ();
Assert.IsTrue (RouteUrlExpressionBuilder.TryParseRouteExpression ("foo=bar", rvd, out routeName), "#A2-1");
Assert.AreEqual (1, rvd.Count, "#A2-2");
Assert.AreEqual ("bar", rvd ["foo"], "#A2-3");
Assert.IsNull (routeName, "#A2-4");
rvd.Clear ();
Assert.IsTrue (RouteUrlExpressionBuilder.TryParseRouteExpression ("routeName=route,foo=bar,baz=zonk", rvd, out routeName), "#A3-1");
Assert.AreEqual (2, rvd.Count, "#A3-2");
Assert.AreEqual ("bar", rvd ["foo"], "#A3-3");
Assert.AreEqual ("zonk", rvd ["baz"], "#A3-3");
Assert.IsNotNull (routeName, "#A3-5");
Assert.AreEqual ("route", routeName, "#A3-6");
rvd.Clear ();
Assert.IsTrue (RouteUrlExpressionBuilder.TryParseRouteExpression (" rOUteName=route , foo=bar\t, baz =\t zonk \t ", rvd, out routeName), "#A4-1");
Assert.AreEqual (2, rvd.Count, "#A4-2");
Assert.AreEqual ("bar", rvd ["foo"], "#A4-3");
Assert.AreEqual ("zonk", rvd ["baz"], "#A4-3");
Assert.IsNotNull (routeName, "#A4-5");
Assert.AreEqual ("route", routeName, "#A4-6");
rvd.Clear ();
Assert.IsFalse (RouteUrlExpressionBuilder.TryParseRouteExpression ("foo=bar,route,baz=zonk", rvd, out routeName), "#A5-1");
Assert.AreEqual (1, rvd.Count, "#A5-2");
Assert.AreEqual ("bar", rvd ["foo"], "#A5-3");
rvd.Clear ();
Assert.IsFalse (RouteUrlExpressionBuilder.TryParseRouteExpression ("foo=bar,route==,baz=zonk", rvd, out routeName), "#A6-1");
Assert.AreEqual (1, rvd.Count, "#A6-2");
Assert.AreEqual ("bar", rvd ["foo"], "#A6-3");
rvd.Clear ();
Assert.IsFalse (RouteUrlExpressionBuilder.TryParseRouteExpression ("route==", rvd, out routeName), "#A7-1");
Assert.AreEqual (0, rvd.Count, "#A7-2");
rvd.Clear ();
Assert.IsFalse (RouteUrlExpressionBuilder.TryParseRouteExpression ("route==stuff", rvd, out routeName), "#A8-1");
Assert.AreEqual (0, rvd.Count, "#A8-2");
rvd.Clear ();
Assert.IsTrue (RouteUrlExpressionBuilder.TryParseRouteExpression ("route=stuff1,route=stuff2", rvd, out routeName), "#A9-1");
Assert.AreEqual (1, rvd.Count, "#A9-2");
Assert.AreEqual ("stuff2", rvd ["route"], "#A9-3");
rvd.Clear ();
Assert.IsFalse (RouteUrlExpressionBuilder.TryParseRouteExpression ("=stuff", rvd, out routeName), "#A10-1");
Assert.AreEqual (0, rvd.Count, "#A10-2");
rvd.Clear ();
Assert.IsTrue (RouteUrlExpressionBuilder.TryParseRouteExpression ("routeName=route,routename=route2,foo=bar,baz=zonk", rvd, out routeName), "#A11-1");
Assert.AreEqual (2, rvd.Count, "#A11-2");
Assert.AreEqual ("bar", rvd ["foo"], "#A11-3");
Assert.AreEqual ("zonk", rvd ["baz"], "#A11-3");
Assert.IsNotNull (routeName, "#A11-5");
Assert.AreEqual ("route2", routeName, "#A11-6");
}
[Test]
public void GetCodeExpression ()
{
var bldr = new RouteUrlExpressionBuilder ();
var entry = CreatePropertyEntry ("foo=test", "RouteUrl");
var context = new ExpressionBuilderContext (new FakePage ());
CodeExpression expr;
AssertExtensions.Throws<NullReferenceException> (() => {
expr = bldr.GetCodeExpression (null, "data", context);
}, "#A1-1");
expr = bldr.GetCodeExpression (entry, null, context);
Assert.IsNotNull (expr, "#A2");
expr = bldr.GetCodeExpression (entry, "data", null);
Assert.IsNotNull (expr, "#A3");
expr = bldr.GetCodeExpression (entry, null, null);
Assert.IsNotNull (expr, "#A4-1");
Assert.AreEqual (typeof (CodeMethodInvokeExpression), expr.GetType (), "#A4-2");
var invoke = expr as CodeMethodInvokeExpression;
Assert.AreEqual (typeof (CodeTypeReferenceExpression), invoke.Method.TargetObject.GetType (), "#A4-3");
var tref = invoke.Method.TargetObject as CodeTypeReferenceExpression;
Assert.AreEqual ("System.Web.Compilation.RouteUrlExpressionBuilder", tref.Type.BaseType, "#A4-4");
Assert.AreEqual ("GetRouteUrl", invoke.Method.MethodName, "#A4-5");
Assert.AreEqual (2, invoke.Parameters.Count, "#A5-1");
Assert.AreEqual (typeof (CodeThisReferenceExpression), invoke.Parameters [0].GetType (), "#A5-2");
Assert.AreEqual (typeof (CodePrimitiveExpression), invoke.Parameters [1].GetType (), "#A5-3");
var pex = invoke.Parameters [1] as CodePrimitiveExpression;
Assert.AreEqual ("foo=test", pex.Value, "#A5-4");
}
}
class FakePage : Page
{
private HttpContext ctx;
// don't call base class (so _context is never set to a non-null value)
protected internal override HttpContext Context
{
get
{
if (ctx == null) {
ctx = new HttpContext (
new HttpRequest ("default.aspx", "http://mono-project.com/", "q=1&q2=2"),
new HttpResponse (new StringWriter ())
);
}
return ctx;
}
}
}
}
#endif

View File

@@ -0,0 +1,348 @@
using System;
using System.Collections.Generic;
using MonoTests.SystemWeb.Framework;
using MonoTests.stand_alone.WebHarness;
using NUnit.Framework;
using System.Web;
using System.Web.Compilation;
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; }
}
}
#if NET_2_0
public class BindTestDataItem
{
int data;
public int Data {
get { return data; }
set { data = value; }
}
public BindTestDataItem (int data)
{
this.data = data;
}
}
public class BindTestDataSource
{
public IList <BindTestDataItem> GetData ()
{
return new List <BindTestDataItem> {new BindTestDataItem (0), new BindTestDataItem (1)};
}
}
#endif
[TestFixture]
public class TemplateControlCompilerTest
{
[TestFixtureSetUp]
public void TemplateControlCompiler_Init ()
{
WebTest.CopyResource (GetType (), "ReadOnlyPropertyBind.aspx", "ReadOnlyPropertyBind.aspx");
WebTest.CopyResource (GetType (), "ReadOnlyPropertyControl.ascx", "ReadOnlyPropertyControl.ascx");
WebTest.CopyResource (GetType (), "TemplateControlParsingTest.aspx", "TemplateControlParsingTest.aspx");
WebTest.CopyResource (GetType (), "ServerSideControlsInScriptBlock.aspx", "ServerSideControlsInScriptBlock.aspx");
WebTest.CopyResource (GetType (), "ServerControlInClientSideComment.aspx", "ServerControlInClientSideComment.aspx");
WebTest.CopyResource (GetType (), "UnquotedAngleBrackets.aspx", "UnquotedAngleBrackets.aspx");
WebTest.CopyResource (GetType (), "FullTagsInText.aspx", "FullTagsInText.aspx");
WebTest.CopyResource (GetType (), "TagsExpressionsAndCommentsInText.aspx", "TagsExpressionsAndCommentsInText.aspx");
WebTest.CopyResource (GetType (), "NewlineInCodeExpression.aspx", "NewlineInCodeExpression.aspx");
WebTest.CopyResource (GetType (), "DuplicateControlsInClientComment.aspx", "DuplicateControlsInClientComment.aspx");
WebTest.CopyResource (GetType (), "TagsNestedInClientTag.aspx", "TagsNestedInClientTag.aspx");
WebTest.CopyResource (GetType (), "ConditionalClientComments.aspx", "ConditionalClientComments.aspx");
#if NET_2_0
WebTest.CopyResource (GetType (), "InvalidPropertyBind1.aspx", "InvalidPropertyBind1.aspx");
WebTest.CopyResource (GetType (), "InvalidPropertyBind2.aspx", "InvalidPropertyBind2.aspx");
WebTest.CopyResource (GetType (), "InvalidPropertyBind3.aspx", "InvalidPropertyBind3.aspx");
WebTest.CopyResource (GetType (), "InvalidPropertyBind4.aspx", "InvalidPropertyBind4.aspx");
WebTest.CopyResource (GetType (), "ValidPropertyBind1.aspx", "ValidPropertyBind1.aspx");
WebTest.CopyResource (GetType (), "ValidPropertyBind2.aspx", "ValidPropertyBind2.aspx");
WebTest.CopyResource (GetType (), "ValidPropertyBind3.aspx", "ValidPropertyBind3.aspx");
WebTest.CopyResource (GetType (), "ValidPropertyBind4.aspx", "ValidPropertyBind4.aspx");
WebTest.CopyResource (GetType (), "ValidPropertyBind5.aspx", "ValidPropertyBind5.aspx");
WebTest.CopyResource (GetType (), "NoBindForMethodsWithBindInName.aspx", "NoBindForMethodsWithBindInName.aspx");
WebTest.CopyResource (GetType (), "ReadWritePropertyControl.ascx", "ReadWritePropertyControl.ascx");
WebTest.CopyResource (GetType (), "ContentPlaceHolderInTemplate.aspx", "ContentPlaceHolderInTemplate.aspx");
WebTest.CopyResource (GetType (), "ContentPlaceHolderInTemplate.master", "ContentPlaceHolderInTemplate.master");
WebTest.CopyResource (GetType (), "LinkInHeadWithEmbeddedExpression.aspx", "LinkInHeadWithEmbeddedExpression.aspx");
WebTest.CopyResource (GetType (), "ExpressionInListControl.aspx", "ExpressionInListControl.aspx");
WebTest.CopyResource (GetType (), "PreprocessorDirectivesInMarkup.aspx", "PreprocessorDirectivesInMarkup.aspx");
WebTest.CopyResource (GetType (), "OneLetterIdentifierInCodeRender.aspx", "OneLetterIdentifierInCodeRender.aspx");
WebTest.CopyResource (GetType (), "NestedParserFileText.aspx", "NestedParserFileText.aspx");
WebTest.CopyResource (GetType (), "TagWithExpressionWithinAttribute.aspx", "TagWithExpressionWithinAttribute.aspx");
WebTest.CopyResource (GetType (), "EnumConverter_Bug578586.aspx", "EnumConverter_Bug578586.aspx");
#endif
}
[Test]
[NUnit.Framework.Category ("NunitWeb")]
#if !TARGET_JVM
[NUnit.Framework.Category ("NotWorking")]
#endif
public void ReadOnlyPropertyBindTest ()
{
new WebTest ("ReadOnlyPropertyBind.aspx").Run ();
}
#if NET_2_0
// Test for bug #449970
[Test]
public void MasterPageContentPlaceHolderInTemplate ()
{
new WebTest ("ContentPlaceHolderInTemplate.aspx").Run ();
}
[Test]
[ExpectedException ("System.Web.Compilation.CompilationException")]
public void InvalidPropertyBindTest1 ()
{
new WebTest ("InvalidPropertyBind1.aspx").Run ();
}
[Test]
[ExpectedException (typeof (HttpParseException))]
public void InvalidPropertyBindTest2 ()
{
new WebTest ("InvalidPropertyBind2.aspx").Run ();
}
[Test]
[ExpectedException ("System.Web.Compilation.CompilationException")]
public void InvalidPropertyBindTest3 ()
{
new WebTest ("InvalidPropertyBind3.aspx").Run ();
}
[Test]
[ExpectedException (typeof (HttpParseException))]
public void InvalidPropertyBindTest4 ()
{
new WebTest ("InvalidPropertyBind4.aspx").Run ();
}
[Test]
public void ValidPropertyBindTest1 ()
{
new WebTest ("ValidPropertyBind1.aspx").Run ();
}
[Test]
public void ValidPropertyBindTest2 ()
{
new WebTest ("ValidPropertyBind2.aspx").Run ();
}
[Test]
public void ValidPropertyBindTest3 ()
{
new WebTest ("ValidPropertyBind3.aspx").Run ();
}
[Test]
public void ValidPropertyBindTest4 ()
{
new WebTest ("ValidPropertyBind4.aspx").Run ();
}
[Test]
public void ValidPropertyBindTest5 ()
{
new WebTest ("ValidPropertyBind5.aspx").Run ();
}
// bug #493639
[Test]
public void NoBindForMethodsWithBindInNameTest ()
{
string pageHtml = new WebTest ("NoBindForMethodsWithBindInName.aspx").Run ();
string renderedHtml = HtmlDiff.GetControlFromPageHtml (pageHtml);
string originalHtml = "<span id=\"grid_ctl02_lblTest\">Test</span>";
HtmlDiff.AssertAreEqual (originalHtml, renderedHtml, "#A1");
}
// bug #498637
[Test]
public void LinkInHeadWithEmbeddedExpression ()
{
string pageHtml = new WebTest ("LinkInHeadWithEmbeddedExpression.aspx").Run ();
string renderedHtml = HtmlDiff.GetControlFromPageHtml (pageHtml);
string originalHtml = "<link href=\"Themes/Default/Content/Site.css\" rel=\"stylesheet\" type=\"text/css\" />";
HtmlDiff.AssertAreEqual (originalHtml, renderedHtml, "#A1");
}
[Test]
public void ExpressionInListControl ()
{
string pageHtml = new WebTest ("ExpressionInListControl.aspx").Run ();
string renderedHtml = HtmlDiff.GetControlFromPageHtml (pageHtml);
string originalHtml = @"<select name=""DropDown1"" id=""DropDown1"">
<option value=""strvalue"">str</option>
</select>";
HtmlDiff.AssertAreEqual (originalHtml, renderedHtml, "#A1");
}
[Test (Description="Bug #508888")]
public void ServerSideControlsInScriptBlock ()
{
string pageHtml = new WebTest ("ServerSideControlsInScriptBlock.aspx").Run ();
string renderedHtml = HtmlDiff.GetControlFromPageHtml (pageHtml);
string originalHtml = @"<script type=""text/javascript"">alert (escape(""reporting/location?report=ViewsByDate&minDate=minDate&maxDate=maxDate""));</script>";
HtmlDiff.AssertAreEqual (originalHtml, renderedHtml, "#A1");
}
[Test (Description="Bug #520024")]
public void PreprocessorDirectivesInMarkup ()
{
// Just test if it doesn't throw an exception
new WebTest ("PreprocessorDirectivesInMarkup.aspx").Run ();
}
[Test (Description="Bug #526449")]
public void NewlineInCodeExpression ()
{
string pageHtml = new WebTest ("NewlineInCodeExpression.aspx").Run ();
string renderedHtml = HtmlDiff.GetControlFromPageHtml (pageHtml);
string originalHtml = "<a href=\"test\">bla</a>";
HtmlDiff.AssertAreEqual (originalHtml, renderedHtml, "#A1");
}
[Test (Description="Bug #524358")]
public void DuplicateControlsInClientComment ()
{
// Just test if it throws an exception
string pageHtml = new WebTest ("DuplicateControlsInClientComment.aspx").Run ();
Assert.IsTrue (pageHtml.IndexOf ("[System.Web.Compilation.ParseException]:") != -1, "#A1");
}
[Test (Description="Bug #367723")]
public void ConditionalClientComments ()
{
string pageHtml = new WebTest ("ConditionalClientComments.aspx").Run ();
string renderedHtml = HtmlDiff.GetControlFromPageHtml (pageHtml);
string originalHtml = @"<!--[if IE 6]>
<link rel=""styleheet"" type=""text/css"" href=""~/compat-ie6.css""></link>
<![endif]-->";
HtmlDiff.AssertAreEqual (originalHtml, renderedHtml, "#A1");
}
[Test (Description="Bug #400807")]
public void OneLetterIdentifierInCodeRender ()
{
string pageHtml = new WebTest ("OneLetterIdentifierInCodeRender.aspx").Run ();
string renderedHtml = HtmlDiff.GetControlFromPageHtml (pageHtml);
string originalHtml = @"bDoR called";
HtmlDiff.AssertAreEqual (originalHtml, renderedHtml, "#A1");
}
[Test (Description="Bug #562286")]
public void NestedParserFileText ()
{
// Just test if it doesn't throw an exception
new WebTest ("NestedParserFileText.aspx").Run ();
}
[Test (Description="Bug #568631")]
public void TagWithExpressionWithinAttribute ()
{
// Just test if it doesn't throw an exception
new WebTest ("TagWithExpressionWithinAttribute.aspx").Run ();
}
[Test (Description="Bug #578586")]
public void EnumConverter_Bug578586 ()
{
WebTest t = new WebTest ("EnumConverter_Bug578586.aspx");
string pageHtml = t.Run ();
string renderedHtml = HtmlDiff.GetControlFromPageHtml (pageHtml);
string originalHtml = @"<input type=""text"" value=""FlagOne"" name=""test"" id=""test"" />";
HtmlDiff.AssertAreEqual (originalHtml, renderedHtml, "#A1");
}
#endif
[Test (Description="Bug #323719")]
public void TagsNestedInClientTag ()
{
string pageHtml = new WebTest ("TagsNestedInClientTag.aspx").Run ();
string renderedHtml = HtmlDiff.GetControlFromPageHtml (pageHtml);
string originalHtml = @"<script language=""javascript"" src=""/js/test.js"" type=""text/javascript""></script>
<sometag language=""javascript"" src=""/js/test.js"" type=""text/javascript""></sometag>";
HtmlDiff.AssertAreEqual (originalHtml, renderedHtml, "#A1");
}
[Test (Description="Bug #517656")]
public void ServerControlInClientSideComment ()
{
string pageHtml = new WebTest ("ServerControlInClientSideComment.aspx").Run ();
string renderedHtml = HtmlDiff.GetControlFromPageHtml (pageHtml);
string originalHtml = @"<!-- comment start
<input id=""testBox"" type=""checkbox"" name=""testBox"" />
comment end -->";
HtmlDiff.AssertAreEqual (originalHtml, renderedHtml, "#A1");
}
[Test]
public void UnquotedAngleBrackets ()
{
// We just test if it doesn't throw an exception
new WebTest ("UnquotedAngleBrackets.aspx").Run ();
}
[Test]
public void FullTagsInText ()
{
// We just test if it doesn't throw an exception
new WebTest ("FullTagsInText.aspx").Run ();
}
[Test]
public void TagsExpressionsAndCommentsInText ()
{
// We just test if it doesn't throw an exception
new WebTest ("TagsExpressionsAndCommentsInText.aspx").Run ();
}
[Test]
public void ChildTemplatesTest ()
{
try {
WebTest.Host.AppDomain.AssemblyResolve += new ResolveEventHandler (ResolveAssemblyHandler);
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 ();
}
}
}