Merge pull request #2024 from BogdanovKirill/webrequesttest
[mono.git] / mcs / class / corlib / Test / System.IO / StreamWriterTest.cs
index 582ed7a9dd649f28012e4080d394410496408a2a..661cffc18c61370723ed9b5137ce483534128833 100644 (file)
@@ -1076,6 +1076,28 @@ namespace MonoTests.System.IO
                Assert.AreEqual (1, ms.Length);
        }
 
+       [Test]
+       public void WriteAsync ()
+       {
+               var m = new MockStream(true, false, true);
+               var w = new StreamWriter (m);
+
+               var t = w.WriteAsync ("v");
+               Assert.IsTrue (t.Wait (1000), "#1");
+
+               t = w.WriteAsync ((string) null);
+               Assert.IsTrue (t.Wait (1000), "#2");
+
+               t = w.WriteLineAsync ("line");
+               Assert.IsTrue (t.Wait (1000), "#3");
+
+               t = w.WriteLineAsync ((string) null);
+               Assert.IsTrue (t.Wait (1000), "#4");
+
+               t = w.WriteLineAsync ('c');
+               Assert.IsTrue (t.Wait (1000), "#5");
+       }
+
 #endif
 
        // TODO - Write - test errors, functionality tested in TestFlush.