Преглед изворни кода

2005-09-21 Sebastien Pouliot <[email protected]>

	* AdCreatedEventArgsCas.cs, BaseCompareValidatorCas.cs,
	BaseDataBoundControlCas.cs, BaseDataListCas.cs, BaseValidatorCas.cs,
	BoundColumnCas.cs, ButtonColumnCas.cs, CalandarCas.cs, 
	CalendarDayCas.cs, CheckBoxCas.cs, CheckBoxListCas.cs, 
	CompareValidatorCas.cs, CompositeControlCas.cs, CustomValidatorCas.cs,
	DataBoundControlCas.cs, DataGridCas.cs, DataGridColumnCas.cs,
	DataGridItemCas.cs, DataGridItemCollectionCas.cs, 
	DataGridPagerStyleCas.cs, DataKeyCollectionCas.cs, DataListItemCas.cs,
	DataListItemCollectionCas.cs, EditCommandColumnCas.cs, FontInfoCas.cs,
	FontNamesConverterCas.cs, FontUnitCas.cs, FormViewCas.cs, 
	HyperLinkCas.cs, HyperLinkColumnCas.cs, ImageButtonCas.cs, 
	ImageCas.cs: New CAS unit tests - checks for LinkDemands and 
	re-execute the "classic" unit tests under the most retricted security
	permissions possible.


svn path=/trunk/mcs/; revision=50391
Sebastien Pouliot пре 20 година
родитељ
комит
1ebbda13fa
35 измењених фајлова са 2445 додато и 0 уклоњено
  1. 71 0
      mcs/class/System.Web/Test/System.Web.UI.WebControls/AdCreatedEventArgsCas.cs
  2. 76 0
      mcs/class/System.Web/Test/System.Web.UI.WebControls/BaseCompareValidatorCas.cs
  3. 60 0
      mcs/class/System.Web/Test/System.Web.UI.WebControls/BaseDataBoundControlCas.cs
  4. 83 0
      mcs/class/System.Web/Test/System.Web.UI.WebControls/BaseDataListCas.cs
  5. 101 0
      mcs/class/System.Web/Test/System.Web.UI.WebControls/BaseValidatorCas.cs
  6. 62 0
      mcs/class/System.Web/Test/System.Web.UI.WebControls/BoundColumnCas.cs
  7. 60 0
      mcs/class/System.Web/Test/System.Web.UI.WebControls/ButtonColumnCas.cs
  8. 81 0
      mcs/class/System.Web/Test/System.Web.UI.WebControls/CalandarCas.cs
  9. 69 0
      mcs/class/System.Web/Test/System.Web.UI.WebControls/CalendarDayCas.cs
  10. 17 0
      mcs/class/System.Web/Test/System.Web.UI.WebControls/ChangeLog
  11. 69 0
      mcs/class/System.Web/Test/System.Web.UI.WebControls/CheckBoxCas.cs
  12. 70 0
      mcs/class/System.Web/Test/System.Web.UI.WebControls/CheckBoxListCas.cs
  13. 101 0
      mcs/class/System.Web/Test/System.Web.UI.WebControls/CompareValidatorCas.cs
  14. 62 0
      mcs/class/System.Web/Test/System.Web.UI.WebControls/CompositeControlCas.cs
  15. 101 0
      mcs/class/System.Web/Test/System.Web.UI.WebControls/CustomValidatorCas.cs
  16. 62 0
      mcs/class/System.Web/Test/System.Web.UI.WebControls/DataBoundControlCas.cs
  17. 78 0
      mcs/class/System.Web/Test/System.Web.UI.WebControls/DataGridCas.cs
  18. 63 0
      mcs/class/System.Web/Test/System.Web.UI.WebControls/DataGridColumnCas.cs
  19. 70 0
      mcs/class/System.Web/Test/System.Web.UI.WebControls/DataGridItemCas.cs
  20. 69 0
      mcs/class/System.Web/Test/System.Web.UI.WebControls/DataGridItemCollectionCas.cs
  21. 81 0
      mcs/class/System.Web/Test/System.Web.UI.WebControls/DataGridPagerStyleCas.cs
  22. 68 0
      mcs/class/System.Web/Test/System.Web.UI.WebControls/DataKeyCollectionCas.cs
  23. 74 0
      mcs/class/System.Web/Test/System.Web.UI.WebControls/DataListCas.cs
  24. 79 0
      mcs/class/System.Web/Test/System.Web.UI.WebControls/DataListItemCas.cs
  25. 68 0
      mcs/class/System.Web/Test/System.Web.UI.WebControls/DataListItemCollectionCas.cs
  26. 69 0
      mcs/class/System.Web/Test/System.Web.UI.WebControls/DropDownListCas.cs
  27. 62 0
      mcs/class/System.Web/Test/System.Web.UI.WebControls/EditCommandColumnCas.cs
  28. 77 0
      mcs/class/System.Web/Test/System.Web.UI.WebControls/FontInfoCas.cs
  29. 59 0
      mcs/class/System.Web/Test/System.Web.UI.WebControls/FontNamesConverterCas.cs
  30. 73 0
      mcs/class/System.Web/Test/System.Web.UI.WebControls/FontUnitCas.cs
  31. 63 0
      mcs/class/System.Web/Test/System.Web.UI.WebControls/FormViewCas.cs
  32. 62 0
      mcs/class/System.Web/Test/System.Web.UI.WebControls/HyperLinkCas.cs
  33. 62 0
      mcs/class/System.Web/Test/System.Web.UI.WebControls/HyperLinkColumnCas.cs
  34. 61 0
      mcs/class/System.Web/Test/System.Web.UI.WebControls/ImageButtonCas.cs
  35. 62 0
      mcs/class/System.Web/Test/System.Web.UI.WebControls/ImageCas.cs

+ 71 - 0
mcs/class/System.Web/Test/System.Web.UI.WebControls/AdCreatedEventArgsCas.cs

@@ -0,0 +1,71 @@
+//
+// AdCreatedEventArgsCas.cs 
+//	- CAS unit tests for System.Web.UI.WebControls.AdCreatedEventArgs
+//
+// Author:
+//	Sebastien Pouliot  <[email protected]>
+//
+// 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.
+//
+
+using NUnit.Framework;
+
+using System;
+using System.Collections;
+using System.Reflection;
+using System.Security.Permissions;
+using System.Web;
+using System.Web.UI.WebControls;
+
+using MonoTests.System.Web.UI.WebControls;
+
+namespace MonoCasTests.System.Web.UI.WebControls {
+
+	[TestFixture]
+	[Category ("CAS")]
+	public class AdCreatedEventArgsCas : AspNetHostingMinimal {
+
+		[Test]
+		[PermissionSet (SecurityAction.Deny, Unrestricted = true)]
+		public void Deny_Unrestricted ()
+		{
+			AdCreatedEventArgsTest unit = new AdCreatedEventArgsTest ();
+			unit.Defaults ();
+			unit.SetPropsInCtor ();
+			unit.SetProps ();
+			unit.ModifyProps ();
+		}
+
+		// LinkDemand
+
+		public override object CreateControl (SecurityAction action, AspNetHostingPermissionLevel level)
+		{
+			ConstructorInfo ci = this.Type.GetConstructor (new Type[1] { typeof (IDictionary) });
+			Assert.IsNotNull (ci, ".ctor(IDictionary)");
+			return ci.Invoke (new object[1] { null });
+		}
+
+		public override Type Type {
+			get { return typeof (AdCreatedEventArgs); }
+		}
+	}
+}

+ 76 - 0
mcs/class/System.Web/Test/System.Web.UI.WebControls/BaseCompareValidatorCas.cs

