title: Writing to MemoryStream with StreamWriter returns empty
body: <p>I am not sure what I am doing wrong, have seen a lot of examples, but can't seem to get this working.</p>
  
  <pre><code>public static Stream Foo()
  {
      var memStream = new MemoryStream();
      var streamWriter = new StreamWriter(memStream);
  
      for (int i = 0; i &lt; 6; i++)
          streamWriter.WriteLine("TEST");
  
      memStream.Seek(0, SeekOrigin.Begin);
      return memStream;
  }
  </code></pre>
  
  <p>I am doing a simple test on this method to try and get it to pass, but no matter what, my collection count is 0.</p>
  
  <pre><code>[Test]
  public void TestStreamRowCount()
  {
      var stream = Foo();
  
      using (var reader = new StreamReader(stream))
      {
          var collection = new List&lt;string&gt;();
          string input;
  
          while ((input = reader.ReadLine()) != null)
              collection.Add(input);
  
          Assert.AreEqual(6, collection.Count);
      }
  }
  </code></pre>
  
  <p>Note: I changed some syntax above without compiling in the Test method. What is more important is the first method which seems to be returning an empty stream (my reader.ReadLine() always reads once). Not sure what I am doing wrong. Thank you.</p>