Esempio n. 1
0
        private string GetOutput(SchemaWriterBase testWriter, IList<TableDefinition> defs)
        {
            MemoryStream ms = new MemoryStream();
            StreamWriter sr = new StreamWriter(ms);
            StreamReader reader = new StreamReader(ms);
            testWriter.WriteToStream(defs, sr);
            sr.Flush();
            ms.Seek(0, SeekOrigin.Begin); //goto beginning
            var output = reader.ReadToEnd();

            sr.Close();
            reader.Close();
            ms.Close();

            return output;
        }
 private string GetOutput(SchemaWriterBase testWriter, IList<TableDefinition> defs)
 {
     string output;
     using (var ms = new MemoryStream())
     {
         using (var reader = new StreamReader(ms))
         {
             using (var sr = new StreamWriter(ms))
             {
                 testWriter.WriteToStream(defs, sr);
                 sr.Flush();
                 ms.Seek(0, SeekOrigin.Begin); //goto beginning
                 output = reader.ReadToEnd();
             }
         }
     }
     return output;
 }