+//
+// ColorConverter class testing unit
+//
+// Copyright (C) 2006 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
using System;
using System.Collections;
using System.ComponentModel;
}
[Test]
+#if TARGET_JVM
+ [NUnit.Framework.Category ("NotWorking")]
+#endif
public void CanConvertFrom () {
Assert.IsTrue (colconv.CanConvertFrom (typeof (String)), "CCF#1");
Assert.IsTrue (colconv.CanConvertFrom (null, typeof (String)), "CCF#1a");
}
[Test]
+#if TARGET_JVM
+ [NUnit.Framework.Category ("NotWorking")]
+#endif
public void ConvertFrom ()
{
Color color = (Color) colconv.ConvertFrom (null, CultureInfo.InvariantCulture,
Assert.AreEqual (0, color.G, "CF7#3");
Assert.AreEqual (0, color.B, "CF7#4");
+
Assert.AreEqual (col, (Color) colconv.ConvertFrom (null,
CultureInfo.InvariantCulture, colStrInvariant), "CF#1");
Assert.AreEqual (colnamed, (Color) colconv.ConvertFrom (null,
Assert.AreEqual (Color.Empty, colconv.ConvertFrom (" "), "CF#4");
Assert.AreEqual (Color.Red, colconv.ConvertFrom ("Red"), "CF#5");
Assert.AreEqual (Color.Red, colconv.ConvertFrom (" Red "), "CF#6");
+ }
+
+ [Test]
+ [NUnit.Framework.Category ("NotWorking")]
+ public void ConvertFrom_NotWorking ()
+ {
+ Color color = (Color) colconv.ConvertFrom (null, CultureInfo.InvariantCulture,
+ "0x123");
+ Assert.AreEqual (0, color.A, "CF8#1");
+ Assert.AreEqual (0, color.R, "CF8#2");
+ Assert.AreEqual (1, color.G, "CF8#3");
+ Assert.AreEqual (35, color.B, "CF8#4");
+ color = (Color) colconv.ConvertFrom (null, CultureInfo.InvariantCulture,
+ "#123");
+ Assert.AreEqual (0, color.A, "CF9#1");
+ Assert.AreEqual (0, color.R, "CF9#2");
+ Assert.AreEqual (1, color.G, "CF9#3");
+ Assert.AreEqual (35, color.B, "CF9#4");
}
[Test]
[Test]
[ExpectedException (typeof (Exception))]
+#if TARGET_JVM
+ [NUnit.Framework.Category ("NotWorking")]
+#endif
public void ConvertFrom_x4 ()
{
colconv.ConvertFrom (null, CultureInfo.InvariantCulture,
}
[Test]
+#if TARGET_JVM
+ [NUnit.Framework.Category ("NotWorking")]
+#endif
public void ConvertFromInvariantString_InvalidNumber ()
{
try {
}
[Test]
+#if TARGET_JVM
+ [NUnit.Framework.Category ("NotWorking")]
+#endif
public void ConvertFromString_InvalidNumber ()
{
try {
[Test]
public void GetStandardValues () {
- Assert.AreEqual (167, colconv.GetStandardValues ().Count);
- Assert.AreEqual (167, colconv.GetStandardValues (null).Count);
+#if NET_2_0
+ Assert.AreEqual ((int)KnownColor.MenuHighlight, colconv.GetStandardValues ().Count);
+ Assert.AreEqual ((int)KnownColor.MenuHighlight, colconv.GetStandardValues (null).Count);
+#else
+ Assert.AreEqual ((int)KnownColor.YellowGreen, colconv.GetStandardValues ().Count);
+ Assert.AreEqual ((int)KnownColor.YellowGreen, colconv.GetStandardValues (null).Count);
+#endif
}
[Test]