@@ -0,0 +1,76 @@
+//
+// BaseCompareValidatorCas.cs 
+//	- CAS unit tests for System.Web.UI.WebControls.BaseCompareValidator
+//
+// Author:
+//	Sebastien Pouliot  <[email protected]>
+//
+// 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.
+//
+
+using NUnit.Framework;
+
+using System;
+using System.Security.Permissions;
+using System.Web.UI.WebControls;
+
+using MonoTests.System.Web.UI.WebControls;
+
+namespace MonoCasTests.System.Web.UI.WebControls {
+
+	[TestFixture]
+	[Category ("CAS")]
+	public class BaseCompareValidatorCas {
+
+		// note: we do not inherit from AspNetHostingMinimal because
+		// BaseCompareValidator is an abstract class
+
+		[Test]
+		[PermissionSet (SecurityAction.Deny, Unrestricted = true)]
+		public void Deny_Unrestricted ()
+		{
+			BaseCompareValidatorTest unit = new BaseCompareValidatorTest ();
+			unit.ViewState ();
+			unit.CanConvert ();
+			unit.Convert ();
+			unit.Compare ();
+			// can't call MiscPropertiesAndMethods because it change the
+			// thread's culture (which requires ControlThread)
+		}
+
+		[Test]
+		[PermissionSet (SecurityAction.Deny, Unrestricted = true)]
+		public void MiscPropertiesAndMethods ()
+		{
+			BaseCompareValidatorPoker p = new BaseCompareValidatorPoker ();
+
+			Assert.AreEqual (p.GetCutoffYear (), 2029, "E1");
+			Assert.AreEqual (p.GetFullYear (29), 2029, "E2");
+#if NET_2_0
+			Assert.AreEqual (p.GetFullYear (30), 1930, "E3");
+#else
+			Assert.AreEqual (p.GetFullYear (30), 2030, "E3"); // XXX this is broken
+#endif
+			Assert.IsNotNull (p.GetDateElementOrder (), "E4");
+		}
+	}
+}

+ 60 - 0
mcs/class/System.Web/Test/System.Web.UI.WebControls/BaseDataBoundControlCas.cs

@@ -0,0 +1,60 @@
+//
+// BaseDataBoundControlCas.cs 
+//	- CAS unit tests for System.Web.UI.WebControls.BaseDataBoundControl
+//
+// Author:
+//	Sebastien Pouliot  <[email protected]>
+//
+// 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.Security.Permissions;
+using System.Web.UI.WebControls;
+
+using MonoTests.System.Web.UI.WebControls;
+
+namespace MonoCasTests.System.Web.UI.WebControls {
+
+	[TestFixture]
+	[Category ("CAS")]
+	public class BaseDataBoundControlCas {
+
+		// note: we do not inherit from AspNetHostingMinimal because
+		// BaseDataBoundControl is an abstract class
+
+		[Test]
+		[PermissionSet (SecurityAction.Deny, Unrestricted = true)]
+		public void Deny_Unrestricted ()
+		{
+			BaseDataBoundControlTest unit = new BaseDataBoundControlTest ();
+			unit.Defaults ();
+			unit.ViewState ();
+		}
+	}
+}
+
+#endif

+ 83 - 0
mcs/class/System.Web/Test/System.Web.UI.WebControls/BaseDataListCas.cs

@@ -0,0 +1,83 @@
+//
+// BaseDataListCas.cs 
+//	- CAS unit tests for System.Web.UI.WebControls.BaseDataList
+//
+// Author:
+//	Sebastien Pouliot  <[email protected]>
+//
+// 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.
+//
+
+using NUnit.Framework;
+
+using System;
+using System.Security.Permissions;
+using System.Web.UI.WebControls;
+
+using MonoTests.System.Web.UI.WebControls;
+
+namespace MonoCasTests.System.Web.UI.WebControls {
+
+	[TestFixture]
+	[Category ("CAS")]
+	public class BaseDataListCas {
+
+		// note: we do not inherit from AspNetHostingMinimal because
+		// BaseDataList is an abstract class
+
+		[Test]
+		[PermissionSet (SecurityAction.Deny, Unrestricted = true)]
+		public void Deny_Unrestricted ()
+		{
+			BaseDataListTest unit = new BaseDataListTest ();
+			unit.DefaultProperties ();
+			unit.NullProperties ();
+			unit.CleanProperties ();
+			unit.TableCaption ();
+			unit.DataSource_IEnumerable ();
+			unit.DataSource_IListSource ();
+			unit.AddParsedSubObject ();
+			unit.Render_Empty ();
+			unit.Render ();
+			unit.Events ();
+			unit.OnDataBinding ();
+#if NET_2_0
+			unit.DataSourceID ();
+			unit.EnsureDataBound_WithoutDataSourceID ();
+			unit.EnsureDataBound_WithDataSourceID ();
+			unit.GetData ();
+			unit.GetData_WithoutDataSourceID ();
+			unit.OnDataBinding_True ();
+			unit.OnDataBinding_False ();
+			unit.OnDataPropertyChanged ();
+			unit.OnInit ();
+			unit.OnDataSourceViewChanged ();
+			unit.OnLoad_WithoutPage ();
+			unit.OnLoad_WithoutPageWithoutViewState ();
+			unit.OnLoad_WithPage ();
+			unit.OnLoad_WithPageWithoutViewState ();
+			unit.OnLoad_WithDataSource ();
+#endif
+			unit.IsBindableType ();
+		}
+	}
+}

+ 101 - 0
mcs/class/System.Web/Test/System.Web.UI.WebControls/BaseValidatorCas.cs

@@ -0,0 +1,101 @@
+//
+// BaseValidatorCas.cs 
+//	- CAS unit tests for System.Web.UI.WebControls.BaseValidator
+//
+// Author:
+//	Sebastien Pouliot  <[email protected]>
+//
+// 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.
+//
+
+using NUnit.Framework;
+
+using System;
+using System.Reflection;
+using System.Security;
+using System.Security.Permissions;
+using System.Web;
+using System.Web.UI.WebControls;
+
+using MonoTests.System.Web.UI.WebControls;
+
+namespace MonoCasTests.System.Web.UI.WebControls {
+
+	[TestFixture]
+	[Category ("CAS")]
+	public class BaseValidatorCas {
+
+		// note: we do not inherit from AspNetHostingMinimal because
+		// BaseValidator is an abstract class
+
+		[Test]
+		[PermissionSet (SecurityAction.Deny, Unrestricted = true)]
+		public void Deny_Unrestricted ()
+		{
+			BaseValidatorTest unit = new BaseValidatorTest ();
+			unit.ViewState ();
+			unit.ControlPropertiesValid1 ();
+			unit.CustomDescriptor ();
+			unit.NoCustomDescriptor ();
+		}
+
+		[Test]
+		[AspNetHostingPermission (SecurityAction.Deny, Level = AspNetHostingPermissionLevel.Minimal)]
+		[ExpectedException (typeof (TargetInvocationException))]
+		public void ValidationProperty_Deny_Minimal ()
+		{
+			BaseValidatorTest unit = new BaseValidatorTest ();
+			unit.ValidationProperty ();
+			// note: this is a failing security check on reflection,
+			// the SecurityException is the InnerException of the 
+			// TargetInvocationException
+		}
+
+		[Test]
+		[AspNetHostingPermission (SecurityAction.PermitOnly, Level = AspNetHostingPermissionLevel.Minimal)]
+		public void ValidationProperty_PermitOnly_Minimal ()
+		{
+			BaseValidatorTest unit = new BaseValidatorTest ();
+			unit.ValidationProperty ();
+		}
+
+		[Test]
+		[AspNetHostingPermission (SecurityAction.Deny, Level = AspNetHostingPermissionLevel.Minimal)]
+		[ExpectedException (typeof (TargetInvocationException))]
+		public void GetControlValidationValue_Deny_Minimal ()
+		{
+			BaseValidatorTest unit = new BaseValidatorTest ();
+			unit.GetControlValidationValue ();
+			// note: this is a failing security check on reflection,
+			// the SecurityException is the InnerException of the 
+			// TargetInvocationException
+		}
+
+		[Test]
+		[AspNetHostingPermission (SecurityAction.PermitOnly, Level = AspNetHostingPermissionLevel.Minimal)]
+		public void GetControlValidationValue_PermitOnly_Minimal ()
+		{
+			BaseValidatorTest unit = new BaseValidatorTest ();
+			unit.GetControlValidationValue ();
+		}
+	}
+}

+ 62 - 0
mcs/class/System.Web/Test/System.Web.UI.WebControls/BoundColumnCas.cs

