public void TestGetFile() { storageDatabaseUtils.ExecSql("INSERT INTO dbo.Files (FileName, FileContent) values ('filename', CONVERT(varbinary(1024), 'sorry for what?'));"); int fileId = (int)storageDatabaseUtils.GetIntBySql("SELECT FileID FROM dbo.Files WHERE FileName = 'filename';"); Assert.True(storageDatabaseUtils.GetFile(fileId, out string fileName, out byte[] fileContent)); Assert.Equal("filename", fileName); Assert.Equal("sorry for what?", Encoding.UTF8.GetString(fileContent)); storageDatabaseUtils.ExecSql("DELETE FROM dbo.Files"); }
public void Cleanup() { storageDatabase.ExecSql("DELETE FROM Files"); }