public void CsvFormerClass_ShouldImplementIFormerInterface() { // Arrange UnitOfWork unit = new UnitOfWork(); CsvFormer former = new CsvFormer(unit, "23", null); // Assert Assert.IsTrue(former is IFormer); Assert.IsTrue(former is FileFormer); }
public JsonResult FormCsvFile(string queryId, string[] parameters = null) { CsvFormer csvFormer = new CsvFormer(unitOfWork, queryId, parameters); csvFormer.FormDocument(); unitOfWork .OutputTables. RemoveQueryOutputTableIfExists(int.Parse(queryId), "csv"); unitOfWork .OutputTables .BindOutputTableToQuery(int.Parse(queryId), csvFormer.FileName, "csv"); return(Json(new { fileName = csvFormer.FileName, errorMessage = "Ошибка. Не удалось сформировать файл. Попытайтесь позже." })); }