@@ -0,0 +1,62 @@
+//
+// BoundColumnCas.cs 
+//	- CAS unit tests for System.Web.UI.WebControls.BoundColumn
+//
+// Author:
+//	Sebastien Pouliot  <[email protected]>
+//
+// 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.
+//
+
+using NUnit.Framework;
+
+using System;
+using System.Security;
+using System.Security.Permissions;
+using System.Web.UI.WebControls;
+
+using MonoTests.System.Web.UI.WebControls;
+
+namespace MonoCasTests.System.Web.UI.WebControls {
+
+	[TestFixture]
+	[Category ("CAS")]
+	public class BoundColumnCas : AspNetHostingMinimal {
+
+		// note: we do not inherit from AspNetHostingMinimal because
+		// BaseValidator is an abstract class
+
+		[Test]
+		[PermissionSet (SecurityAction.Deny, Unrestricted = true)]
+		public void Deny_Unrestricted ()
+		{
+			BoundColumnTest unit = new BoundColumnTest ();
+			unit.FormatDataValue ();
+		}
+
+		// LinkDemand
+
+		public override Type Type {
+			get { return typeof (BoundColumn); }
+		}
+	}
+}

+ 60 - 0
mcs/class/System.Web/Test/System.Web.UI.WebControls/ButtonColumnCas.cs

@@ -0,0 +1,60 @@
+//
+// ButtonColumnCas.cs 
+//	- CAS unit tests for System.Web.UI.WebControls.ButtonColumn
+//
+// Author:
+//	Sebastien Pouliot  <[email protected]>
+//
+// 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.
+//
+
+using NUnit.Framework;
+
+using System;
+using System.Security;
+using System.Security.Permissions;
+using System.Web.UI.WebControls;
+
+using MonoTests.System.Web.UI.WebControls;
+
+namespace MonoCasTests.System.Web.UI.WebControls {
+
+	[TestFixture]
+	[Category ("CAS")]
+	public class ButtonColumnCas : AspNetHostingMinimal {
+
+		[Test]
+		[PermissionSet (SecurityAction.Deny, Unrestricted = true)]
+		public void Deny_Unrestricted ()
+		{
+			ButtonColumnTest unit = new ButtonColumnTest ();
+			unit.FormatDataValue ();
+		}
+
+		// LinkDemand
+
+		public override Type Type {
+			get { return typeof (ButtonColumn); }
+		}
+	}
+}
+

+ 81 - 0
mcs/class/System.Web/Test/System.Web.UI.WebControls/CalandarCas.cs

@@ -0,0 +1,81 @@
+//
+// CalandarCas.cs 
+//	- CAS unit tests for System.Web.UI.WebControls.Calandar
+//
+// Author:
+//	Sebastien Pouliot  <[email protected]>
+//
+// 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.
+//
+
+using NUnit.Framework;
+
+using System;
+using System.Collections;
+using System.Reflection;
+using System.Security.Permissions;
+using System.Web;
+using System.Web.UI.WebControls;
+
+using MonoTests.System.Web.UI.WebControls;
+
+namespace MonoCasTests.System.Web.UI.WebControls {
+
+	[TestFixture]
+	[Category ("CAS")]
+	public class CalendarCas : AspNetHostingMinimal {
+
+		[Test]
+		[PermissionSet (SecurityAction.Deny, Unrestricted = true)]
+		public void Deny_Unrestricted ()
+		{
+			CalendarTest unit = new CalendarTest ();
+			unit.Calendar_DefaultValues ();
+			unit.NextMonthTextProperty ();
+			unit.NextPrevFormatProperty ();
+			unit.DayHeaderStyleProperty ();
+			unit.NextPrevStyleProperty ();
+			unit.SelectorStyleProperty ();
+			unit.OtherMonthDayStyleProperty ();
+			unit.SelectedDayStyleProperty ();
+			unit.TodayDayStyleProperty ();
+			unit.WeekendDayStyleProperty ();
+			unit.SelectDateProperty ();
+			unit.PrevMonthTextProperty ();
+			unit.ShowNextPrevMonthProperty ();
+			unit.ShowTitleProperty ();
+			unit.SelectionChanged ();
+			unit.VisibleMonthChanged ();
+			unit.DayRender ();
+			unit.Calendar_ViewState ();
+			unit.TestDayRenderCellAdd ();
+			unit.TestRenderMonthStartsOnSunday ();
+			unit.TestSelectedColorDefault ();
+		}
+
+		// LinkDemand
+
+		public override Type Type {
+			get { return typeof (Calendar); }
+		}
+	}
+}

+ 69 - 0
mcs/class/System.Web/Test/System.Web.UI.WebControls/CalendarDayCas.cs

@@ -0,0 +1,69 @@
+//
+// CalendarDayCas.cs 
+//	- CAS unit tests for System.Web.UI.WebControls.CalendarDay
+//
+// Author:
+//	Sebastien Pouliot  <[email protected]>
+//
+// 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.
+//
+
+using NUnit.Framework;
+
+using System;
+using System.Collections;
+using System.Reflection;
+using System.Security.Permissions;
+using System.Web;
+using System.Web.UI.WebControls;
+
+using MonoTests.System.Web.UI.WebControls;
+
+namespace MonoCasTests.System.Web.UI.WebControls {
+
+	[TestFixture]
+	[Category ("CAS")]
+	public class CalendarDayCas : AspNetHostingMinimal {
+
+		[Test]
+		[PermissionSet (SecurityAction.Deny, Unrestricted = true)]
+		public void Deny_Unrestricted ()
+		{
+			CalendarDayTest unit = new CalendarDayTest ();
+			unit.CalendarDay_Constructor ();
+			unit.IsSelectableProperty ();
+		}
+
+		// LinkDemand
+
+		public override object CreateControl (SecurityAction action, AspNetHostingPermissionLevel level)
+		{
+			ConstructorInfo ci = this.Type.GetConstructor (new Type[6] { typeof (DateTime), typeof (bool), typeof (bool), typeof (bool), typeof (bool), typeof (string) });
+			Assert.IsNotNull (ci, ".ctor(DateTime,bool,bool,bool,bool,string)");
+			return ci.Invoke (new object[6] { DateTime.MinValue, false, false, false, false, String.Empty });
+		}
+
+		public override Type Type {
+			get { return typeof (CalendarDay); }
+		}
+	}
+}

+ 17 - 0
mcs/class/System.Web/Test/System.Web.UI.WebControls/ChangeLog

@@ -1,3 +1,20 @@
+2005-09-21  Sebastien Pouliot  <[email protected]>
+
+	* AdCreatedEventArgsCas.cs, BaseCompareValidatorCas.cs,
+	BaseDataBoundControlCas.cs, BaseDataListCas.cs, BaseValidatorCas.cs,
+	BoundColumnCas.cs, ButtonColumnCas.cs, CalandarCas.cs, 
+	CalendarDayCas.cs, CheckBoxCas.cs, CheckBoxListCas.cs, 
+	CompareValidatorCas.cs, CompositeControlCas.cs, CustomValidatorCas.cs,
+	DataBoundControlCas.cs, DataGridCas.cs, DataGridColumnCas.cs,
+	DataGridItemCas.cs, DataGridItemCollectionCas.cs, 
+	DataGridPagerStyleCas.cs, DataKeyCollectionCas.cs, DataListItemCas.cs,
+	DataListItemCollectionCas.cs, EditCommandColumnCas.cs, FontInfoCas.cs,
+	FontNamesConverterCas.cs, FontUnitCas.cs, FormViewCas.cs, 
+	HyperLinkCas.cs, HyperLinkColumnCas.cs, ImageButtonCas.cs, 
+	ImageCas.cs: New CAS unit tests - checks for LinkDemands and 
+	re-execute the "classic" unit tests under the most retricted security
+	permissions possible.
+
 2005-09-20 Gonzalo Paniagua Javier <[email protected]>
 
 	* DataGridTest.cs: added data binding tests.

+ 69 - 0
mcs/class/System.Web/Test/System.Web.UI.WebControls/CheckBoxCas.cs

