Author: toshok
Date: 2005-09-27 22:51:24 -0400 (Tue, 27 Sep 2005)
New Revision: 50913
Added:
trunk/mcs/class/Microsoft.Web.Atlas/Test/Microsoft.Web.Services.Converters/
trunk/mcs/class/Microsoft.Web.Atlas/Test/Microsoft.Web.Services.Converters/DateTimeConverterTest.cs
trunk/mcs/class/Microsoft.Web.Atlas/Test/Microsoft.Web.Services/
trunk/mcs/class/Microsoft.Web.Atlas/Test/Microsoft.Web.Services/JavaScriptConverterTest.cs
trunk/mcs/class/Microsoft.Web.Atlas/Test/Microsoft.Web/GenericScriptComponentTest.cs
trunk/mcs/class/Microsoft.Web.Atlas/Test/Microsoft.Web/ScriptControlTest.cs
Modified:
trunk/mcs/class/Microsoft.Web.Atlas/ChangeLog
trunk/mcs/class/Microsoft.Web.Atlas/Microsoft.Web.Atlas_test.dll.sources
trunk/mcs/class/Microsoft.Web.Atlas/Test/Microsoft.Web.UI/ClickBehaviorTest.cs
trunk/mcs/class/Microsoft.Web.Atlas/Test/Microsoft.Web.UI/DataSourceDropTargetTest.cs
trunk/mcs/class/Microsoft.Web.Atlas/Test/Microsoft.Web.UI/DragDropListTest.cs
trunk/mcs/class/Microsoft.Web.Atlas/Test/Microsoft.Web.UI/DraggableListItemTest.cs
trunk/mcs/class/Microsoft.Web.Atlas/Test/Microsoft.Web.UI/FloatingBehaviorTest.cs
trunk/mcs/class/Microsoft.Web.Atlas/Test/Microsoft.Web.UI/HoverBehaviorTest.cs
trunk/mcs/class/Microsoft.Web.Atlas/Test/Microsoft.Web.UI/LabelTest.cs
trunk/mcs/class/Microsoft.Web.Atlas/Test/Microsoft.Web.UI/ListViewTest.cs
trunk/mcs/class/Microsoft.Web.Atlas/Test/Microsoft.Web.UI/PropertyFilterTest.cs
trunk/mcs/class/Microsoft.Web.Atlas/Test/Microsoft.Web.UI/TextBoxTest.cs
trunk/mcs/class/Microsoft.Web.Atlas/Test/Microsoft.Web/ScriptEventTest.cs
Log:
2005-09-27 Chris Toshok <[EMAIL PROTECTED]>
* Microsoft.Web.Atlas_test.dll.sources: add the new classes.
* Test/Microsoft.Web.UI/TextBoxTest.cs: subclass from
ScriptControlTest, and nuke the local copies of
DoEvent/Method/Property.
* Test/Microsoft.Web.UI/PropertyFilterTest.cs: same.
* Test/Microsoft.Web.UI/ListViewTest.cs: same.
* Test/Microsoft.Web.UI/DataSourceDropTargetTest.cs: same.
* Test/Microsoft.Web.UI/ClickBehaviorTest.cs: same.
* Test/Microsoft.Web.UI/DraggableListItemTest.cs: same.
* Test/Microsoft.Web.UI/HoverBehaviorTest.cs: same.
* Test/Microsoft.Web.UI/FloatingBehaviorTest.cs: same.
* Test/Microsoft.Web.UI/LabelTest.cs: same.
* Test/Microsoft.Web.UI/DragDropListTest.cs: same.
* Test/Microsoft.Web.Services.Converters/DateTimeConverterTest.cs:
new tests.
* Test/Microsoft.Web.Services/JavaScriptConverterTest.cs: new
tests.
* Test/Microsoft.Web/GenericScriptComponentTest.cs: new tests.
* Test/Microsoft.Web/ScriptEventTest.cs (RenderActions): replace
\r\n with \n so we pass both on windows and mono.
* Test/Microsoft.Web/ScriptControlTest.cs: new utility class that
contains definitions for DoEvent, DoMethod, and DoProperty for
use testing GetTypeDescriptor.
Modified: trunk/mcs/class/Microsoft.Web.Atlas/ChangeLog
===================================================================
--- trunk/mcs/class/Microsoft.Web.Atlas/ChangeLog 2005-09-28 02:40:22 UTC
(rev 50912)
+++ trunk/mcs/class/Microsoft.Web.Atlas/ChangeLog 2005-09-28 02:51:24 UTC
(rev 50913)
@@ -1,5 +1,46 @@
2005-09-27 Chris Toshok <[EMAIL PROTECTED]>
+ * Microsoft.Web.Atlas_test.dll.sources: add the new classes.
+
+ * Test/Microsoft.Web.UI/TextBoxTest.cs: subclass from
+ ScriptControlTest, and nuke the local copies of
+ DoEvent/Method/Property.
+
+ * Test/Microsoft.Web.UI/PropertyFilterTest.cs: same.
+
+ * Test/Microsoft.Web.UI/ListViewTest.cs: same.
+
+ * Test/Microsoft.Web.UI/DataSourceDropTargetTest.cs: same.
+
+ * Test/Microsoft.Web.UI/ClickBehaviorTest.cs: same.
+
+ * Test/Microsoft.Web.UI/DraggableListItemTest.cs: same.
+
+ * Test/Microsoft.Web.UI/HoverBehaviorTest.cs: same.
+
+ * Test/Microsoft.Web.UI/FloatingBehaviorTest.cs: same.
+
+ * Test/Microsoft.Web.UI/LabelTest.cs: same.
+
+ * Test/Microsoft.Web.UI/DragDropListTest.cs: same.
+
+ * Test/Microsoft.Web.Services.Converters/DateTimeConverterTest.cs:
+ new tests.
+
+ * Test/Microsoft.Web.Services/JavaScriptConverterTest.cs: new
+ tests.
+
+ * Test/Microsoft.Web/GenericScriptComponentTest.cs: new tests.
+
+ * Test/Microsoft.Web/ScriptEventTest.cs (RenderActions): replace
+ \r\n with \n so we pass both on windows and mono.
+
+ * Test/Microsoft.Web/ScriptControlTest.cs: new utility class that
+ contains definitions for DoEvent, DoMethod, and DoProperty for
+ use testing GetTypeDescriptor.
+
+2005-09-27 Chris Toshok <[EMAIL PROTECTED]>
+
* Makefile (LIB_MCS_FLAGS): add -define:API_SUGGESTIONS.
* Microsoft.Web.Atlas.dll.sources: add in all the new files.
Modified:
trunk/mcs/class/Microsoft.Web.Atlas/Microsoft.Web.Atlas_test.dll.sources
===================================================================
--- trunk/mcs/class/Microsoft.Web.Atlas/Microsoft.Web.Atlas_test.dll.sources
2005-09-28 02:40:22 UTC (rev 50912)
+++ trunk/mcs/class/Microsoft.Web.Atlas/Microsoft.Web.Atlas_test.dll.sources
2005-09-28 02:51:24 UTC (rev 50913)
@@ -1,13 +1,17 @@
Microsoft.Web/ActionTest.cs
Microsoft.Web/BindingTest.cs
+Microsoft.Web/GenericScriptComponentTest.cs
Microsoft.Web/InvokeMethodActionTest.cs
Microsoft.Web/SetPropertyActionTest.cs
Microsoft.Web/ScriptComponentBaseTest.cs
+Microsoft.Web/ScriptControlTest.cs
Microsoft.Web/ScriptEventDescriptorTest.cs
Microsoft.Web/ScriptEventTest.cs
Microsoft.Web/ScriptMethodDescriptorTest.cs
Microsoft.Web/ScriptPropertyDescriptorTest.cs
Microsoft.Web/ScriptTypeDescriptorTest.cs
+Microsoft.Web.Services/JavaScriptConverterTest.cs
+Microsoft.Web.Services.Converters/DateTimeConverterTest.cs
Microsoft.Web.UI/ClickBehaviorTest.cs
Microsoft.Web.UI/DragDropListTest.cs
Microsoft.Web.UI/DraggableListItemTest.cs
Added:
trunk/mcs/class/Microsoft.Web.Atlas/Test/Microsoft.Web/GenericScriptComponentTest.cs
===================================================================
---
trunk/mcs/class/Microsoft.Web.Atlas/Test/Microsoft.Web/GenericScriptComponentTest.cs
2005-09-28 02:40:22 UTC (rev 50912)
+++
trunk/mcs/class/Microsoft.Web.Atlas/Test/Microsoft.Web/GenericScriptComponentTest.cs
2005-09-28 02:51:24 UTC (rev 50913)
@@ -0,0 +1,109 @@
+//
+// Tests for Microsoft.Web.GenericScriptComponent
+//
+// Author:
+// Chris Toshok ([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.Generic;
+using System.Collections;
+using System.IO;
+using Microsoft.Web;
+
+namespace MonoTests.Microsoft.Web
+{
+ [TestFixture]
+ public class GenericScriptComponentTest
+ {
+ [Test]
+ public void ValueProperty ()
+ {
+ GenericScriptComponent c = new GenericScriptComponent
("generic");
+ StringWriter sw = new StringWriter();
+ ScriptTextWriter w = new ScriptTextWriter (sw);
+
+ c.AddValueProperty ("key1", "value1");
+ c.AddValueProperty ("key2", "value2");
+
+ ((IScriptComponent)c).RenderScript (w);
+
+ Assert.AreEqual ("<generic key1=\"value1\"
key2=\"value2\" />", sw.ToString (), "A1");
+ }
+
+ [Test]
+ public void ValueProperty_duplicate ()
+ {
+ GenericScriptComponent c = new GenericScriptComponent
("generic");
+ StringWriter sw = new StringWriter();
+ ScriptTextWriter w = new ScriptTextWriter (sw);
+
+ c.AddValueProperty ("key1", "value1");
+ c.AddValueProperty ("key1", "value2");
+
+ ((IScriptComponent)c).RenderScript (w);
+
+ Assert.AreEqual ("<generic key1=\"value2\" />",
sw.ToString (), "A1");
+ }
+
+ [Test]
+ public void CollectionItem ()
+ {
+ GenericScriptComponent c = new GenericScriptComponent
("generic");
+ StringWriter sw = new StringWriter();
+ ScriptTextWriter w = new ScriptTextWriter (sw);
+ GenericScriptComponent foo = new GenericScriptComponent
("foo");
+
+ c.AddCollectionItem ("behaviors", foo);
+
+ ((IScriptComponent)c).RenderScript (w);
+
+ Assert.AreEqual ("<generic>\n <behaviors>\n <foo
/>\n </behaviors>\n</generic>", sw.ToString ().Replace ("\r\n", "\n"), "A1");
+ }
+
+ [Test]
+ public void CollectionItem_duplicate ()
+ {
+ GenericScriptComponent c = new GenericScriptComponent
("generic");
+ StringWriter sw = new StringWriter();
+ ScriptTextWriter w = new ScriptTextWriter (sw);
+ GenericScriptComponent foo = new GenericScriptComponent
("foo");
+
+ c.AddCollectionItem ("behaviors", foo);
+ c.AddCollectionItem ("behaviors", foo);
+
+ c.AddCollectionItem ("behaviors2", foo);
+
+ ((IScriptComponent)c).RenderScript (w);
+
+ Assert.AreEqual ("<generic>\n <behaviors>\n <foo
/>\n <foo />\n </behaviors>\n <behaviors2>\n <foo />\n
</behaviors2>\n</generic>", sw.ToString ().Replace ("\r\n", "\n"), "A1");
+ }
+ }
+}
+#endif
Added:
trunk/mcs/class/Microsoft.Web.Atlas/Test/Microsoft.Web/ScriptControlTest.cs
===================================================================
--- trunk/mcs/class/Microsoft.Web.Atlas/Test/Microsoft.Web/ScriptControlTest.cs
2005-09-28 02:40:22 UTC (rev 50912)
+++ trunk/mcs/class/Microsoft.Web.Atlas/Test/Microsoft.Web/ScriptControlTest.cs
2005-09-28 02:51:24 UTC (rev 50913)
@@ -0,0 +1,71 @@
+//
+// Tests for Microsoft.Web.UI.ScriptControl
+//
+// Author:
+// Chris Toshok ([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.Generic;
+using System.IO;
+using Microsoft.Web;
+using Microsoft.Web.UI;
+
+namespace MonoTests.Microsoft.Web.UI
+{
+ public class ScriptControlTest
+ {
+ protected void DoEvent (ScriptEventDescriptor e, string
eventName, bool supportsActions)
+ {
+ Assert.AreEqual (eventName, e.EventName, eventName + "
EventName");
+ Assert.AreEqual (eventName, e.MemberName, eventName + "
MemberName");
+ Assert.AreEqual (supportsActions, e.SupportsActions,
eventName + " SupportsActions");
+ }
+
+ protected void DoMethod (ScriptMethodDescriptor m, string
methodName, string[] args)
+ {
+ Assert.AreEqual (methodName, m.MethodName, methodName +
" MethodName");
+ Assert.AreEqual (methodName, m.MemberName, methodName +
" MemberName");
+ Assert.AreEqual (args.Length, m.Parameters.Length,
methodName + " Parameter count");
+ for (int i = 0; i < args.Length; i ++)
+ Assert.AreEqual (args[i], m.Parameters[i],
methodName + " Parameter " + i.ToString());
+ }
+
+ protected void DoProperty (ScriptPropertyDescriptor p, string
propertyName, ScriptType type, bool readOnly, string serverPropertyName)
+ {
+ Assert.AreEqual (propertyName, p.PropertyName,
propertyName + " PropertyName");
+ Assert.AreEqual (propertyName, p.MemberName,
propertyName + " MemberName");
+ Assert.AreEqual (serverPropertyName,
p.ServerPropertyName, propertyName + " ServerPropertyName");
+ Assert.AreEqual (readOnly, p.ReadOnly, propertyName + "
ReadOnly");
+ Assert.AreEqual (type, p.Type, propertyName + " Type");
+ }
+ }
+}
+
+#endif
Modified:
trunk/mcs/class/Microsoft.Web.Atlas/Test/Microsoft.Web/ScriptEventTest.cs
===================================================================
--- trunk/mcs/class/Microsoft.Web.Atlas/Test/Microsoft.Web/ScriptEventTest.cs
2005-09-28 02:40:22 UTC (rev 50912)
+++ trunk/mcs/class/Microsoft.Web.Atlas/Test/Microsoft.Web/ScriptEventTest.cs
2005-09-28 02:51:24 UTC (rev 50913)
@@ -138,7 +138,7 @@
e.Actions.Add (action);
e.RenderActions (w);
- Assert.AreEqual ("<HelloEvent>\r\n <poker
id=\"action_id\" target=\"action_target\" />\r\n</HelloEvent>", sw.ToString(),
"A2");
+ Assert.AreEqual ("<HelloEvent>\n <poker
id=\"action_id\" target=\"action_target\" />\n</HelloEvent>",
sw.ToString().Replace ("\r\n", "\n"), "A2");
}
[Test]
Added:
trunk/mcs/class/Microsoft.Web.Atlas/Test/Microsoft.Web.Services/JavaScriptConverterTest.cs
===================================================================
---
trunk/mcs/class/Microsoft.Web.Atlas/Test/Microsoft.Web.Services/JavaScriptConverterTest.cs
2005-09-28 02:40:22 UTC (rev 50912)
+++
trunk/mcs/class/Microsoft.Web.Atlas/Test/Microsoft.Web.Services/JavaScriptConverterTest.cs
2005-09-28 02:51:24 UTC (rev 50913)
@@ -0,0 +1,75 @@
+//
+// Tests for Microsoft.Web.Services.JavaScriptConverter
+//
+// Author:
+// Chris Toshok ([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.Generic;
+using System.IO;
+using Microsoft.Web;
+using Microsoft.Web.Services;
+
+namespace MonoTests.Microsoft.Web.Services
+{
+ [TestFixture]
+ public class JavaScriptConverterTest
+ {
+ class Poker : JavaScriptConverter
+ {
+ public Type[] GetSupportedTypes ()
+ {
+ return base.SupportedTypes;
+ }
+ }
+
+ [Test]
+ public void SupportedTypes ()
+ {
+ Poker p = new Poker ();
+
+ Type[] ts = p.GetSupportedTypes();
+
+ Assert.IsNull (ts, "A1");
+ }
+
+ [Test]
+ public void SerializeObject ()
+ {
+ Poker p = new Poker ();
+ string s = p.Serialize ("hi");
+
+ Assert.IsNull (s, "A1");
+ }
+ }
+
+}
+
+#endif
Added:
trunk/mcs/class/Microsoft.Web.Atlas/Test/Microsoft.Web.Services.Converters/DateTimeConverterTest.cs
===================================================================
---
trunk/mcs/class/Microsoft.Web.Atlas/Test/Microsoft.Web.Services.Converters/DateTimeConverterTest.cs
2005-09-28 02:40:22 UTC (rev 50912)
+++
trunk/mcs/class/Microsoft.Web.Atlas/Test/Microsoft.Web.Services.Converters/DateTimeConverterTest.cs
2005-09-28 02:51:24 UTC (rev 50913)
@@ -0,0 +1,132 @@
+//
+// Tests for Microsoft.Web.Services.Converters.DateTimeConverter
+//
+// Author:
+// Chris Toshok ([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.Generic;
+using System.IO;
+using Microsoft.Web;
+using Microsoft.Web.Services;
+using Microsoft.Web.Services.Converters;
+
+namespace MonoTests.Microsoft.Web.Services.Converters
+{
+ [TestFixture]
+ public class DateTimeConverterTest
+ {
+ class Poker : DateTimeConverter
+ {
+ public Type[] GetSupportedTypes ()
+ {
+ return base.SupportedTypes;
+ }
+
+ public string ClientTypeName (Type serverType)
+ {
+ return base.GetClientTypeName (serverType);
+ }
+
+ public override object Deserialize (string s, Type t)
+ {
+ Console.WriteLine ("asked to deserialize '{0}',
with type {1}", s, t);
+ return base.Deserialize (s, t);
+ }
+
+ public void Init ()
+ {
+ base.Initialize ();
+ }
+ }
+
+ [Test]
+ public void SupportedTypes ()
+ {
+ Poker p = new Poker ();
+
+ Type[] ts = p.GetSupportedTypes();
+
+ Assert.AreEqual (1, ts.Length, "A1");
+ Assert.AreEqual (typeof (DateTime), ts[0], "A2");
+ }
+
+ [Test]
+ public void SerializeObject ()
+ {
+ Poker p = new Poker ();
+ DateTime dt = new DateTime (2005, 9, 25, 22, 30, 45);
+ string s = p.Serialize (dt);
+ Assert.AreEqual ("new Date(2005,8,25,22,30,45)", s,
"A1");
+ }
+
+ [Test]
+ [ExpectedException (typeof (ArgumentException))]
+ public void Serialize_NonDateTime ()
+ {
+ Poker p = new Poker ();
+ DateTime dt = new DateTime (2005, 9, 25);
+ string s = p.Serialize ("hi");
+ }
+
+ [Test]
+ [ExpectedException (typeof (ArgumentException))]
+ public void Serialize_Null ()
+ {
+ Poker p = new Poker ();
+ DateTime dt = new DateTime (2005, 9, 25);
+ string s = p.Serialize (null);
+ }
+
+ [Test]
+ public void ClientTypeName ()
+ {
+ Poker p = new Poker ();
+ Assert.AreEqual ("Date", p.ClientTypeName (typeof
(DateTime)), "A1");
+ Assert.AreEqual ("Date", p.ClientTypeName (typeof
(string)), "A2");
+ Assert.AreEqual ("Date", p.ClientTypeName (null), "A3");
+ }
+
+ [Test]
+ public void Deserialize ()
+ {
+ Poker p = new Poker ();
+ p.Init ();
+
+ DateTime dt = new DateTime (2005, 9, 25, 22, 30, 45);
+ string s = p.Serialize (dt);
+ dt = (DateTime)p.Deserialize (s, typeof (DateTime));
+ Assert.IsNotNull (dt, "A1");
+ }
+ }
+
+}
+
+#endif
Modified:
trunk/mcs/class/Microsoft.Web.Atlas/Test/Microsoft.Web.UI/ClickBehaviorTest.cs
===================================================================
---
trunk/mcs/class/Microsoft.Web.Atlas/Test/Microsoft.Web.UI/ClickBehaviorTest.cs
2005-09-28 02:40:22 UTC (rev 50912)
+++
trunk/mcs/class/Microsoft.Web.Atlas/Test/Microsoft.Web.UI/ClickBehaviorTest.cs
2005-09-28 02:51:24 UTC (rev 50913)
@@ -40,7 +40,7 @@
namespace MonoTests.Microsoft.Web.UI
{
[TestFixture]
- public class ClickBehaviorTest
+ public class ClickBehaviorTest : ScriptControlTest
{
[Test]
public void Properties ()
@@ -65,22 +65,6 @@
Assert.AreEqual ("", sw.ToString(), "A1");
}
- void DoEvent (ScriptEventDescriptor e, string eventName, bool
supportsActions)
- {
- Assert.AreEqual (eventName, e.EventName, eventName + "
EventName");
- Assert.AreEqual (eventName, e.MemberName, eventName + "
MemberName");
- Assert.AreEqual (supportsActions, e.SupportsActions,
eventName + " SupportsActions");
- }
-
- void DoProperty (ScriptPropertyDescriptor p, string
propertyName, ScriptType type, bool readOnly, string serverPropertyName)
- {
- Assert.AreEqual (propertyName, p.PropertyName,
propertyName + " PropertyName");
- Assert.AreEqual (propertyName, p.MemberName,
propertyName + " MemberName");
- Assert.AreEqual (serverPropertyName,
p.ServerPropertyName, propertyName + " ServerPropertyName");
- Assert.AreEqual (readOnly, p.ReadOnly, propertyName + "
ReadOnly");
- Assert.AreEqual (type, p.Type, propertyName + " Type");
- }
-
[Test]
public void TypeDescriptor ()
{
Modified:
trunk/mcs/class/Microsoft.Web.Atlas/Test/Microsoft.Web.UI/DataSourceDropTargetTest.cs
===================================================================
---
trunk/mcs/class/Microsoft.Web.Atlas/Test/Microsoft.Web.UI/DataSourceDropTargetTest.cs
2005-09-28 02:40:22 UTC (rev 50912)
+++
trunk/mcs/class/Microsoft.Web.Atlas/Test/Microsoft.Web.UI/DataSourceDropTargetTest.cs
2005-09-28 02:51:24 UTC (rev 50913)
@@ -40,7 +40,7 @@
namespace MonoTests.Microsoft.Web.UI
{
[TestFixture]
- public class DataSourceDropTargetTest
+ public class DataSourceDropTargetTest : ScriptControlTest
{
class TargetPoker : DataSourceDropTarget {
public void AddAttributes (ScriptTextWriter w)
@@ -94,22 +94,6 @@
Assert.AreEqual ("", sw.ToString(), "A1");
}
- void DoEvent (ScriptEventDescriptor e, string eventName, bool
supportsActions)
- {
- Assert.AreEqual (eventName, e.EventName, eventName + "
EventName");
- Assert.AreEqual (eventName, e.MemberName, eventName + "
MemberName");
- Assert.AreEqual (supportsActions, e.SupportsActions,
eventName + " SupportsActions");
- }
-
- void DoProperty (ScriptPropertyDescriptor p, string
propertyName, ScriptType type, bool readOnly, string serverPropertyName)
- {
- Assert.AreEqual (propertyName, p.PropertyName,
propertyName + " PropertyName");
- Assert.AreEqual (propertyName, p.MemberName,
propertyName + " MemberName");
- Assert.AreEqual (serverPropertyName,
p.ServerPropertyName, propertyName + " ServerPropertyName");
- Assert.AreEqual (readOnly, p.ReadOnly, propertyName + "
ReadOnly");
- Assert.AreEqual (type, p.Type, propertyName + " Type");
- }
-
[Test]
public void TypeDescriptor ()
{
Modified:
trunk/mcs/class/Microsoft.Web.Atlas/Test/Microsoft.Web.UI/DragDropListTest.cs
===================================================================
---
trunk/mcs/class/Microsoft.Web.Atlas/Test/Microsoft.Web.UI/DragDropListTest.cs
2005-09-28 02:40:22 UTC (rev 50912)
+++
trunk/mcs/class/Microsoft.Web.Atlas/Test/Microsoft.Web.UI/DragDropListTest.cs
2005-09-28 02:51:24 UTC (rev 50913)
@@ -42,7 +42,7 @@
namespace MonoTests.Microsoft.Web.UI
{
[TestFixture]
- public class DragDropListTest
+ public class DragDropListTest : ScriptControlTest
{
class Poker : DataSourceDropTarget {
public void AddAttributes (ScriptTextWriter w)
@@ -100,22 +100,6 @@
Assert.AreEqual ("", sw.ToString(), "A1");
}
- void DoEvent (ScriptEventDescriptor e, string eventName, bool
supportsActions)
- {
- Assert.AreEqual (eventName, e.EventName, eventName + "
EventName");
- Assert.AreEqual (eventName, e.MemberName, eventName + "
MemberName");
- Assert.AreEqual (supportsActions, e.SupportsActions,
eventName + " SupportsActions");
- }
-
- void DoProperty (ScriptPropertyDescriptor p, string
propertyName, ScriptType type, bool readOnly, string serverPropertyName)
- {
- Assert.AreEqual (propertyName, p.PropertyName,
propertyName + " PropertyName");
- Assert.AreEqual (propertyName, p.MemberName,
propertyName + " MemberName");
- Assert.AreEqual (serverPropertyName,
p.ServerPropertyName, propertyName + " ServerPropertyName");
- Assert.AreEqual (readOnly, p.ReadOnly, propertyName + "
ReadOnly");
- Assert.AreEqual (type, p.Type, propertyName + " Type");
- }
-
[Test]
public void TypeDescriptor ()
{
Modified:
trunk/mcs/class/Microsoft.Web.Atlas/Test/Microsoft.Web.UI/DraggableListItemTest.cs
===================================================================
---
trunk/mcs/class/Microsoft.Web.Atlas/Test/Microsoft.Web.UI/DraggableListItemTest.cs
2005-09-28 02:40:22 UTC (rev 50912)
+++
trunk/mcs/class/Microsoft.Web.Atlas/Test/Microsoft.Web.UI/DraggableListItemTest.cs
2005-09-28 02:51:24 UTC (rev 50913)
@@ -42,7 +42,7 @@
namespace MonoTests.Microsoft.Web.UI
{
[TestFixture]
- public class DraggableListItemTest
+ public class DraggableListItemTest : ScriptControlTest
{
class Poker : DraggableListItem {
public void AddAttributes (ScriptTextWriter w)
@@ -83,22 +83,6 @@
Assert.AreEqual ("", sw.ToString(), "A1");
}
- void DoEvent (ScriptEventDescriptor e, string eventName, bool
supportsActions)
- {
- Assert.AreEqual (eventName, e.EventName, eventName + "
EventName");
- Assert.AreEqual (eventName, e.MemberName, eventName + "
MemberName");
- Assert.AreEqual (supportsActions, e.SupportsActions,
eventName + " SupportsActions");
- }
-
- void DoProperty (ScriptPropertyDescriptor p, string
propertyName, ScriptType type, bool readOnly, string serverPropertyName)
- {
- Assert.AreEqual (propertyName, p.PropertyName,
propertyName + " PropertyName");
- Assert.AreEqual (propertyName, p.MemberName,
propertyName + " MemberName");
- Assert.AreEqual (serverPropertyName,
p.ServerPropertyName, propertyName + " ServerPropertyName");
- Assert.AreEqual (readOnly, p.ReadOnly, propertyName + "
ReadOnly");
- Assert.AreEqual (type, p.Type, propertyName + " Type");
- }
-
[Test]
public void TypeDescriptor ()
{
Modified:
trunk/mcs/class/Microsoft.Web.Atlas/Test/Microsoft.Web.UI/FloatingBehaviorTest.cs
===================================================================
---
trunk/mcs/class/Microsoft.Web.Atlas/Test/Microsoft.Web.UI/FloatingBehaviorTest.cs
2005-09-28 02:40:22 UTC (rev 50912)
+++
trunk/mcs/class/Microsoft.Web.Atlas/Test/Microsoft.Web.UI/FloatingBehaviorTest.cs
2005-09-28 02:51:24 UTC (rev 50913)
@@ -40,7 +40,7 @@
namespace MonoTests.Microsoft.Web.UI
{
[TestFixture]
- public class FloatingBehaviorTest
+ public class FloatingBehaviorTest : ScriptControlTest
{
class Poker : FloatingBehavior {
public void AddAttributes (ScriptTextWriter w)
@@ -72,21 +72,6 @@
Assert.AreEqual ("", sw.ToString(), "A1");
}
- void DoEvent (ScriptEventDescriptor e, string eventName, bool
supportsActions)
- {
- Assert.AreEqual (eventName, e.EventName, eventName + "
EventName");
- Assert.AreEqual (eventName, e.MemberName, eventName + "
MemberName");
- Assert.AreEqual (supportsActions, e.SupportsActions,
eventName + " SupportsActions");
- }
-
- void DoProperty (ScriptPropertyDescriptor p, string
propertyName, ScriptType type, bool readOnly, string serverPropertyName)
- {
- Assert.AreEqual (propertyName, p.PropertyName,
propertyName + " PropertyName");
- Assert.AreEqual (propertyName, p.MemberName,
propertyName + " MemberName");
- Assert.AreEqual (readOnly, p.ReadOnly, propertyName + "
ReadOnly");
- Assert.AreEqual (type, p.Type, propertyName + " Type");
- }
-
[Test]
public void TypeDescriptor ()
{
Modified:
trunk/mcs/class/Microsoft.Web.Atlas/Test/Microsoft.Web.UI/HoverBehaviorTest.cs
===================================================================
---
trunk/mcs/class/Microsoft.Web.Atlas/Test/Microsoft.Web.UI/HoverBehaviorTest.cs
2005-09-28 02:40:22 UTC (rev 50912)
+++
trunk/mcs/class/Microsoft.Web.Atlas/Test/Microsoft.Web.UI/HoverBehaviorTest.cs
2005-09-28 02:51:24 UTC (rev 50913)
@@ -40,7 +40,7 @@
namespace MonoTests.Microsoft.Web.UI
{
[TestFixture]
- public class HoverBehaviorTest
+ public class HoverBehaviorTest : ScriptControlTest
{
class Poker : FloatingBehavior {
public void AddAttributes (ScriptTextWriter w)
@@ -85,22 +85,6 @@
Assert.AreEqual ("", sw.ToString(), "A1");
}
- void DoEvent (ScriptEventDescriptor e, string eventName, bool
supportsActions)
- {
- Assert.AreEqual (eventName, e.EventName, eventName + "
EventName");
- Assert.AreEqual (eventName, e.MemberName, eventName + "
MemberName");
- Assert.AreEqual (supportsActions, e.SupportsActions,
eventName + " SupportsActions");
- }
-
- void DoProperty (ScriptPropertyDescriptor p, string
propertyName, ScriptType type, bool readOnly, string serverPropertyName)
- {
- Assert.AreEqual (propertyName, p.PropertyName,
propertyName + " PropertyName");
- Assert.AreEqual (propertyName, p.MemberName,
propertyName + " MemberName");
- Assert.AreEqual (serverPropertyName,
p.ServerPropertyName, propertyName + " ServerPropertyName");
- Assert.AreEqual (readOnly, p.ReadOnly, propertyName + "
ReadOnly");
- Assert.AreEqual (type, p.Type, propertyName + " Type");
- }
-
[Test]
public void TypeDescriptor ()
{
Modified: trunk/mcs/class/Microsoft.Web.Atlas/Test/Microsoft.Web.UI/LabelTest.cs
===================================================================
--- trunk/mcs/class/Microsoft.Web.Atlas/Test/Microsoft.Web.UI/LabelTest.cs
2005-09-28 02:40:22 UTC (rev 50912)
+++ trunk/mcs/class/Microsoft.Web.Atlas/Test/Microsoft.Web.UI/LabelTest.cs
2005-09-28 02:51:24 UTC (rev 50913)
@@ -40,7 +40,7 @@
namespace MonoTests.Microsoft.Web.UI
{
[TestFixture]
- public class LabelTest
+ public class LabelTest : ScriptControlTest
{
[Test]
public void Properties ()
@@ -60,31 +60,6 @@
Assert.AreEqual ("", l.Text, "A4");
}
- void DoEvent (ScriptEventDescriptor e, string eventName, bool
supportsActions)
- {
- Assert.AreEqual (eventName, e.EventName, eventName + "
EventName");
- Assert.AreEqual (eventName, e.MemberName, eventName + "
MemberName");
- Assert.AreEqual (supportsActions, e.SupportsActions,
eventName + " SupportsActions");
- }
-
- void DoMethod (ScriptMethodDescriptor m, string methodName,
string[] args)
- {
- Assert.AreEqual (methodName, m.MethodName, methodName +
" MethodName");
- Assert.AreEqual (methodName, m.MemberName, methodName +
" MemberName");
- Assert.AreEqual (args.Length, m.Parameters.Length,
methodName + " Parameter count");
- for (int i = 0; i < args.Length; i ++)
- Assert.AreEqual (args[i], m.Parameters[i],
methodName + " Parameter " + i.ToString());
- }
-
- void DoProperty (ScriptPropertyDescriptor p, string
propertyName, ScriptType type, bool readOnly, string serverPropertyName)
- {
- Assert.AreEqual (propertyName, p.PropertyName,
propertyName + " PropertyName");
- Assert.AreEqual (propertyName, p.MemberName,
propertyName + " MemberName");
- Assert.AreEqual (serverPropertyName,
p.ServerPropertyName, propertyName + " ServerPropertyName");
- Assert.AreEqual (readOnly, p.ReadOnly, propertyName + "
ReadOnly");
- Assert.AreEqual (type, p.Type, propertyName + " Type");
- }
-
[Test]
public void TypeDescriptor ()
{
Modified:
trunk/mcs/class/Microsoft.Web.Atlas/Test/Microsoft.Web.UI/ListViewTest.cs
===================================================================
--- trunk/mcs/class/Microsoft.Web.Atlas/Test/Microsoft.Web.UI/ListViewTest.cs
2005-09-28 02:40:22 UTC (rev 50912)
+++ trunk/mcs/class/Microsoft.Web.Atlas/Test/Microsoft.Web.UI/ListViewTest.cs
2005-09-28 02:51:24 UTC (rev 50913)
@@ -40,8 +40,15 @@
namespace MonoTests.Microsoft.Web.UI
{
[TestFixture]
- public class ListViewTest
+ public class ListViewTest : ScriptControlTest
{
+ class Poker : ListView {
+ public void AddAttributes (ScriptTextWriter w)
+ {
+ AddAttributesToElement (w);
+ }
+ }
+
[Test]
public void Properties ()
{
@@ -75,31 +82,6 @@
Assert.AreEqual ("", l.SeparatorTemplateControlID,
"A7");
}
- void DoEvent (ScriptEventDescriptor e, string eventName, bool
supportsActions)
- {
- Assert.AreEqual (eventName, e.EventName, eventName + "
EventName");
- Assert.AreEqual (eventName, e.MemberName, eventName + "
MemberName");
- Assert.AreEqual (supportsActions, e.SupportsActions,
eventName + " SupportsActions");
- }
-
- void DoMethod (ScriptMethodDescriptor m, string methodName,
string[] args)
- {
- Assert.AreEqual (methodName, m.MethodName, methodName +
" MethodName");
- Assert.AreEqual (methodName, m.MemberName, methodName +
" MemberName");
- Assert.AreEqual (args.Length, m.Parameters.Length,
methodName + " Parameter count");
- for (int i = 0; i < args.Length; i ++)
- Assert.AreEqual (args[i], m.Parameters[i],
methodName + " Parameter " + i.ToString());
- }
-
- void DoProperty (ScriptPropertyDescriptor p, string
propertyName, ScriptType type, bool readOnly, string serverPropertyName)
- {
- Assert.AreEqual (propertyName, p.PropertyName,
propertyName + " PropertyName");
- Assert.AreEqual (propertyName, p.MemberName,
propertyName + " MemberName");
- Assert.AreEqual (serverPropertyName,
p.ServerPropertyName, propertyName + " ServerPropertyName");
- Assert.AreEqual (readOnly, p.ReadOnly, propertyName + "
ReadOnly");
- Assert.AreEqual (type, p.Type, propertyName + " Type");
- }
-
[Test]
public void TypeDescriptor ()
{
@@ -194,6 +176,21 @@
desc.AddEvent (new ScriptEventDescriptor ("testEvent",
true));
}
+
+ [Test]
+ public void Attributes ()
+ {
+ Poker c = new Poker ();
+ StringWriter sw;
+ ScriptTextWriter w;
+
+ sw = new StringWriter();
+ w = new ScriptTextWriter (sw);
+
+ c.AddAttributes (w);
+
+ Assert.AreEqual ("", sw.ToString(), "A1");
+ }
}
}
#endif
Modified:
trunk/mcs/class/Microsoft.Web.Atlas/Test/Microsoft.Web.UI/PropertyFilterTest.cs
===================================================================
---
trunk/mcs/class/Microsoft.Web.Atlas/Test/Microsoft.Web.UI/PropertyFilterTest.cs
2005-09-28 02:40:22 UTC (rev 50912)
+++
trunk/mcs/class/Microsoft.Web.Atlas/Test/Microsoft.Web.UI/PropertyFilterTest.cs
2005-09-28 02:51:24 UTC (rev 50913)
@@ -40,7 +40,7 @@
namespace MonoTests.Microsoft.Web.UI
{
[TestFixture]
- public class PropertyFilterTest
+ public class PropertyFilterTest : ScriptControlTest
{
class Poker : PropertyFilter {
public void AddAttributes (ScriptTextWriter w)
@@ -90,22 +90,6 @@
Assert.AreEqual ("<propertyFilter property=\"Property\"
value=\"Value\" />", sw.ToString(), "A1");
}
- void DoEvent (ScriptEventDescriptor e, string eventName, bool
supportsActions)
- {
- Assert.AreEqual (eventName, e.EventName, eventName + "
EventName");
- Assert.AreEqual (eventName, e.MemberName, eventName + "
MemberName");
- Assert.AreEqual (supportsActions, e.SupportsActions,
eventName + " SupportsActions");
- }
-
- void DoProperty (ScriptPropertyDescriptor p, string
propertyName, ScriptType type, bool readOnly, string serverPropertyName)
- {
- Assert.AreEqual (propertyName, p.PropertyName,
propertyName + " PropertyName");
- Assert.AreEqual (propertyName, p.MemberName,
propertyName + " MemberName");
- Assert.AreEqual (serverPropertyName,
p.ServerPropertyName, propertyName + " ServerPropertyName");
- Assert.AreEqual (readOnly, p.ReadOnly, propertyName + "
ReadOnly");
- Assert.AreEqual (type, p.Type, propertyName + " Type");
- }
-
[Test]
public void TypeDescriptor ()
{
Modified:
trunk/mcs/class/Microsoft.Web.Atlas/Test/Microsoft.Web.UI/TextBoxTest.cs
===================================================================
--- trunk/mcs/class/Microsoft.Web.Atlas/Test/Microsoft.Web.UI/TextBoxTest.cs
2005-09-28 02:40:22 UTC (rev 50912)
+++ trunk/mcs/class/Microsoft.Web.Atlas/Test/Microsoft.Web.UI/TextBoxTest.cs
2005-09-28 02:51:24 UTC (rev 50913)
@@ -40,7 +40,7 @@
namespace MonoTests.Microsoft.Web.UI
{
[TestFixture]
- public class TextBoxTest
+ public class TextBoxTest : ScriptControlTest
{
[Test]
public void Properties ()
@@ -82,35 +82,11 @@
Assert.AreEqual ("", t.Text, "A18");
}
- void DoEvent (ScriptEventDescriptor e, string eventName, bool
supportsActions)
- {
- Assert.AreEqual (eventName, e.EventName, eventName + "
EventName");
- Assert.AreEqual (eventName, e.MemberName, eventName + "
MemberName");
- Assert.AreEqual (supportsActions, e.SupportsActions,
eventName + " SupportsActions");
- }
-
- void DoMethod (ScriptMethodDescriptor m, string methodName,
string[] args)
- {
- Assert.AreEqual (methodName, m.MethodName, methodName +
" MethodName");
- Assert.AreEqual (methodName, m.MemberName, methodName +
" MemberName");
- Assert.AreEqual (args.Length, m.Parameters.Length,
methodName + " Parameter count");
- for (int i = 0; i < args.Length; i ++)
- Assert.AreEqual (args[i], m.Parameters[i],
methodName + " Parameter " + i.ToString());
- }
-
- void DoProperty (ScriptPropertyDescriptor p, string
propertyName, ScriptType type, bool readOnly, string serverPropertyName)
- {
- Assert.AreEqual (propertyName, p.PropertyName,
propertyName + " PropertyName");
- Assert.AreEqual (propertyName, p.MemberName,
propertyName + " MemberName");
- Assert.AreEqual (serverPropertyName,
p.ServerPropertyName, propertyName + " ServerPropertyName");
- Assert.AreEqual (readOnly, p.ReadOnly, propertyName + "
ReadOnly");
- Assert.AreEqual (type, p.Type, propertyName + " Type");
- }
-
[Test]
public void TypeDescriptor ()
{
TextBox t = new TextBox();
+
ScriptTypeDescriptor desc =
((IScriptObject)t).GetTypeDescriptor ();
Assert.AreEqual (t, desc.ScriptObject, "A1");
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches