Merge pull request #1248 from kumpera/kill_the_interpreter
[mono.git] / mcs / class / corlib / Test / System.IO / StreamReaderTest.cs
index ea6fbecdada00bce598794cabaf84e92bd287b9d..54e5e04243583a489dff3547f3eb5d601d8d08fa 100644 (file)
@@ -366,12 +366,12 @@ public class StreamReaderTest
                m.Close();
        }
 
-       public void TestCurrentEncoding() {
+       public void TestCurrentEncoding()
+       {
                Byte[] b = {};
                MemoryStream m = new MemoryStream(b);
                StreamReader r = new StreamReader(m);
-               Assert.AreEqual (Encoding.UTF8.GetType (), r.CurrentEncoding.GetType (),
-                       "wrong encoding");
+               Assert.AreSame (Encoding.UTF8, r.CurrentEncoding, "wrong encoding");
        }
 
        // TODO - Close - annoying spec - won't commit to any exceptions. How to test?
@@ -838,6 +838,13 @@ public class StreamReaderTest
                }
        }
 
+       [Test]
+       public void NullStream ()
+       {
+               var buffer = new char[2];
+               Assert.AreEqual (0, StreamReader.Null.ReadBlock (buffer, 0, buffer.Length));
+       }
+
 #if NET_4_5
        [Test]
        public void ReadLineAsync ()