@@ -0,0 +1,69 @@
+//
+// CheckBoxCas.cs 
+//	- CAS unit tests for System.Web.UI.WebControls.CheckBox
+//
+// Author:
+//	Sebastien Pouliot  <[email protected]>
+//
+// 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.
+//
+
+using NUnit.Framework;
+
+using System;
+using System.Collections;
+using System.Reflection;
+using System.Security.Permissions;
+using System.Web;
+using System.Web.UI.WebControls;
+
+using MonoTests.System.Web.UI.WebControls;
+
+namespace MonoCasTests.System.Web.UI.WebControls {
+
+	[TestFixture]
+	[Category ("CAS")]
+	public class CheckBoxCas : AspNetHostingMinimal {
+
+		[Test]
+		[PermissionSet (SecurityAction.Deny, Unrestricted = true)]
+		public void Deny_Unrestricted ()
+		{
+			CheckBoxTest unit = new CheckBoxTest ();
+			unit.DefaultProperties ();
+			unit.NullProperties ();
+			unit.CleanProperties ();
+			unit.TextAlign_Values ();
+			unit.Render ();
+			unit.CheckboxViewstateTextNull ();
+#if NET_2_0
+			unit.CheckboxViewstateValidation ();
+#endif
+		}
+
+		// LinkDemand
+
+		public override Type Type {
+			get { return typeof (CheckBox); }
+		}
+	}
+}

+ 70 - 0
mcs/class/System.Web/Test/System.Web.UI.WebControls/CheckBoxListCas.cs

@@ -0,0 +1,70 @@
+//
+// CheckBoxListCas.cs 
+//	- CAS unit tests for System.Web.UI.WebControls.CheckBoxList
+//
+// Author:
+//	Sebastien Pouliot  <[email protected]>
+//
+// 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.
+//
+
+using NUnit.Framework;
+
+using System;
+using System.Collections;
+using System.Reflection;
+using System.Security.Permissions;
+using System.Web;
+using System.Web.UI.WebControls;
+
+using MonoTests.System.Web.UI.WebControls;
+
+namespace MonoCasTests.System.Web.UI.WebControls {
+
+	[TestFixture]
+	[Category ("CAS")]
+	public class CheckBoxListCas : AspNetHostingMinimal {
+
+		[Test]
+		[PermissionSet (SecurityAction.Deny, Unrestricted = true)]
+		public void Deny_Unrestricted ()
+		{
+			CheckBoxListTest unit = new CheckBoxListTest ();
+			unit.Defaults ();
+			unit.CleanProperties ();
+			unit.ChildCheckBoxControl ();
+			unit.CreateStyle ();
+			unit.RepeatInfoProperties ();
+			unit.RepeatInfoCount ();
+			unit.RepeatInfoStyle ();
+			unit.RepeatInfoRenderItem ();
+			unit.FindControl ();
+			unit.RenderEmpty ();
+		}
+
+		// LinkDemand
+
+		public override Type Type {
+			get { return typeof (CheckBoxList); }
+		}
+	}
+}

+ 101 - 0
mcs/class/System.Web/Test/System.Web.UI.WebControls/CompareValidatorCas.cs

@@ -0,0 +1,101 @@
+//
+// CompareValidatorCas.cs 
+//	- CAS unit tests for System.Web.UI.WebControls.CompareValidator
+//
+// Author:
+//	Sebastien Pouliot  <[email protected]>
+//
+// 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.
+//
+
+using NUnit.Framework;
+
+using System;
+using System.Collections;
+using System.Reflection;
+using System.Security.Permissions;
+using System.Web;
+using System.Web.UI.WebControls;
+
+using MonoTests.System.Web.UI.WebControls;
+
+namespace MonoCasTests.System.Web.UI.WebControls {
+
+	[TestFixture]
+	[Category ("CAS")]
+	public class CompareValidatorCas : AspNetHostingMinimal {
+
+		[Test]
+		[PermissionSet (SecurityAction.Deny, Unrestricted = true)]
+		public void Deny_Unrestricted ()
+		{
+			CompareValidatorTest unit = new CompareValidatorTest ();
+			unit.CompareValidator_ViewState ();
+		}
+
+		[Test]
+		[AspNetHostingPermission (SecurityAction.Deny, Level = AspNetHostingPermissionLevel.Minimal)]
+		[ExpectedException (typeof (TargetInvocationException))]
+		public void ValueToCompareTest_Deny_Minimal ()
+		{
+			CompareValidatorTest unit = new CompareValidatorTest ();
+			unit.CompareValidator_ValueToCompareTest ();
+			// note: this is a failing security check on reflection,
+			// the SecurityException is the InnerException of the 
+			// TargetInvocationException
+		}
+
+		[Test]
+		[AspNetHostingPermission (SecurityAction.PermitOnly, Level = AspNetHostingPermissionLevel.Minimal)]
+		public void ValueToCompareTest_PermitOnly_Minimal ()
+		{
+			CompareValidatorTest unit = new CompareValidatorTest ();
+			unit.CompareValidator_ValueToCompareTest ();
+		}
+
+		[Test]
+		[AspNetHostingPermission (SecurityAction.Deny, Level = AspNetHostingPermissionLevel.Minimal)]
+		[ExpectedException (typeof (TargetInvocationException))]
+		public void ControlToCompareTest_Deny_Minimal ()
+		{
+			CompareValidatorTest unit = new CompareValidatorTest ();
+			unit.CompareValidator_ControlToCompareTest ();
+			// note: this is a failing security check on reflection,
+			// the SecurityException is the InnerException of the 
+			// TargetInvocationException
+		}
+
+		[Test]
+		[AspNetHostingPermission (SecurityAction.PermitOnly, Level = AspNetHostingPermissionLevel.Minimal)]
+		public void ControlToCompareTest_PermitOnly_Minimal ()
+		{
+			CompareValidatorTest unit = new CompareValidatorTest ();
+			unit.CompareValidator_ControlToCompareTest ();
+		}
+
+		// LinkDemand
+
+		public override Type Type {
+			get { return typeof (CompareValidator); }
+		}
+	}
+}

+ 62 - 0
mcs/class/System.Web/Test/System.Web.UI.WebControls/CompositeControlCas.cs

@@ -0,0 +1,62 @@
+//
+// CompositeControlCas.cs 
+//	- CAS unit tests for System.Web.UI.WebControls.CompositeControl
+//
+// Author:
+//	Sebastien Pouliot  <[email protected]>
+//
+// 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.Collections;
+using System.Reflection;
+using System.Security.Permissions;
+using System.Web;
+using System.Web.UI.WebControls;
+
+using MonoTests.System.Web.UI.WebControls;
+
+namespace MonoCasTests.System.Web.UI.WebControls {
+
+	[TestFixture]
+	[Category ("CAS")]
+	public class CompositeControlCas {
+
+		// note: we do not inherit from AspNetHostingMinimal because
+		// CompositeControl is an abstract class
+
+		[Test]
+		[PermissionSet (SecurityAction.Deny, Unrestricted = true)]
+		public void Deny_Unrestricted ()
+		{
+			CompositeControlTest unit = new CompositeControlTest ();
+			unit.ControlsAccessorTest ();
+		}
+	}
+}
+
+#endif

+ 101 - 0
mcs/class/System.Web/Test/System.Web.UI.WebControls/CustomValidatorCas.cs

