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?
}
}
+ [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 ()