Exemple #1
0
 public void CheckFileContents(int?file_id, string message, string contents, bool trim)
 {
     if (file_id.HasValue)
     {
         using (Stream s = db.Download(DBFile_Extensions.Create(db, file_id.Value))) {
             using (StreamReader reader = new StreamReader(s)) {
                 string file = reader.ReadToEnd();
                 if (trim)
                 {
                     contents = contents.Trim();
                     file     = file.Trim();
                 }
                 Check.AreEqual(contents, file, message);
             }
         }
     }
     else
     {
         Check.AreEqual(null, contents, message);
     }
 }
Exemple #2
0
 private void DownloadFile(DB db, int file_id)
 {
     // access must be verified before calling this method (no verification is done here)
     DownloadFile(db, DBFile_Extensions.Create(db, file_id));
 }
Exemple #3
0
 public Stream Download(DBWorkFileView file)
 {
     return(new DBFileStream(DBFile_Extensions.Create(this, file.file_id), this));
 }