@@ -0,0 +1,101 @@
+//
+// CustomValidatorCas.cs 
+//	- CAS unit tests for System.Web.UI.WebControls.CustomValidator
+//
+// Author:
+//	Sebastien Pouliot  <[email protected]>
+//
+// 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.
+//
+
+using NUnit.Framework;
+
+using System;
+using System.Collections;
+using System.Reflection;
+using System.Security.Permissions;
+using System.Web;
+using System.Web.UI.WebControls;
+
+using MonoTests.System.Web.UI.WebControls;
+
+namespace MonoCasTests.System.Web.UI.WebControls {
+
+	[TestFixture]
+	[Category ("CAS")]
+	public class CustomValidatorCas : AspNetHostingMinimal {
+
+		[Test]
+		[PermissionSet (SecurityAction.Deny, Unrestricted = true)]
+		public void Deny_Unrestricted ()
+		{
+			CustomValidatorTest unit = new CustomValidatorTest ();
+			unit.Defaults ();
+		}
+
+		[Test]
+		[AspNetHostingPermission (SecurityAction.Deny, Level = AspNetHostingPermissionLevel.Minimal)]
+		[ExpectedException (typeof (TargetInvocationException))]
+		public void EventDefaults_Deny_Minimal ()
+		{
+			CustomValidatorTest unit = new CustomValidatorTest ();
+			unit.EventDefaults ();
+			// note: this is a failing security check on reflection,
+			// the SecurityException is the InnerException of the 
+			// TargetInvocationException
+		}
+
+		[Test]
+		[AspNetHostingPermission (SecurityAction.PermitOnly, Level = AspNetHostingPermissionLevel.Minimal)]
+		public void EventDefaults_PermitOnly_Minimal ()
+		{
+			CustomValidatorTest unit = new CustomValidatorTest ();
+			unit.EventDefaults ();
+		}
+
+		[Test]
+		[AspNetHostingPermission (SecurityAction.Deny, Level = AspNetHostingPermissionLevel.Minimal)]
+		[ExpectedException (typeof (TargetInvocationException))]
+		public void Render_Deny_Minimal ()
+		{
+			CustomValidatorTest unit = new CustomValidatorTest ();
+			unit.Render ();
+			// note: this is a failing security check on reflection,
+			// the SecurityException is the InnerException of the 
+			// TargetInvocationException
+		}
+
+		[Test]
+		[AspNetHostingPermission (SecurityAction.PermitOnly, Level = AspNetHostingPermissionLevel.Minimal)]
+		public void Render_PermitOnly_Minimal ()
+		{
+			CustomValidatorTest unit = new CustomValidatorTest ();
+			unit.Render ();
+		}
+
+		// LinkDemand
+
+		public override Type Type {
+			get { return typeof (CustomValidator); }
+		}
+	}
+}

+ 62 - 0
mcs/class/System.Web/Test/System.Web.UI.WebControls/DataBoundControlCas.cs

@@ -0,0 +1,62 @@
+//
+// DataBoundControlCas.cs 
+//	- CAS unit tests for System.Web.UI.WebControls.DataBoundControl
+//
+// Author:
+//	Sebastien Pouliot  <[email protected]>
+//
+// 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.Collections;
+using System.Reflection;
+using System.Security.Permissions;
+using System.Web;
+using System.Web.UI.WebControls;
+
+using MonoTests.System.Web.UI.WebControls;
+
+namespace MonoCasTests.System.Web.UI.WebControls {
+
+	[TestFixture]
+	[Category ("CAS")]
+	public class DataBoundControlCas {
+
+		// note: we do not inherit from AspNetHostingMinimal because
+		// DataBoundControl is an abstract class
+
+		[Test]
+		[PermissionSet (SecurityAction.Deny, Unrestricted = true)]
+		public void Deny_Unrestricted ()
+		{
+			DataBoundControlTest unit = new DataBoundControlTest ();
+			unit.Defaults ();
+		}
+	}
+}
+
+#endif

+ 78 - 0
mcs/class/System.Web/Test/System.Web.UI.WebControls/DataGridCas.cs

@@ -0,0 +1,78 @@
+//
+// DataGridCas.cs 
+//	- CAS unit tests for System.Web.UI.WebControls.DataGrid
+//
+// Author:
+//	Sebastien Pouliot  <[email protected]>
+//
+// 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.
+//
+
+using NUnit.Framework;
+
+using System;
+using System.Collections;
+using System.Reflection;
+using System.Security.Permissions;
+using System.Web;
+using System.Web.UI.WebControls;
+
+using MonoTests.System.Web.UI.WebControls;
+
+namespace MonoCasTests.System.Web.UI.WebControls {
+
+	[TestFixture]
+	[Category ("CAS")]
+	public class DataGridCas : AspNetHostingMinimal {
+
+		[Test]
+		[PermissionSet (SecurityAction.Deny, Unrestricted = true)]
+		public void Deny_Unrestricted ()
+		{
+			DataGridTest unit = new DataGridTest ();
+			unit.Defaults ();
+			unit.TagName ();
+			unit.CleanProperties ();
+			unit.ViewState ();
+			unit.SelectIndexOutOfRange ();
+			unit.ControlStyle ();
+			unit.Styles ();
+			unit.Events ();
+			unit.BubbleEvent ();
+			unit.BubblePageCommand ();
+			unit.SaveViewState ();
+			unit.CreateColumnSet ();
+			unit.CreateColumnsBinding ();
+			unit.CreateSimpleColumns ();
+			unit.CreateControls ();
+			unit.CreationEvents ();
+			unit.InitializePager ();
+			unit.Render ();
+		}
+
+		// LinkDemand
+
+		public override Type Type {
+			get { return typeof (DataGrid); }
+		}
+	}
+}

+ 63 - 0
mcs/class/System.Web/Test/System.Web.UI.WebControls/DataGridColumnCas.cs

@@ -0,0 +1,63 @@
+//
+// DataGridColumnCas.cs 
+//	- CAS unit tests for System.Web.UI.WebControls.DataGridColumn
+//
+// Author:
+//	Sebastien Pouliot  <[email protected]>
+//
+// 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.
+//
+
+using NUnit.Framework;
+
+using System;
+using System.Collections;
+using System.Reflection;
+using System.Security.Permissions;
+using System.Web;
+using System.Web.UI.WebControls;
+
+using MonoTests.System.Web.UI.WebControls;
+
+namespace MonoCasTests.System.Web.UI.WebControls {
+
+	[TestFixture]
+	[Category ("CAS")]
+	public class DataGridColumnCas {
+
+		// note: we do not inherit from AspNetHostingMinimal because
+		// DataGridColumn is an abstract class
+
+		[Test]
+		[PermissionSet (SecurityAction.Deny, Unrestricted = true)]
+		public void Deny_Unrestricted ()
+		{
+			DataGridColumnTest unit = new DataGridColumnTest ();
+			unit.DefaultProperties ();
+			unit.NullProperties ();
+			unit.CleanProperties ();
+			unit.TestToString ();
+			unit.TestInitialize ();
+			unit.TestInitializeCell ();
+		}
+	}
+}

+ 70 - 0
mcs/class/System.Web/Test/System.Web.UI.WebControls/DataGridItemCas.cs

@@ -0,0 +1,70 @@
+//
+// DataGridItemCas.cs 
+//	- CAS unit tests for System.Web.UI.WebControls.DataGridItem
+//
+// Author:
+//	Sebastien Pouliot  <[email protected]>
+//
+// 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.
+//
+
+using NUnit.Framework;
+
+using System;
+using System.Collections;
+using System.Reflection;
+using System.Security.Permissions;
+using System.Web;
+using System.Web.UI.WebControls;
+
+using MonoTests.System.Web.UI.WebControls;
+
+namespace MonoCasTests.System.Web.UI.WebControls {
+
+	[TestFixture]
+	[Category ("CAS")]
+	public class DataGridItemCas : AspNetHostingMinimal {
+
+		[Test]
+		[PermissionSet (SecurityAction.Deny, Unrestricted = true)]
+		public void Deny_Unrestricted ()
+		{
+			DataGridItemTest unit = new DataGridItemTest ();
+			unit.Defaults ();
+			unit.Methods ();
+			unit.ValidEnum ();
+		}
+
+		// LinkDemand
+
+		public override object CreateControl (SecurityAction action, AspNetHostingPermissionLevel level)
+		{
+			ConstructorInfo ci = this.Type.GetConstructor (new Type[3] { typeof (int), typeof (int), typeof (ListItemType) });
+			Assert.IsNotNull (ci, ".ctor(int,int,ListItemType)");
+			return ci.Invoke (new object[3] { 0, 0, ListItemType.Item });
+		}
+
+		public override Type Type {
+			get { return typeof (DataGridItem); }
+		}
+	}
+}

+ 69 - 0
mcs/class/System.Web/Test/System.Web.UI.WebControls/DataGridItemCollectionCas.cs

