public void TestGetFiles() { storageDatabaseUtils.ExecSql("INSERT INTO dbo.Files (FileName, FileContent) values ('filename', CONVERT(varbinary(1024), 'sorry for what?')), ('filename', CONVERT(varbinary(1024), 'our daddy told us not to be shame'));"); string[][] fileIds = storageDatabaseUtils.GetLstBySql("SELECT FileID FROM dbo.Files WHERE FileName = 'filename';"); int[] ids = { Int32.Parse(fileIds[0][0]), Int32.Parse(fileIds[1][0]) }; string fileName = "filename"; System.Data.DataTable table = storageDatabaseUtils.GetFiles(fileName); Assert.Equal(2, table.Rows.Count); foreach (System.Data.DataRow row in table.Rows) { int fileId = (int)row[0]; Assert.True(Array.Exists(ids, id => id == fileId)); } storageDatabaseUtils.ExecSql("DELETE FROM dbo.Files"); }