title: Create csv file as a StreamReader on the fly
body: <p>I would like to unit test the following method</p>
  
  <pre><code>public IEnumerable&lt;T&gt; GetData&lt;T&gt;(StreamReader fileStream) where T : new()
  </code></pre>
  
  <p>The streamreader needs to be a file in CSV format, with particular column names.</p>
  
  <p>Is it possible to create such files in code, rather than having to have lots of them on the file system for each unit test?</p>
  
  <p>Any ideas?</p>
  
  <p>UPDATE:</p>
  
  <p>just realised the library I am using Linq2Csv, has methods for doing exactly this</p>
  
  <p><a href="http://www.codeproject.com/KB/linq/LINQtoCSV.aspx" rel="nofollow noreferrer">http://www.codeproject.com/KB/linq/LINQtoCSV.aspx</a> </p>