@@ -0,0 +1,69 @@
+//
+// DataGridItemCollectionCas.cs 
+//	- CAS unit tests for System.Web.UI.WebControls.DataGridItemCollection
+//
+// Author:
+//	Sebastien Pouliot  <[email protected]>
+//
+// 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.
+//
+
+using NUnit.Framework;
+
+using System;
+using System.Collections;
+using System.Reflection;
+using System.Security.Permissions;
+using System.Web;
+using System.Web.UI.WebControls;
+
+using MonoTests.System.Web.UI.WebControls;
+
+namespace MonoCasTests.System.Web.UI.WebControls {
+
+	[TestFixture]
+	[Category ("CAS")]
+	public class DataGridItemCollectionCas : AspNetHostingMinimal {
+
+		[Test]
+		[PermissionSet (SecurityAction.Deny, Unrestricted = true)]
+		public void Deny_Unrestricted ()
+		{
+			DataGridItemCollectionTest unit = new DataGridItemCollectionTest ();
+			unit.Defaults ();
+			unit.Copy ();
+		}
+
+		// LinkDemand
+
+		public override object CreateControl (SecurityAction action, AspNetHostingPermissionLevel level)
+		{
+			ConstructorInfo ci = this.Type.GetConstructor (new Type[1] { typeof (ArrayList) });
+			Assert.IsNotNull (ci, ".ctor(ArrayList)");
+			return ci.Invoke (new object[1] { new ArrayList () });
+		}
+
+		public override Type Type {
+			get { return typeof (DataGridItemCollection); }
+		}
+	}
+}

+ 81 - 0
mcs/class/System.Web/Test/System.Web.UI.WebControls/DataGridPagerStyleCas.cs

@@ -0,0 +1,81 @@
+//
+// DataGridPagerStyleCas.cs 
+//	- CAS unit tests for System.Web.UI.WebControls.DataGridPagerStyle
+//
+// Author:
+//	Sebastien Pouliot  <[email protected]>
+//
+// 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.
+//
+
+using NUnit.Framework;
+
+using System;
+using System.Collections;
+using System.Reflection;
+using System.Security.Permissions;
+using System.Web;
+using System.Web.UI.WebControls;
+
+using MonoTests.System.Web.UI.WebControls;
+
+namespace MonoCasTests.System.Web.UI.WebControls {
+
+	[TestFixture]
+	[Category ("CAS")]
+	public class DataGridPagerStyleCas : AspNetHostingMinimal {
+
+		private DataGridPagerStyle pager_style;
+
+		[TestFixtureSetUp]
+		public void FixtureSetUp ()
+		{
+			pager_style = new DataGrid ().PagerStyle;
+		}
+
+		[Test]
+		[PermissionSet (SecurityAction.Deny, Unrestricted = true)]
+		public void Deny_Unrestricted ()
+		{
+			DataGridPagerStyleTest unit = new DataGridPagerStyleTest ();
+			unit.DataGridPagerStyle_Defaults ();
+			unit.DataGridPagerStyle_Assignment ();
+			unit.DataGridPagerStyle_Copy ();
+			unit.DataGridPagerStyle_Merge ();
+			unit.DataGridPagerStyle_Reset ();
+		}
+
+		// LinkDemand
+
+		public override object CreateControl (SecurityAction action, AspNetHostingPermissionLevel level)
+		{
+			// no public ctor but we know the properties aren't protected
+			MethodInfo mi = this.Type.GetProperty ("Visible").GetGetMethod ();
+			Assert.IsNotNull (mi, "Visible");
+			return mi.Invoke (pager_style, null);
+		}
+
+		public override Type Type {
+			get { return typeof (DataGridPagerStyle); }
+		}
+	}
+}

+ 68 - 0
mcs/class/System.Web/Test/System.Web.UI.WebControls/DataKeyCollectionCas.cs

@@ -0,0 +1,68 @@
+//
+// DataKeyCollectionCas.cs 
+//	- CAS unit tests for System.Web.UI.WebControls.DataKeyCollection
+//
+// Author:
+//	Sebastien Pouliot  <[email protected]>
+//
+// 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.
+//
+
+using NUnit.Framework;
+
+using System;
+using System.Collections;
+using System.Reflection;
+using System.Security.Permissions;
+using System.Web;
+using System.Web.UI.WebControls;
+
+using MonoTests.System.Web.UI.WebControls;
+
+namespace MonoCasTests.System.Web.UI.WebControls {
+
+	[TestFixture]
+	[Category ("CAS")]
+	public class DataKeyCollectionCas : AspNetHostingMinimal {
+
+		[Test]
+		[PermissionSet (SecurityAction.Deny, Unrestricted = true)]
+		public void Deny_Unrestricted ()
+		{
+			DataKeyCollectionTest unit = new DataKeyCollectionTest ();
+			unit.Constructor_Empty ();
+		}
+
+		// LinkDemand
+
+		public override object CreateControl (SecurityAction action, AspNetHostingPermissionLevel level)
+		{
+			ConstructorInfo ci = this.Type.GetConstructor (new Type[1] { typeof (ArrayList) });
+			Assert.IsNotNull (ci, ".ctor(ArrayList)");
+			return ci.Invoke (new object[1] { new ArrayList () });
+		}
+
+		public override Type Type {
+			get { return typeof (DataKeyCollection); }
+		}
+	}
+}

+ 74 - 0
mcs/class/System.Web/Test/System.Web.UI.WebControls/DataListCas.cs

@@ -0,0 +1,74 @@
+//
+// DataListCas.cs 
+//	- CAS unit tests for System.Web.UI.WebControls.DataList
+//
+// Author:
+//	Sebastien Pouliot  <[email protected]>
+//
+// 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.
+//
+
+using NUnit.Framework;
+
+using System;
+using System.Security.Permissions;
+using System.Web;
+using System.Web.UI.WebControls;
+
+using MonoTests.System.Web.UI.WebControls;
+
+namespace MonoCasTests.System.Web.UI.WebControls {
+
+	[TestFixture]
+	[Category ("CAS")]
+	public class DataListCas : AspNetHostingMinimal {
+
+		[Test]
+		[PermissionSet (SecurityAction.Deny, Unrestricted = true)]
+		public void Deny_Unrestricted ()
+		{
+			DataListTest unit = new DataListTest ();
+			unit.ConstantStrings ();
+			unit.DefaultProperties ();
+			unit.NullProperties ();
+			unit.CleanProperties ();
+			unit.RepeatedItemCount ();
+			unit.GetItemStyle_Header ();
+			unit.GetItemStyle_Separator ();
+			unit.GetItemStyle_Pager_Empty ();
+			unit.Controls ();
+			unit.SelectIndexOutOfRange ();
+			unit.SaveViewState ();
+			unit.Events ();
+			unit.BubbleEvent ();
+#if NET_2_0
+			unit.SelectedValue_WithUnexistingDataKeyField ();
+#endif
+		}
+
+		// LinkDemand
+
+		public override Type Type {
+			get { return typeof (DataList); }
+		}
+	}
+}

+ 79 - 0
mcs/class/System.Web/Test/System.Web.UI.WebControls/DataListItemCas.cs

@@ -0,0 +1,79 @@
+//
+// DataListItemCas.cs 
+//	- CAS unit tests for System.Web.UI.WebControls.DataListItem
+//
+// Author:
+//	Sebastien Pouliot  <[email protected]>
+//
+// 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.
+//
+
+using NUnit.Framework;
+
+using System;
+using System.Collections;
+using System.Reflection;
+using System.Security.Permissions;
+using System.Web;
+using System.Web.UI.WebControls;
+
+using MonoTests.System.Web.UI.WebControls;
+
+namespace MonoCasTests.System.Web.UI.WebControls {
+
+	[TestFixture]
+	[Category ("CAS")]
+	public class DataListItemCas : AspNetHostingMinimal {
+
+		[Test]
+		[PermissionSet (SecurityAction.Deny, Unrestricted = true)]
+		public void Deny_Unrestricted ()
+		{
+			DataListItemTest unit = new DataListItemTest ();
+			unit.AlternatingItem ();
+			unit.EditItem ();
+			unit.Footer ();
+			unit.Header ();
+			unit.Item ();
+			unit.Pager ();
+			unit.SelectedItem ();
+			unit.Separator ();
+			unit.Bad_ListItemType ();
+			unit.Controls_Table ();
+			unit.Controls_Table_Dual ();
+			unit.Controls_LiteralControl ();
+		}
+
+		// LinkDemand
+
+		public override object CreateControl (SecurityAction action, AspNetHostingPermissionLevel level)
+		{
+			ConstructorInfo ci = this.Type.GetConstructor (new Type[2] { typeof (int), typeof (ListItemType) });
+			Assert.IsNotNull (ci, ".ctor(int,ListItemType)");
+			return ci.Invoke (new object[2] { 0, ListItemType.Item });
+		}
+
+		public override Type Type {
+			get { return typeof (DataListItem); }
+		}
+	}
+}

+ 68 - 0
mcs/class/System.Web/Test/System.Web.UI.WebControls/DataListItemCollectionCas.cs

@@ -0,0 +1,68 @@
+//
+// DataListItemCollectionCas.cs 
+//	- CAS unit tests for System.Web.UI.WebControls.DataListItemCollection
+//
+// Author:
+//	Sebastien Pouliot  <[email protected]>
+//
+// 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.
+//
+
+using NUnit.Framework;
+
+using System;
+using System.Collections;
+using System.Reflection;
+using System.Security.Permissions;
+using System.Web;
+using System.Web.UI.WebControls;
+
+using MonoTests.System.Web.UI.WebControls;
+
+namespace MonoCasTests.System.Web.UI.WebControls {
+
+	[TestFixture]
+	[Category ("CAS")]
+	public class DataListItemCollectionCas : AspNetHostingMinimal {
+
+		[Test]
+		[PermissionSet (SecurityAction.Deny, Unrestricted = true)]
+		public void Deny_Unrestricted ()
+		{
+			DataListItemCollectionTest unit = new DataListItemCollectionTest ();
+			unit.Constructor_Empty ();
+		}
+
+		// LinkDemand
+
+		public override object CreateControl (SecurityAction action, AspNetHostingPermissionLevel level)
+		{
+			ConstructorInfo ci = this.Type.GetConstructor (new Type[1] { typeof (ArrayList) });
+			Assert.IsNotNull (ci, ".ctor(ArrayList)");
+			return ci.Invoke (new object[1] { new ArrayList () });
+		}
+
+		public override Type Type {
+			get { return typeof (DataListItemCollection); }
+		}
+	}
+}

+ 69 - 0
mcs/class/System.Web/Test/System.Web.UI.WebControls/DropDownListCas.cs

@@ -0,0 +1,69 @@
+//
+// DropDownListCas.cs 
+//	- CAS unit tests for System.Web.UI.WebControls.DropDownList
+//
+// Author:
+//	Sebastien Pouliot  <[email protected]>
+//
+// 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.
+//
+
+using NUnit.Framework;
+
+using System;
+using System.Security.Permissions;
+using System.Web;
+using System.Web.UI.WebControls;
+
+using MonoTests.System.Web.UI.WebControls;
+
+namespace MonoCasTests.System.Web.UI.WebControls {
+
+	[TestFixture]
+	[Category ("CAS")]
+	public class DropDownListCas : AspNetHostingMinimal {
+
+		[Test]
+		[PermissionSet (SecurityAction.Deny, Unrestricted = true)]
+		public void Deny_Unrestricted ()
+		{
+			DropDownListTest unit = new DropDownListTest ();
+			unit.DropDownList_Defaults ();
+			unit.DropDownListBasic ();
+			unit.DropDownListProperties ();
+			unit.DropDownListSelectedCheck ();
+			unit.DropDownListNull ();
+			unit.DropDownNamingTest ();
+			unit.InitialSelectionMade ();
+			unit.TestValueFieldAndTextFormat ();
+#if NET_2_0
+			unit.DropDownNullWriterTest ();
+#endif
+		}
+
+		// LinkDemand
+
+		public override Type Type {
+			get { return typeof (DropDownList); }
+		}
+	}
+}

+ 62 - 0
mcs/class/System.Web/Test/System.Web.UI.WebControls/EditCommandColumnCas.cs

@@ -0,0 +1,62 @@
+//
+// EditCommandColumnCas.cs 
+//	- CAS unit tests for System.Web.UI.WebControls.EditCommandColumn
+//
+// Author:
+//	Sebastien Pouliot  <[email protected]>
+//
+// 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.
+//
+
+using NUnit.Framework;
+
+using System;
+using System.Security.Permissions;
+using System.Web;
+using System.Web.UI.WebControls;
+
+using MonoTests.System.Web.UI.WebControls;
+
+namespace MonoCasTests.System.Web.UI.WebControls {
+
+	[TestFixture]
+	[Category ("CAS")]
+	public class EditCommandColumnCas : AspNetHostingMinimal {
+
+		[Test]
+		[PermissionSet (SecurityAction.Deny, Unrestricted = true)]
+		public void Deny_Unrestricted ()
+		{
+			EditCommandColumnTest unit = new EditCommandColumnTest ();
+			unit.Defaults ();
+			unit.Properties ();
+			unit.InitializeCell ();
+			unit.InitializeEditCell ();
+		}
+
+		// LinkDemand
+
+		public override Type Type {
+			get { return typeof (EditCommandColumn); }
+		}
+	}
+}

+ 77 - 0
mcs/class/System.Web/Test/System.Web.UI.WebControls/FontInfoCas.cs

@@ -0,0 +1,77 @@
+//
+// FontInfoCas.cs 
+//	- CAS unit tests for System.Web.UI.WebControls.FontInfo
+//
+// Author:
+//	Sebastien Pouliot  <[email protected]>
+//
+// 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.
+//
+
+using NUnit.Framework;
+
+using System;
+using System.Reflection;
+using System.Security.Permissions;
+using System.Web;
+using System.Web.UI.WebControls;
+
+using MonoTests.System.Web.UI.WebControls;
+
+namespace MonoCasTests.System.Web.UI.WebControls {
+
+	[TestFixture]
+	[Category ("CAS")]
+	public class FontInfoCas : AspNetHostingMinimal {
+
+		private FontInfo fi;
+
+		[TestFixtureSetUp]
+		public void FixtureSetUp ()
+		{
+			fi = new Style ().Font;
+		}
+
+		[Test]
+		[PermissionSet (SecurityAction.Deny, Unrestricted = true)]
+		public void Deny_Unrestricted ()
+		{
+			FontInfoTest unit = new FontInfoTest ();
+			unit.Style_Defaults ();
+			unit.Style_Copy ();
+			unit.Style_Merge ();
+		}
+
+		// LinkDemand
+
+		public override object CreateControl (SecurityAction action, AspNetHostingPermissionLevel level)
+		{
+			MethodInfo mi = this.Type.GetProperty ("Bold").GetGetMethod ();
+			Assert.IsNotNull (mi, "Bold");
+			return mi.Invoke (fi, null);
+		}
+
+		public override Type Type {
+			get { return typeof (FontInfo); }
+		}
+	}
+}

+ 59 - 0
mcs/class/System.Web/Test/System.Web.UI.WebControls/FontNamesConverterCas.cs

@@ -0,0 +1,59 @@
+//
+// FontNamesConverterCas.cs 
+//	- CAS unit tests for System.Web.UI.WebControls.FontNamesConverter
+//
+// Author:
+//	Sebastien Pouliot  <[email protected]>
+//
+// 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.
+//
+
+using NUnit.Framework;
+
+using System;
+using System.Security.Permissions;
+using System.Web;
+using System.Web.UI.WebControls;
+
+using MonoTests.System.Web.UI.WebControls;
+
+namespace MonoCasTests.System.Web.UI.WebControls {
+
+	[TestFixture]
+	[Category ("CAS")]
+	public class FontNamesConverterCas : AspNetHostingMinimal {
+
+		[Test]
+		[PermissionSet (SecurityAction.Deny, Unrestricted = true)]
+		public void Deny_Unrestricted ()
+		{
+			FontNamesConverterTest unit = new FontNamesConverterTest ();
+			unit.Basic ();
+		}
+
+		// LinkDemand
+
+		public override Type Type {
+			get { return typeof (FontNamesConverter); }
+		}
+	}
+}

