示例#1
0
 string PerformTest(string sampleFile, VariableDictionary variables)
 {
     var temp = Path.GetTempFileName();
     using (new TemporaryFile(temp))
     {
         var substituter = new FileSubstituter();
         substituter.PerformSubstitution(sampleFile, variables, temp);
         return File.ReadAllText(temp);
     }
 }
 dynamic PerformTest(string sampleFile, VariableDictionary variables)
 {
     var temp = Path.GetTempFileName();
     using (new TemporaryFile(temp))
     {
         var substituter = new FileSubstituter(FileSystem);
         substituter.PerformSubstitution(sampleFile, variables, temp);
         return new {
             Text = FileSystem.ReadFile(temp),
             Encoding = FileSystem.GetFileEncoding(temp)
         };
     }
 }