+2005-09-19 Sebastien Pouliot <sebastien@ximian.com>
+
+ * HtmlAnchorCas.cs: Added "normal" unit tests execution under Deny
+ Unrestricted.
+ * HtmlAnchorTest.cs: RaisePostBackEvent now throws a NRE under 2.0 RC.
+ * HtmlButtonCas.cs: Added "normal" unit tests execution under Deny
+ Unrestricted.
+ * HtmlContainerControlCas.cs: New. CAS unit tests.
+ * HtmlFormCas.cs: Added "normal" unit tests execution under Deny
+ Unrestricted.
+ * HtmlFormTest.cs: Fixed rendering output under 2.0 RC.
+ * HtmlImageCas.cs: Added "normal" unit tests execution under Deny
+ Unrestricted.
+ * HtmlInputButtonCas.cs: Added "normal" unit tests execution under
+ Deny Unrestricted.
+ * HtmlInputButtonTest.cs: Fixed attribute count for 2.0 RC.
+ * HtmlInputControlCas.cs: New. CAS unit tests.
+ * HtmlInputControlTest.cs: Fixed attribute count for 2.0 RC.
+ * HtmlInputCheckBoxCas.cs: Added "normal" unit tests execution under
+ Deny Unrestricted.
+ * HtmlInputCheckBoxTest.cs: Fixed attribute count for 2.0 RC (which is
+ now identical to 1.x results).
+ * HtmlInputFileCas.cs: Added "normal" unit tests execution under Deny
+ Unrestricted.
+ * HtmlInputFileTest.cs: Fixed attribute count for 2.0 RC.
+ * HtmlInputHiddenCas.cs: Fixed attribute count for 2.0 RC.
+ * HtmlInputPasswordCas.cs: Added "normal" unit tests execution under
+ Deny Unrestricted.
+ * HtmlInputPasswordTest.cs: Adjusted tests as 2.0 RC removed the
+ ctor(string).
+ * HtmlInputRadioButtonCas.cs: Fixed attribute count for 2.0 RC.
+ * HtmlInputRadioButtonTest.cs: Added "normal" unit tests execution
+ under Deny Unrestricted.
+ * HtmlInputResetCas.cs: Added "normal" unit tests execution under Deny
+ Unrestricted.
+ * HtmlInputResetTest.cs: Fixed attribute count for 2.0 RC.
+ * HtmlInputSubmitCas.cs: Added "normal" unit tests execution under
+ Deny Unrestricted.
+ * HtmlInputSubmitTest.cs: Fixed attribute count for 2.0 RC.
+ * HtmlInputTextCas.cs: Added "normal" unit tests execution under Deny
+ Unrestricted.
+ * HtmlInputTextTest.cs: Fixed attribute count for 2.0 RC.
+ * HtmlLinkCas.cs: New. CAS unit tests.
+ * HtmlMetaCas.cs: New. CAS unit tests.
+ * HtmlMetaTest.cs: Fixed rendering for 2.0 RC (tag ending).
+ * HtmlSelectCas.cs: Added "normal" unit tests execution under Deny
+ Unrestricted.
+ * HtmlTableCas.cs: Added "normal" unit tests execution under Deny
+ Unrestricted.
+ * HtmlTableCellCas.cs: Added "normal" unit tests execution under Deny
+ Unrestricted.
+ * HtmlTableRowCas.cs: Added "normal" unit tests execution under Deny
+ Unrestricted.
+ * HtmlTextAreaCas.cs: New. CAS unit tests.
+
2005-09-13 Sebastien Pouliot <sebastien@ximian.com>
* HtmlInputTextTest.cs: Fix expected value for LoadPostData (in the
using NUnit.Framework;
using System;
+using System.Security.Permissions;
using System.Web.UI.HtmlControls;
+using MonoTests.System.Web.UI.HtmlControls;
+
namespace MonoCasTests.System.Web.UI.HtmlControls {
[TestFixture]
[Category ("CAS")]
public class HtmlAnchorCas : AspNetHostingMinimal {
+ [Test]
+ [PermissionSet (SecurityAction.Deny, Unrestricted = true)]
+ public void Deny_Unrestricted ()
+ {
+ HtmlAnchorTest unit = new HtmlAnchorTest ();
+ unit.DefaultProperties ();
+ unit.NullProperties ();
+ unit.Target ();
+ unit.HRef ();
+ unit.AbsoluteHRef ();
+ unit.RenderAttributes ();
+#if ONLY_1_1
+ // sadly this started to throw NRE in 2.0 RC
+ unit.IPostBackEventHandler_RaisePostBackEvent ();
+#endif
+ }
+
public override Type Type {
get { return typeof (HtmlAnchor); }
}
}
[Test]
+#if NET_2_0
+ [ExpectedException (typeof (NullReferenceException))] // since 2.0 RC :-(
+#endif
public void IPostBackEventHandler_RaisePostBackEvent ()
{
TestHtmlAnchor a = new TestHtmlAnchor ();
}
#if NET_2_0
[Test]
+ [ExpectedException (typeof (NullReferenceException))] // since 2.0 RC :-(
public void RaisePostBackEvent ()
{
TestHtmlAnchor a = new TestHtmlAnchor ();
using NUnit.Framework;
using System;
+using System.Security.Permissions;
using System.Web.UI.HtmlControls;
+using MonoTests.System.Web.UI.HtmlControls;
+
namespace MonoCasTests.System.Web.UI.HtmlControls {
[TestFixture]
[Category ("CAS")]
public class HtmlButtonCas : AspNetHostingMinimal {
+ [Test]
+ [PermissionSet (SecurityAction.Deny, Unrestricted = true)]
+ public void Deny_Unrestricted ()
+ {
+ HtmlButtonTest unit = new HtmlButtonTest ();
+ unit.Defaults ();
+ unit.CleanProperties ();
+ unit.ViewState ();
+ unit.RenderAttributes ();
+ }
+
public override Type Type {
get { return typeof (HtmlButton); }
}
--- /dev/null
+//
+// HtmlContainerControlCas.cs
+// - CAS unit tests for System.Web.UI.HtmlControls.HtmlContainerControl
+//
+// Author:
+// Sebastien Pouliot <sebastien@ximian.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.
+//
+
+using NUnit.Framework;
+
+using System;
+using System.Security.Permissions;
+using System.Web.UI.HtmlControls;
+
+using MonoTests.System.Web.UI.HtmlControls;
+
+namespace MonoCasTests.System.Web.UI.HtmlControls {
+
+ [TestFixture]
+ [Category ("CAS")]
+ public class HtmlContainerControlCas {
+
+ // note: we do not inherit from AspNetHostingMinimal because
+ // HtmlContainerControl is an abstract class
+
+ [Test]
+ [PermissionSet (SecurityAction.Deny, Unrestricted = true)]
+ public void Deny_Unrestricted ()
+ {
+ HtmlContainerControlTest unit = new HtmlContainerControlTest ();
+ unit.DefaultProperties ();
+ unit.NullProperties ();
+ unit.CleanProperties ();
+ unit.Render ();
+ }
+ }
+}
using NUnit.Framework;
using System;
+using System.Security.Permissions;
using System.Web.UI.HtmlControls;
+using MonoTests.System.Web.UI.HtmlControls;
+
namespace MonoCasTests.System.Web.UI.HtmlControls {
[TestFixture]
[Category ("CAS")]
public class HtmlFormCas : AspNetHostingMinimal {
+ [Test]
+ [PermissionSet (SecurityAction.Deny, Unrestricted = true)]
+ public void Deny_Unrestricted ()
+ {
+ HtmlFormTest unit = new HtmlFormTest ();
+ unit.DefaultProperties ();
+ unit.NullProperties ();
+ unit.Attributes ();
+ unit.ViewState ();
+ unit.Name_InsideNaming ();
+ unit.RenderChildren ();
+#if NET_2_0
+ unit.ControlCollection ();
+#endif
+ }
+
public override Type Type {
get { return typeof (HtmlForm); }
}
Page p = new Page();
FormPoker form = new FormPoker ();
form.Page = p;
-
+#if NET_2_0
+ Assert.AreEqual ("\r\n<div>\r\n<input type=\"hidden\" name=\"__VIEWSTATE\" id=\"\r\n__VIEWSTATE\" value=\"\" />\r\n</div>\r\n", form.RenderChildren (), "A1");
+#else
Assert.AreEqual ("\r\n<input type=\"hidden\" name=\"__VIEWSTATE\" value=\"\" />", form.RenderChildren (), "A1");
+#endif
}
#if NET_2_0
using NUnit.Framework;
using System;
+using System.Security.Permissions;
using System.Web.UI.HtmlControls;
+using MonoTests.System.Web.UI.HtmlControls;
+
namespace MonoCasTests.System.Web.UI.HtmlControls {
[TestFixture]
[Category ("CAS")]
public class HtmlImageCas : AspNetHostingMinimal {
+ [Test]
+ [PermissionSet (SecurityAction.Deny, Unrestricted = true)]
+ public void Deny_Unrestricted ()
+ {
+ HtmlImageTest unit = new HtmlImageTest ();
+ unit.DefaultProperties ();
+ unit.NullProperties ();
+ unit.Negative ();
+ unit.RenderAttributes ();
+ }
+
public override Type Type {
get { return typeof (HtmlImage); }
}
using NUnit.Framework;
using System;
+using System.Security.Permissions;
using System.Web.UI.HtmlControls;
+using MonoTests.System.Web.UI.HtmlControls;
+
namespace MonoCasTests.System.Web.UI.HtmlControls {
[TestFixture]
[Category ("CAS")]
public class HtmlInputButtonCas : AspNetHostingMinimal {
+ [Test]
+ [PermissionSet (SecurityAction.Deny, Unrestricted = true)]
+ public void Deny_Unrestricted ()
+ {
+ HtmlInputButtonTest unit = new HtmlInputButtonTest ();
+ unit.Defaults ();
+ unit.CleanProperties ();
+ unit.ViewState ();
+ unit.RenderAttributes ();
+ }
+
public override Type Type {
get { return typeof (HtmlInputButton); }
}
#if NET_2_0
p.ValidationGroup = "VG";
- Assert.AreEqual (2, p.Attributes.Count, "A1");
+ Assert.AreEqual (3, p.Attributes.Count, "A1");
#else
Assert.AreEqual (2, p.Attributes.Count, "A1");
#endif
using NUnit.Framework;
using System;
+using System.Security.Permissions;
using System.Web.UI.HtmlControls;
+using MonoTests.System.Web.UI.HtmlControls;
+
namespace MonoCasTests.System.Web.UI.HtmlControls {
[TestFixture]
[Category ("CAS")]
public class HtmlInputCheckBoxCas : AspNetHostingMinimal {
+ [Test]
+ [PermissionSet (SecurityAction.Deny, Unrestricted = true)]
+ public void Deny_Unrestricted ()
+ {
+ HtmlInputCheckBoxTest unit = new HtmlInputCheckBoxTest ();
+ unit.DefaultProperties ();
+ unit.NullProperties ();
+ unit.CleanProperties ();
+ unit.Render ();
+ }
+
public override Type Type {
get { return typeof (HtmlInputCheckBox); }
}
public void DefaultProperties ()
{
HtmlInputCheckBox c = new HtmlInputCheckBox ();
-
-#if NET_2_0
- Assert.AreEqual (0, c.Attributes.Count, "Attributes.Count");
-#else
+
Assert.AreEqual (1, c.Attributes.Count, "Attributes.Count");
-#endif
Assert.IsFalse (c.Checked, "Checked");
-#if NET_2_0
- Assert.AreEqual (0, c.Attributes.Count, "Attributes.Count after");
-#else
Assert.AreEqual (1, c.Attributes.Count, "Attributes.Count after");
-#endif
}
[Test]
{
HtmlInputCheckBox c = new HtmlInputCheckBox ();
-#if NET_2_0
- Assert.AreEqual (0, c.Attributes.Count, "Attributes.Count");
-#else
Assert.AreEqual (1, c.Attributes.Count, "Attributes.Count");
-#endif
c.Checked = true;
Assert.IsTrue (c.Checked, "Checked");
-#if NET_2_0
- Assert.AreEqual (1, c.Attributes.Count, "Attributes.Count after");
-#else
Assert.AreEqual (2, c.Attributes.Count, "Attributes.Count after");
-#endif
}
[Test]
HtmlInputCheckBox c = new HtmlInputCheckBox ();
c.Checked = true;
-
-#if NET_2_0
- Assert.AreEqual (1, c.Attributes.Count, "Attributes.Count");
-#else
Assert.AreEqual (2, c.Attributes.Count, "Attributes.Count");
-#endif
c.Checked = false;
-
-#if NET_2_0
- Assert.AreEqual (0, c.Attributes.Count, "Attributes.Count after");
-#else
Assert.AreEqual (1, c.Attributes.Count, "Attributes.Count after");
-#endif
}
[Test]
--- /dev/null
+//
+// HtmlInputControlCas.cs
+// - CAS unit tests for System.Web.UI.HtmlControls.HtmlInputControl
+//
+// Author:
+// Sebastien Pouliot <sebastien@ximian.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.
+//
+
+using NUnit.Framework;
+
+using System;
+using System.Security.Permissions;
+using System.Web.UI.HtmlControls;
+
+using MonoTests.System.Web.UI.HtmlControls;
+
+namespace MonoCasTests.System.Web.UI.HtmlControls {
+
+ [TestFixture]
+ [Category ("CAS")]
+ public class HtmlInputControlCas {
+
+ // note: we do not inherit from AspNetHostingMinimal because
+ // HtmlInputControl is an abstract class
+
+ [Test]
+ [PermissionSet (SecurityAction.Deny, Unrestricted = true)]
+ public void Deny_Unrestricted ()
+ {
+ HtmlInputControlTest unit = new HtmlInputControlTest ();
+ unit.DefaultProperties ();
+ unit.NullProperties ();
+ unit.CleanProperties ();
+ unit.Name ();
+ unit.Name_InsideNaming ();
+ unit.IDversusValue ();
+ unit.RenderAttributes ();
+ unit.Constructor_Null ();
+ unit.Password ();
+ }
+ }
+}
[TestFixture]
public class HtmlInputControlTest {
-#if NET_2_0
- private const int defaultAttributesCount = 0;
-#else
- // type is kept in Attributes under 1.x
private const int defaultAttributesCount = 1;
-#endif
[Test]
public void DefaultProperties ()
using NUnit.Framework;
using System;
+using System.Security.Permissions;
using System.Web.UI.HtmlControls;
+using MonoTests.System.Web.UI.HtmlControls;
+
namespace MonoCasTests.System.Web.UI.HtmlControls {
[TestFixture]
[Category ("CAS")]
public class HtmlInputFileCas : AspNetHostingMinimal {
+ [Test]
+ [PermissionSet (SecurityAction.Deny, Unrestricted = true)]
+ public void Deny_Unrestricted ()
+ {
+ HtmlInputFileTest unit = new HtmlInputFileTest ();
+ unit.Defaults ();
+ unit.Attribute_Count ();
+ unit.RenderAttributes ();
+ }
+
public override Type Type {
get { return typeof (HtmlInputFile); }
}
p.MaxLength = 50;
p.Size = 20;
-#if NET_2_0
- Assert.AreEqual (3, p.Attributes.Count, "A1");
-#else
Assert.AreEqual (4, p.Attributes.Count, "A1");
-#endif
}
#if false
using NUnit.Framework;
using System;
+using System.Security.Permissions;
using System.Web.UI.HtmlControls;
+using MonoTests.System.Web.UI.HtmlControls;
+
namespace MonoCasTests.System.Web.UI.HtmlControls {
[TestFixture]
[Category ("CAS")]
public class HtmlInputHiddenCas : AspNetHostingMinimal {
+ [Test]
+ [PermissionSet (SecurityAction.Deny, Unrestricted = true)]
+ public void Deny_Unrestricted ()
+ {
+ HtmlInputHiddenTest unit = new HtmlInputHiddenTest ();
+ unit.Defaults ();
+ unit.PropertiesNull ();
+ unit.Postback ();
+ unit.TestPostbackHandling ();
+ unit.Render ();
+ }
+
public override Type Type {
get { return typeof (HtmlInputHidden); }
}
using NUnit.Framework;
using System;
+using System.Security.Permissions;
using System.Web.UI.HtmlControls;
+using MonoTests.System.Web.UI.HtmlControls;
+
namespace MonoCasTests.System.Web.UI.HtmlControls {
[TestFixture]
[Category ("CAS")]
public class HtmlInputPasswordCas : AspNetHostingMinimal {
+ [Test]
+ [PermissionSet (SecurityAction.Deny, Unrestricted = true)]
+ public void Deny_Unrestricted ()
+ {
+ HtmlInputPasswordTest unit = new HtmlInputPasswordTest ();
+ unit.DefaultProperties ();
+ unit.RenderAttributes ();
+ unit.IPostBackDataHandler_RaisePostBackEvent ();
+ unit.IPostBackDataHandler_LoadPostData ();
+ unit.RaisePostBackEvent ();
+ unit.LoadPostData ();
+ }
+
public override Type Type {
get { return typeof (HtmlInputPassword); }
}
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+#if NET_2_0
+
using System;
using System.Collections.Specialized;
using System.IO;
using NUnit.Framework;
-#if NET_2_0
namespace MonoTests.System.Web.UI.HtmlControls {
public class TestHtmlInputPassword : HtmlInputPassword {
{
}
- public TestHtmlInputPassword (string type)
- : base (type)
- {
- }
-
public string RenderAttributes ()
{
HtmlTextWriter writer = new HtmlTextWriter (new StringWriter ());
public string AttributeNewValue {
get { return attr_new_value; }
}
-#if NET_2_0
+
public bool LoadPost (string key, NameValueCollection nvc)
{
return base.LoadPostData (key, nvc);
{
base.RaisePostDataChangedEvent ();
}
-#endif
}
[TestFixture]
public class HtmlInputPasswordTest {
- private const int defaultAttributesCount = 0;
- [Test]
- public void ConstructorType ()
- {
- HtmlInputPassword it = new HtmlInputPassword ("mono");
- Assert.AreEqual ("mono", it.Type, "Type");
- }
+ private const int defaultAttributesCount = 1;
[Test]
public void DefaultProperties ()
using NUnit.Framework;
using System;
+using System.Security.Permissions;
using System.Web.UI.HtmlControls;
+using MonoTests.System.Web.UI.HtmlControls;
+
namespace MonoCasTests.System.Web.UI.HtmlControls {
[TestFixture]
[Category ("CAS")]
public class HtmlInputRadioButtonCas : AspNetHostingMinimal {
+ [Test]
+ [PermissionSet (SecurityAction.Deny, Unrestricted = true)]
+ public void Deny_Unrestricted ()
+ {
+ HtmlInputRadioButtonTest unit = new HtmlInputRadioButtonTest ();
+ unit.DefaultProperties ();
+ unit.NullProperties ();
+ unit.CleanProperties ();
+ unit.Value_Existing ();
+ unit.Value_Resetting ();
+ unit.Value_ResetNull ();
+ unit.IDversusValue ();
+ unit.IPostBackDataHandler_RaisePostBackEvent ();
+ unit.IPostBackDataHandler_LoadPostData_WrongId ();
+ unit.IPostBackDataHandler_LoadPostData ();
+#if NET_2_0
+ unit.RaisePostBackEvent ();
+ unit.LoadPostData_WrongId ();
+ unit.LoadPostData ();
+#endif
+ }
+
public override Type Type {
get { return typeof (HtmlInputRadioButton); }
}
[TestFixture]
public class HtmlInputRadioButtonTest {
-#if NET_2_0
- private const int defaultAttributesCount = 0;
-#else
- // type is kept in Attributes under 1.x
private const int defaultAttributesCount = 1;
-#endif
[Test]
public void DefaultProperties ()
using NUnit.Framework;
using System;
+using System.Security.Permissions;
using System.Web.UI.HtmlControls;
+using MonoTests.System.Web.UI.HtmlControls;
+
namespace MonoCasTests.System.Web.UI.HtmlControls {
[TestFixture]
[Category ("CAS")]
public class HtmlInputResetCas : AspNetHostingMinimal {
+ [Test]
+ [PermissionSet (SecurityAction.Deny, Unrestricted = true)]
+ public void Deny_Unrestricted ()
+ {
+ HtmlInputResetTest unit = new HtmlInputResetTest ();
+ unit.OverrideProperties ();
+ unit.Defaults ();
+ unit.CleanProperties ();
+ unit.RenderAttributes ();
+ }
+
public override Type Type {
get { return typeof (HtmlInputReset); }
}
HtmlInputResetPoker p = new HtmlInputResetPoker ();
- Assert.AreEqual (p.Attributes.Count, 0, "A1");
+ Assert.AreEqual (p.Attributes.Count, 1, "A1");
p.DoRenderAttributes (tw);
Assert.AreEqual (sw.ToString (), " name type=\"reset\" /", "A2");
using NUnit.Framework;
using System;
+using System.Security.Permissions;
using System.Web.UI.HtmlControls;
+using MonoTests.System.Web.UI.HtmlControls;
+
namespace MonoCasTests.System.Web.UI.HtmlControls {
[TestFixture]
[Category ("CAS")]
public class HtmlInputSubmitCas : AspNetHostingMinimal {
+ [Test]
+ [PermissionSet (SecurityAction.Deny, Unrestricted = true)]
+ public void Deny_Unrestricted ()
+ {
+ HtmlInputSubmitTest unit = new HtmlInputSubmitTest ();
+ unit.Defaults ();
+ unit.CleanProperties ();
+ unit.RenderAttributes ();
+ }
+
public override Type Type {
get { return typeof (HtmlInputSubmit); }
}
HtmlInputSubmitPoker p = new HtmlInputSubmitPoker ();
- Assert.AreEqual (p.Attributes.Count, 0, "A1");
+ Assert.AreEqual (p.Attributes.Count, 1, "A1");
p.DoRenderAttributes (tw);
Assert.AreEqual (sw.ToString (), " name type=\"submit\" /", "A2");
using NUnit.Framework;
using System;
+using System.Security.Permissions;
using System.Web.UI.HtmlControls;
+using MonoTests.System.Web.UI.HtmlControls;
+
namespace MonoCasTests.System.Web.UI.HtmlControls {
[TestFixture]
[Category ("CAS")]
public class HtmlInputTextCas : AspNetHostingMinimal {
+ [Test]
+ [PermissionSet (SecurityAction.Deny, Unrestricted = true)]
+ public void Deny_Unrestricted ()
+ {
+ HtmlInputTextTest unit = new HtmlInputTextTest ();
+ unit.ConstructorType ();
+ unit.DefaultProperties ();
+ unit.CleanProperties ();
+ unit.NullProperties ();
+ unit.Password ();
+ unit.RenderAttributes ();
+ unit.RenderAttributes_Password ();
+ unit.IPostBackDataHandler_RaisePostBackEvent ();
+ unit.IPostBackDataHandler_LoadPostData ();
+#if NET_2_0
+ unit.RaisePostBackEvent ();
+ unit.LoadPostData ();
+#endif
+ }
+
public override Type Type {
get { return typeof (HtmlInputText); }
}
[TestFixture]
public class HtmlInputTextTest {
-#if NET_2_0
- private const int defaultAttributesCount = 0;
-#else
- // type is kept in Attributes under 1.x
private const int defaultAttributesCount = 1;
-#endif
[Test]
public void ConstructorType ()
--- /dev/null
+//
+// HtmlLinkCas.cs
+// - CAS unit tests for System.Web.UI.HtmlControls.HtmlLink
+//
+// Author:
+// Sebastien Pouliot <sebastien@ximian.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.Security.Permissions;
+using System.Web.UI.HtmlControls;
+
+using MonoTests.System.Web.UI.HtmlControls;
+
+namespace MonoCasTests.System.Web.UI.HtmlControls {
+
+ [TestFixture]
+ [Category ("CAS")]
+ public class HtmlLinkCas : AspNetHostingMinimal {
+
+ [Test]
+ [PermissionSet (SecurityAction.Deny, Unrestricted = true)]
+ public void Deny_Unrestricted ()
+ {
+ HtmlLinkTest unit = new HtmlLinkTest ();
+ unit.Defaults ();
+ unit.Setters ();
+ unit.Render ();
+ unit.Render_EmptyHref ();
+ }
+
+ public override Type Type {
+ get { return typeof (HtmlLink); }
+ }
+ }
+}
+
+#endif
--- /dev/null
+//
+// HtmlMetaCas.cs
+// - CAS unit tests for System.Web.UI.HtmlControls.HtmlMeta
+//
+// Author:
+// Sebastien Pouliot <sebastien@ximian.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.Security.Permissions;
+using System.Web.UI.HtmlControls;
+
+using MonoTests.System.Web.UI.HtmlControls;
+
+namespace MonoCasTests.System.Web.UI.HtmlControls {
+
+ [TestFixture]
+ [Category ("CAS")]
+ public class HtmlMetaCas : AspNetHostingMinimal {
+
+ [Test]
+ [PermissionSet (SecurityAction.Deny, Unrestricted = true)]
+ public void Deny_Unrestricted ()
+ {
+ HtmlMetaTest unit = new HtmlMetaTest ();
+ unit.Defaults ();
+ unit.Setters ();
+ unit.Render ();
+ unit.Render_Empty ();
+ }
+
+ public override Type Type {
+ get { return typeof (HtmlMeta); }
+ }
+ }
+}
+
+#endif
meta.Content = "Content";
meta.HttpEquiv = "Equiv";
meta.Scheme = "Scheme";
- Assert.AreEqual ("<meta name=\"Name\" content=\"Content\" http-equiv=\"Equiv\" scheme=\"Scheme\">", meta.Render(), "A1");
+ Assert.AreEqual ("<meta name=\"Name\" content=\"Content\" http-equiv=\"Equiv\" scheme=\"Scheme\" />", meta.Render(), "A1");
}
[Test]
public void Render_Empty ()
{
HtmlMetaPoker meta = new HtmlMetaPoker ();
- Assert.AreEqual ("<meta>", meta.Render(), "A1");
+ Assert.AreEqual ("<meta />", meta.Render(), "A1");
}
}
}
using NUnit.Framework;
using System;
+using System.Security.Permissions;
using System.Web.UI.HtmlControls;
+using MonoTests.System.Web.UI.HtmlControls;
+
namespace MonoCasTests.System.Web.UI.HtmlControls {
[TestFixture]
[Category ("CAS")]
public class HtmlSelectCas : AspNetHostingMinimal {
+ [Test]
+ [PermissionSet (SecurityAction.Deny, Unrestricted = true)]
+ public void Deny_Unrestricted ()
+ {
+ HtmlSelectTest unit = new HtmlSelectTest ();
+ unit.DefaultProperties ();
+ unit.NullProperties ();
+ unit.SourceType ();
+ unit.ViewStateCount ();
+ unit.InternalDetails ();
+ unit.Multiple ();
+ unit.Big ();
+ unit.OneRowIndividual ();
+ unit.RenderAttributes ();
+ unit.DataBind1 ();
+ unit.DataBind2 ();
+ unit.DataBind3 ();
+ unit.DataBindDoubleCall ();
+ }
+
public override Type Type {
get { return typeof (HtmlSelect); }
}
using NUnit.Framework;
using System;
+using System.Security.Permissions;
using System.Web.UI.HtmlControls;
+using MonoTests.System.Web.UI.HtmlControls;
+
namespace MonoCasTests.System.Web.UI.HtmlControls {
[TestFixture]
[Category ("CAS")]
public class HtmlTableCas : AspNetHostingMinimal {
+ [Test]
+ [PermissionSet (SecurityAction.Deny, Unrestricted = true)]
+ public void Deny_Unrestricted ()
+ {
+ HtmlTableTest unit = new HtmlTableTest ();
+ unit.DefaultProperties ();
+ unit.NullProperties ();
+ unit.EmptyProperties ();
+ unit.CleanProperties ();
+ unit.MaxInt32 ();
+ unit.MinInt32 ();
+ unit.WrongTypeInt ();
+ unit.Render_Table_Simple ();
+ unit.Render_Table ();
+ unit.Render_TableRow_Simple ();
+ unit.Render_TableRow ();
+ unit.Render_TableRowCell_Simple ();
+ unit.Render_TableRowCell ();
+ unit.HtmlTableRowControlCollectionAdd ();
+ unit.HtmlTableRowControlCollectionAddAt ();
+ }
+
public override Type Type {
get { return typeof (HtmlTable); }
}
using NUnit.Framework;
using System;
+using System.Security.Permissions;
using System.Web.UI.HtmlControls;
+using MonoTests.System.Web.UI.HtmlControls;
+
namespace MonoCasTests.System.Web.UI.HtmlControls {
[TestFixture]
[Category ("CAS")]
public class HtmlTableCellCas : AspNetHostingMinimal {
+ [Test]
+ [PermissionSet (SecurityAction.Deny, Unrestricted = true)]
+ public void Deny_Unrestricted ()
+ {
+ HtmlTableCellTest unit = new HtmlTableCellTest ();
+ unit.DefaultProperties ();
+ unit.NullProperties ();
+ unit.EmptyProperties ();
+ unit.CleanProperties ();
+ unit.Render ();
+ }
+
public override Type Type {
get { return typeof (HtmlTableCell); }
}
using NUnit.Framework;
using System;
+using System.Security.Permissions;
using System.Web.UI.HtmlControls;
+using MonoTests.System.Web.UI.HtmlControls;
+
namespace MonoCasTests.System.Web.UI.HtmlControls {
[TestFixture]
[Category ("CAS")]
public class HtmlTableRowCas : AspNetHostingMinimal {
+ [Test]
+ [PermissionSet (SecurityAction.Deny, Unrestricted = true)]
+ public void Deny_Unrestricted ()
+ {
+ HtmlTableRowTest unit = new HtmlTableRowTest ();
+ unit.DefaultProperties ();
+ unit.NullProperties ();
+ unit.CleanProperties ();
+ unit.Render ();
+ unit.HtmlTableCellControlCollectionAdd ();
+ unit.HtmlTableCellControlCollectionAddAt ();
+ }
+
public override Type Type {
get { return typeof (HtmlTableRow); }
}
--- /dev/null
+//
+// HtmlTextAreaCas.cs
+// - CAS unit tests for System.Web.UI.HtmlControls.HtmlTextArea
+//
+// Author:
+// Sebastien Pouliot <sebastien@ximian.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.
+//
+
+using NUnit.Framework;
+
+using System;
+using System.Security.Permissions;
+using System.Web.UI.HtmlControls;
+
+using MonoTests.System.Web.UI.HtmlControls;
+
+namespace MonoCasTests.System.Web.UI.HtmlControls {
+
+ [TestFixture]
+ [Category ("CAS")]
+ public class HtmlTextAreaCas : AspNetHostingMinimal {
+
+ [Test]
+ [PermissionSet (SecurityAction.Deny, Unrestricted = true)]
+ public void Deny_Unrestricted ()
+ {
+ HtmlTextAreaTest unit = new HtmlTextAreaTest ();
+ unit.DefaultProperties ();
+ unit.NullProperties ();
+ unit.CleanProperties ();
+ unit.Name ();
+ unit.Value ();
+ unit.RenderAttributes ();
+ unit.Render ();
+ unit.AddParsedSubObject_LiteralControl ();
+ unit.AddParsedSubObject_DataBoundLiteralControl ();
+ unit.IPostBackDataHandler_RaisePostBackEvent ();
+ unit.IPostBackDataHandler_LoadPostData ();
+#if NET_2_0
+ unit.RaisePostBackEvent ();
+ unit.LoadPostData ();
+#endif
+ }
+
+ public override Type Type {
+ get { return typeof (HtmlTextArea); }
+ }
+ }
+}