+2008-04-16 Marek Habersack <mhabersack@novell.com>
+
+ * System_test.dll.sources: added
+ System.ComponentModel/ComponentConverterTests.cs
+
+ * Makefile (TEST_MCS_FLAGS): reference -r:System.Data for new
+ tests.
+
2008-04-13 Jb Evain <jbevain@novell.com>
* net_2_1_raw_System.dll.sources: tune out some
Test/System/test-uri-props-manual.txt \
Test/System/test-uri-relative-props.txt
-TEST_MCS_FLAGS = -r:System.Drawing.dll -r:Mono.Security.dll -nowarn:1595 -nowarn:0618 -nowarn:219 -nowarn:67 -nowarn:169 -nowarn:612 \
+TEST_MCS_FLAGS = -r:System.Drawing.dll -r:Mono.Security.dll -r:System.Data -nowarn:1595 -nowarn:0618 -nowarn:219 -nowarn:67 -nowarn:169 -nowarn:612 \
$(foreach f, $(TEST_RESOURCES), -resource:$(f),$(notdir $(f)))
ifeq (2, $(FRAMEWORK_VERSION_MAJOR))
+2008-04-16 Marek Habersack <mhabersack@novell.com>
+
+ * ReferenceConverter.cs: fix ConvertFrom and ConvertTo when
+ converting from/to string - base must be called only if the
+ conversion target type is NOT string, otherwise the result of the
+ conversion will be the value type name.
+
2008-04-13 Jb Evain <jbevain@novell.com>
* TypeDescriptor.cs: internalize method AddEditorTable
CultureInfo culture,
object value)
{
- if (value is string && ((string)value) == "(none)")
+ if (!(value is string))
+ return base.ConvertFrom(context, culture, value);
+
+ if (((string)value) == "(none)")
return null;
- return base.ConvertFrom(context, culture, value);
+
+ // There must be something else to do here...
+ return null;
}
public override object ConvertTo (ITypeDescriptorContext context,
object value,
Type destinationType)
{
- if (destinationType == typeof (string) && value == null)
+ if (destinationType != typeof (string))
+ return base.ConvertTo(context, culture, value, destinationType);
+
+ if (value == null)
return "(none)";
- return base.ConvertTo(context, culture, value, destinationType);
+
+ return String.Empty;
}
public override StandardValuesCollection GetStandardValues (ITypeDescriptorContext context)
System.IO/ErrorEventArgs.cs
System.IO/ErrorEventHandler.cs
System.IO/FAMWatcher.cs
+System.IO/NoOpWatcher.cs
System.IO/FileAction.cs
System.IO/FileSystemEventArgs.cs
System.IO/FileSystemEventHandler.cs
System.ComponentModel/CharConverterTest.cs
System.ComponentModel/CollectionConverterTest.cs
System.ComponentModel/ComplexBindingPropertiesAttributeTest.cs
+System.ComponentModel/ComponentConverterTests.cs
System.ComponentModel/ComponentResourceManagerTest.cs
System.ComponentModel/ContainerTest.cs
System.ComponentModel/CultureInfoConverterTest.cs
+2008-04-16 Marek Habersack <mhabersack@novell.com>
+
+ * ComponentConverterTests.cs: added tests for
+ {Component, Reference}Converter ConvertFrom/ConvertTo changes.
+
2008-03-15 Gert Driesen <drieseng@users.sourceforge.net>
* DesignerAttributeTest.cs: Added ctor tests.
--- /dev/null
+//
+// System.ComponentModel.TypeConverter test cases
+//
+// Authors:
+// Marek Habersack (mhabersack@novell.com)
+//
+// (c) 2008 Novell, Inc. (http://novell.com)
+//
+
+using System;
+using System.ComponentModel;
+using System.ComponentModel.Design.Serialization;
+using System.Data;
+using System.Globalization;
+
+using NUnit.Framework;
+
+namespace MonoTests.System.ComponentModel
+{
+ [TestFixture]
+ public class ComponentConverterTests
+ {
+ [Test]
+ public void DataSetConversions ()
+ {
+ TypeConverter converter = TypeDescriptor.GetConverter (typeof (DataSet));
+ Assert.AreEqual (typeof (global::System.ComponentModel.ComponentConverter), converter != null ? converter.GetType () : null, "A1");
+
+ DataSet ds = new DataSet ();
+ string s = (string) converter.ConvertTo (null, CultureInfo.InvariantCulture, ds, typeof (string));
+ Assert.AreEqual (String.Empty, s, "A2");
+
+ object obj = converter.ConvertFrom (null, CultureInfo.InvariantCulture, s);
+ Assert.IsNull (obj, "A3");
+ }
+ }
+}