Merge pull request #629 from pruiz/syswebrouting-fixes2
[mono.git] / mcs / class / corlib / Test / System.IO / TextWriterTest.cs
old mode 100755 (executable)
new mode 100644 (file)
index 6b83325..0ee3540
@@ -16,7 +16,7 @@ using NUnit.Framework;
 namespace MonoTests.System.IO
 {
        [TestFixture]
-       public class TextWriterTest : Assertion
+       public class TextWriterTest
        {
                class MyTextWriter : TextWriter
                {
@@ -42,13 +42,34 @@ namespace MonoTests.System.IO
                public void CoreNewLine ()
                {
                        MyTextWriter w = new MyTextWriter ();
-                       AssertNotNull (w.NewLine);
+                       Assert.IsNotNull (w.NewLine);
 
                        w.UpdateLine ();
-                       AssertEquals ('Z', w.NewLine [0]);
+                       Assert.AreEqual ('Z', w.NewLine [0]);
 
                        w.UpdateLine2 ();
-                       AssertEquals ('Y', w.NewLine [0]);
+                       Assert.AreEqual ('Y', w.NewLine [0]);
+               }
+
+               class ArrayOrCharTester : TextWriter {
+                       public bool called_array;
+                       public override Encoding Encoding { get { return Encoding.UTF8; }}
+
+                       public override void Write (char [] x, int a, int b)
+                       {
+                               called_array = true;
+                       }
+                       public override void Write (char c)
+                       {
+                       }
+               }
+
+               [Test]
+               public void TestCharArrayCallsArrayIntInt ()
+               {
+                       ArrayOrCharTester x = new ArrayOrCharTester ();
+                       x.Write (new char [] {'a','b','c'});
+                       Assert.AreEqual (true, x.called_array);                 
                }
        }
 }