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); } }
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)); }
public Stream Download(DBWorkFileView file) { return(new DBFileStream(DBFile_Extensions.Create(this, file.file_id), this)); }