+ 73 - 0
mcs/class/System.Web/Test/System.Web.UI.WebControls/FontUnitCas.cs

@@ -0,0 +1,73 @@
+//
+// FontUnitCas.cs 
+//	- CAS unit tests for System.Web.UI.WebControls.FontUnit
+//
+// Author:
+//	Sebastien Pouliot  <[email protected]>
+//
+// 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.
+//
+
+using NUnit.Framework;
+
+using System;
+using System.Reflection;
+using System.Security.Permissions;
+using System.Web;
+using System.Web.UI.WebControls;
+
+using MonoTests.System.Web.UI.WebControls;
+
+namespace MonoCasTests.System.Web.UI.WebControls {
+
+	[TestFixture]
+	[Category ("CAS")]
+	public class FontUnitCas : AspNetHostingNone {
+
+		[Test]
+		[PermissionSet (SecurityAction.Deny, Unrestricted = true)]
+		public void Deny_Unrestricted ()
+		{
+			FontUnitTest unit = new FontUnitTest ();
+			unit.FontUnitConstructors ();
+			unit.FontUnitConstructors_Pixel ();
+			unit.FontUnitConstructors_Point ();
+			unit.UnitEquality ();
+#if NET_2_0
+			unit.FontUnit_IFormatProviderToString ();
+#endif
+		}
+
+		// LinkDemand
+
+		public override object CreateControl (SecurityAction action, AspNetHostingPermissionLevel level)
+		{
+			ConstructorInfo ci = this.Type.GetConstructor (new Type[1] { typeof (int) });
+			Assert.IsNotNull (ci, ".ctor(int)");
+			return ci.Invoke (new object[1] { 1 });
+		}
+
+		public override Type Type {
+			get { return typeof (FontUnit); }
+		}
+	}
+}

+ 63 - 0
mcs/class/System.Web/Test/System.Web.UI.WebControls/FormViewCas.cs

@@ -0,0 +1,63 @@
+//
+// FormViewCas.cs 
+//	- CAS unit tests for System.Web.UI.WebControls.FormView
+//
+// Author:
+//	Sebastien Pouliot  <[email protected]>
+//
+// 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.Security.Permissions;
+using System.Web;
+using System.Web.UI.WebControls;
+
+using MonoTests.System.Web.UI.WebControls;
+
+namespace MonoCasTests.System.Web.UI.WebControls {
+
+	[TestFixture]
+	[Category ("CAS")]
+	public class FormViewCas : AspNetHostingMinimal {
+
+		[Test]
+		[PermissionSet (SecurityAction.Deny, Unrestricted = true)]
+		public void Deny_Unrestricted ()
+		{
+			FormViewTest unit = new FormViewTest ();
+			unit.Defaults ();
+		}
+
+		// LinkDemand
+
+		public override Type Type {
+			get { return typeof (FormView); }
+		}
+	}
+}
+
+#endif

+ 62 - 0
mcs/class/System.Web/Test/System.Web.UI.WebControls/HyperLinkCas.cs

@@ -0,0 +1,62 @@
+//
+// HyperLinkCas.cs 
+//	- CAS unit tests for System.Web.UI.WebControls.HyperLink
+//
+// Author:
+//	Sebastien Pouliot  <[email protected]>
+//
+// 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.
+//
+
+using NUnit.Framework;
+
+using System;
+using System.Security.Permissions;
+using System.Web;
+using System.Web.UI.WebControls;
+
+using MonoTests.System.Web.UI.WebControls;
+
+namespace MonoCasTests.System.Web.UI.WebControls {
+
+	[TestFixture]
+	[Category ("CAS")]
+	public class HyperLinkCas : AspNetHostingMinimal {
+
+		[Test]
+		[PermissionSet (SecurityAction.Deny, Unrestricted = true)]
+		public void Deny_Unrestricted ()
+		{
+			HyperLinkTest unit = new HyperLinkTest ();
+			unit.Empty ();
+			unit.ImageUrlWithoutText ();
+			unit.NavigateUrl_NO_ResolveUrl ();
+			unit.ImageUrl_NO_ResolveUrl ();
+		}
+
+		// LinkDemand
+
+		public override Type Type {
+			get { return typeof (HyperLink); }
+		}
+	}
+}

+ 62 - 0
mcs/class/System.Web/Test/System.Web.UI.WebControls/HyperLinkColumnCas.cs

@@ -0,0 +1,62 @@
+//
+// HyperLinkColumnCas.cs 
+//	- CAS unit tests for System.Web.UI.WebControls.HyperLinkColumn
+//
+// Author:
+//	Sebastien Pouliot  <[email protected]>
+//
+// 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.
+//
+
+using NUnit.Framework;
+
+using System;
+using System.Security.Permissions;
+using System.Web;
+using System.Web.UI.WebControls;
+
+using MonoTests.System.Web.UI.WebControls;
+
+namespace MonoCasTests.System.Web.UI.WebControls {
+
+	[TestFixture]
+	[Category ("CAS")]
+	public class HyperLinkColumnCas : AspNetHostingMinimal {
+
+		[Test]
+		[PermissionSet (SecurityAction.Deny, Unrestricted = true)]
+		public void Deny_Unrestricted ()
+		{
+			HyperLinkColumnTest unit = new HyperLinkColumnTest ();
+			unit.SetUpTest ();
+			unit.DataNavigateUrlFieldTest ();
+			unit.FormatTest ();
+			unit.InitCellTest ();
+		}
+
+		// LinkDemand
+
+		public override Type Type {
+			get { return typeof (HyperLinkColumn); }
+		}
+	}
+}

+ 61 - 0
mcs/class/System.Web/Test/System.Web.UI.WebControls/ImageButtonCas.cs

@@ -0,0 +1,61 @@
+//
+// ImageButtonCas.cs 
+//	- CAS unit tests for System.Web.UI.WebControls.ImageButton
+//
+// Author:
+//	Sebastien Pouliot  <[email protected]>
+//
+// 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.
+//
+
+using NUnit.Framework;
+
+using System;
+using System.Security.Permissions;
+using System.Web;
+using System.Web.UI.WebControls;
+
+using MonoTests.System.Web.UI.WebControls;
+
+namespace MonoCasTests.System.Web.UI.WebControls {
+
+	[TestFixture]
+	[Category ("CAS")]
+	public class ImageButtonCas : AspNetHostingMinimal {
+
+		[Test]
+		[PermissionSet (SecurityAction.Deny, Unrestricted = true)]
+		public void Deny_Unrestricted ()
+		{
+			ImageButtonTest unit = new ImageButtonTest ();
+			unit.ImageButton_DefaultValues ();
+			unit.ImageButton_Render ();
+			unit.ImageButton_ViewState ();
+		}
+
+		// LinkDemand
+
+		public override Type Type {
+			get { return typeof (ImageButton); }
+		}
+	}
+}

+ 62 - 0
mcs/class/System.Web/Test/System.Web.UI.WebControls/ImageCas.cs

@@ -0,0 +1,62 @@
+//
+// ImageCas.cs 
+//	- CAS unit tests for System.Web.UI.WebControls.Image
+//
+// Author:
+//	Sebastien Pouliot  <[email protected]>
+//
+// 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.
+//
+
+using NUnit.Framework;
+
+using System;
+using System.Security.Permissions;
+using System.Web;
+using System.Web.UI.WebControls;
+
+using MonoTests.System.Web.UI.WebControls;
+
+namespace MonoCasTests.System.Web.UI.WebControls {
+
+	[TestFixture]
+	[Category ("CAS")]
+	public class ImageCas : AspNetHostingMinimal {
+
+		[Test]
+		[PermissionSet (SecurityAction.Deny, Unrestricted = true)]
+		public void Deny_Unrestricted ()
+		{
+			ImageTest unit = new ImageTest ();
+			unit.DefaultProperties ();
+			unit.NullProperties ();
+			unit.CleanProperties ();
+			unit.Render ();
+		}
+
+		// LinkDemand
+
+		public override Type Type {
+			get { return typeof (Image); }
+		}
+	}
+}