Beispiel #1
0
 public static SampleData CreateFile(string resource)
 {
     SampleData instance = new SampleData();
     Assembly assembly = Assembly.GetExecutingAssembly();
     using (Stream stream = assembly.GetManifestResourceStream("UnitTests." + resource))
     {
         instance._filename = Path.GetTempFileName();
         using (var file = File.OpenWrite(instance._filename))
         {
             stream.CopyTo(file);
         }
     }
     return instance;
 }