[WindowsBase] Use InvariantCulture for ConvertTo/ToString tests
authorAlexander Köplinger <alex.koeplinger@outlook.com>
Mon, 18 Sep 2017 18:58:44 +0000 (20:58 +0200)
committerAlexander Köplinger <alex.koeplinger@outlook.com>
Tue, 19 Sep 2017 08:58:58 +0000 (10:58 +0200)
They'd fail on locales such as de-DE before which uses ';' as separator.

mcs/class/WindowsBase/Test/System.Windows.Media/MatrixConverterTest.cs
mcs/class/WindowsBase/Test/System.Windows.Media/MatrixTest.cs
mcs/class/WindowsBase/Test/System.Windows/Int32RectConverterTest.cs
mcs/class/WindowsBase/Test/System.Windows/Int32RectTest.cs
mcs/class/WindowsBase/Test/System.Windows/PointConverterTest.cs
mcs/class/WindowsBase/Test/System.Windows/RectConverterTest.cs
mcs/class/WindowsBase/Test/System.Windows/SizeConverterTest.cs
mcs/class/WindowsBase/Test/System.Windows/SizeTest.cs
mcs/class/WindowsBase/Test/System.Windows/VectorConverterTest.cs
mcs/class/WindowsBase/Test/System.Windows/VectorTest.cs

index 9134aec4b47c67cb6f1198a52a4a826691e684b0..f9e15374908dab1488945271b314cdac024eda4b 100644 (file)
@@ -1,5 +1,6 @@
 using NUnit.Framework;
 using System;
+using System.Globalization;
 using System.Windows.Media;
 
 namespace MonoTests.System.Windows.Media {
@@ -56,7 +57,7 @@ namespace MonoTests.System.Windows.Media {
                {
                        var conv = new MatrixConverter ();
                        var matrix = new Matrix (1, 2, 3, 4, 5, 6);
-                       object obj = conv.ConvertTo (matrix, typeof (string));
+                       object obj = conv.ConvertTo (null, CultureInfo.InvariantCulture, matrix, typeof (string));
                        Assert.AreEqual (typeof (string), obj.GetType ());
                        Assert.AreEqual ("1,2,3,4,5,6", (string)obj);
                }
index cbccb4339bb10d2facce83d497a179b8f504f779..29503407fb18a21579ff502910de5f7849662fcf 100644 (file)
@@ -24,6 +24,7 @@
 //
 
 using System;
+using System.Globalization;
 using System.Windows;
 using System.Windows.Media;
 using NUnit.Framework;
@@ -347,7 +348,7 @@ namespace MonoTests.System.Windows.Media {
                public void ToStringTest ()
                {
                        Matrix m = new Matrix (1, 2, 3, 4, 5, 6);
-                       Assert.AreEqual ("1,2,3,4,5,6", m.ToString());
+                       Assert.AreEqual ("1,2,3,4,5,6", m.ToString(CultureInfo.InvariantCulture));
                        m = Matrix.Identity;
                        Assert.AreEqual ("Identity", m.ToString());
                }
index 64375844ccd8dfac57e4121a643e488f1ae5f5c0..2aecc932a3ad0637006c1940bd916f69e40124b8 100644 (file)
@@ -24,6 +24,7 @@
 //
 
 using System;
+using System.Globalization;
 using System.Windows;
 using System.Windows.Media;
 using NUnit.Framework;
@@ -88,14 +89,13 @@ namespace MonoTests.System.Windows {
                }
 
                [Test]
-               [Category ("NotWorking")]
                public void ConvertTo ()
                {
                        Int32RectConverter r = new Int32RectConverter ();
 
                        Int32Rect rect = new Int32Rect (0, 0, 1, 2);
 
-                       object o = r.ConvertTo (rect, typeof (string));
+                       object o = r.ConvertTo (null, CultureInfo.InvariantCulture, rect, typeof (string));
                        
                        Assert.AreEqual (typeof (string), o.GetType());
                        Assert.AreEqual ("0,0,1,2", (string)o);
index ffd571f3a191ec257f7a6d9e5cef916f3ecb043e..d65da4e23f20216618d1730912f3680fb7d8c953 100644 (file)
@@ -24,6 +24,7 @@
 //
 
 using System;
+using System.Globalization;
 using System.Windows;
 using System.Windows.Media;
 using NUnit.Framework;
@@ -136,7 +137,7 @@ namespace MonoTests.System.Windows {
                public void ToStringTest ()
                {
                        Int32Rect r = new Int32Rect (1, 2, 3, 4);
-                       Assert.AreEqual ("1,2,3,4", r.ToString());
+                       Assert.AreEqual ("1,2,3,4", r.ToString(CultureInfo.InvariantCulture));
 
                        Assert.AreEqual ("Empty", Int32Rect.Empty.ToString());
                }
index 93d33bc678a06fdd31deb6ebb3e9d39d62966915..9e80eb1dedf9531a9f651a4e23ac6b3ef752dbcf 100644 (file)
@@ -24,6 +24,7 @@
 //
 
 using System;
+using System.Globalization;
 using System.Windows;
 using System.Windows.Media;
 using NUnit.Framework;
@@ -82,7 +83,7 @@ namespace MonoTests.System.Windows {
 
                        Point rect = new Point (1, 2);
 
-                       object o = r.ConvertTo (rect, typeof (string));
+                       object o = r.ConvertTo (null, CultureInfo.InvariantCulture, rect, typeof (string));
                        
                        Assert.AreEqual (typeof (string), o.GetType());
                        Assert.AreEqual ("1,2", (string)o);
index 3d2b6b12a72e4e2a0699e0053ee4f28333d977d0..0e1161c9dca8921b133010f28d07e3c4eb483a79 100644 (file)
@@ -24,6 +24,7 @@
 //
 
 using System;
+using System.Globalization;
 using System.Windows;
 using System.Windows.Media;
 using NUnit.Framework;
@@ -92,7 +93,7 @@ namespace MonoTests.System.Windows {
 
                        Rect rect = new Rect (0, 0, 1, 2);
 
-                       object o = r.ConvertTo (rect, typeof (string));
+                       object o = r.ConvertTo (null, CultureInfo.InvariantCulture, rect, typeof (string));
                        
                        Assert.AreEqual (typeof (string), o.GetType());
                        Assert.AreEqual ("0,0,1,2", (string)o);
index d320100f1a074164c6c944b3ef4d970ba7506ce6..74a0f0b3be1be941591c224aa9415a23fd52f294 100644 (file)
@@ -24,6 +24,7 @@
 //
 
 using System;
+using System.Globalization;
 using System.Windows;
 using System.Windows.Media;
 using NUnit.Framework;
@@ -86,7 +87,7 @@ namespace MonoTests.System.Windows {
 
                        Size rect = new Size (1, 2);
 
-                       object o = r.ConvertTo (rect, typeof (string));
+                       object o = r.ConvertTo (null, CultureInfo.InvariantCulture, rect, typeof (string));
                        
                        Assert.AreEqual (typeof (string), o.GetType());
                        Assert.AreEqual ("1,2", (string)o);
index 6c04fd244d4877230928612956991331737e2277..e9bb8d925c02ea90c4b756afcb747a2e5e266b69 100644 (file)
@@ -24,6 +24,7 @@
 //
 
 using System;
+using System.Globalization;
 using System.Windows;
 using System.Windows.Media;
 using NUnit.Framework;
@@ -158,7 +159,7 @@ namespace MonoTests.System.Windows {
                [Test]
                public void ToStringTest ()
                {
-                       Assert.AreEqual ("1,2", (new Size (1, 2)).ToString ());
+                       Assert.AreEqual ("1,2", (new Size (1, 2)).ToString (CultureInfo.InvariantCulture));
                }
 
                [Test]
index 8c2a74496356cf5ce1862fededde8fea5ab4612b..af6dd725aeaad74c2cf6b3548ab45163bc6baf48 100644 (file)
@@ -24,6 +24,7 @@
 //
 
 using System;
+using System.Globalization;
 using System.Windows;
 using System.Windows.Media;
 using NUnit.Framework;
@@ -82,7 +83,7 @@ namespace MonoTests.System.Windows {
 
                        Vector rect = new Vector (1, 2);
 
-                       object o = r.ConvertTo (rect, typeof (string));
+                       object o = r.ConvertTo (null, CultureInfo.InvariantCulture, rect, typeof (string));
                        
                        Assert.AreEqual (typeof (string), o.GetType());
                        Assert.AreEqual ("1,2", (string)o);
index 2f203729adf21c3f8fe9e8ed17f5303fa284fd7b..20e64e3134ee603583331ea904071c2af11c9acd 100644 (file)
@@ -24,6 +24,7 @@
 //
 
 using System;
+using System.Globalization;
 using System.Windows;
 using System.Windows.Media;
 using NUnit.Framework;
@@ -56,7 +57,7 @@ namespace MonoTests.System.Windows {
                public void ToStringTest ()
                {
                        Vector v = new Vector (4, 5);
-                       Assert.AreEqual ("4,5", v.ToString());
+                       Assert.AreEqual ("4,5", v.ToString(CultureInfo.InvariantCulture));
                }
 
                [Test]