public void ReadExcelFileWithInvalidFormatOfCells_ShouldThrowException() { var currentDirectory = GetProjectFSPath(); var filePath = $@"{currentDirectory}/invalid.xlsx"; FilesOperations.ReadExcelFile(filePath); }
public HttpResponseMessage GetFileData(string name) { var filePath = HttpContext.Current.Server.MapPath("~/App_Data/" + name); var data = FilesOperations.ReadFile(filePath); return(HttpResponseUtils.CreateResponseWithJson(HttpStatusCode.OK, data)); }
public string SaveFile(CombiModel model) { var filename = $"{Guid.NewGuid()}.txt"; var path = HttpContext.Current.Server.MapPath($"~/App_Data/{filename}"); var pathToFile = FilesOperations.SaveToTextFile(model, path); return(filename); }
public void ReadValidCsvFile_ShoulReturnNotEmptyData() { var currentDirectory = GetProjectFSPath(); var filePath = $@"{currentDirectory}/testCSV.csv"; var data = FilesOperations.ReadTextFile(filePath, ';'); Assert.IsNotNull(data); }
public void ReadValidExcelFile_XlsExtension_ShouldReturnNotEmptyData() { var currentDirectory = GetProjectFSPath(); var filePath = $@"{currentDirectory}/testOldFormat.xls"; var data = FilesOperations.ReadExcelFile(filePath); Assert.IsNotNull(data); }
public void ReadExcelFile_XlsxExtension() { var currentDirectory = GetProjectFSPath(); var filePath = $@"{currentDirectory}/test.xlsx"; var data = FilesOperations.ReadExcelFile(filePath); Assert.IsNotNull(data); }
public IEnumerable <FileModel> GetRecentFiles() { var path = HttpContext.Current.Server.MapPath("~/App_Data"); var files = FilesOperations.GetFiles(path); return(files.Select(f => new FileModel() { Ext = Path.GetExtension(f), Name = Path.GetFileNameWithoutExtension(f) })); }
public MainForm() { InitializeComponent(); //Make sure directory exists FilesOperations.PrepareFolders(); // Set |DataDirectory| value AppDomain.CurrentDomain.SetData("DataDirectory", "C:\\Users\\Public\\Documents\\DiceThrows\\"); this._stopThread_RollBlackDice = new ManualResetEvent(false); this._thread_RollBlackDice_Stopped = new ManualResetEvent(false); this._stopThread_RollWhiteDice = new ManualResetEvent(false); this._thread_RollWhiteDice_Stopped = new ManualResetEvent(false); }
public void Test1(string browserName) { BrowserSetUp(browserName); MegaMenuNavBar megaMenuNavBar = new MegaMenuNavBar(driver); Assert.NotEqual(megaMenuNavBar.GetContactLinkColour(), megaMenuNavBar.GetContactLinkColourAfterMouseOver()); HomePage homePage = new HomePage(driver); homePage.ClickAtMediaPackLink(); MediaPackPage mediaPackPage = new MediaPackPage(driver); mediaPackPage.ClickAtLogoDownloadLink(); Assert.Equal("logotypy.zip", FilesOperations.GetDownloadedFileName()); FilesOperations.ExtractFile("logotypy.zip"); Assert.True(FilesOperations.CheckFileExistInDownloadFolder("MA_logo_standard_claim_MONO.pdf")); }
/// <summary> /// Constructs new instance of TypeScript exporter /// </summary> /// <param name="settings"></param> public TsExporter(ExportSettings settings) { _settings = settings; _fileOps = new FilesOperations(settings); }
/// <summary> /// Constructs new instance of TypeScript exporter /// </summary> /// <param name="context"></param> public TsExporter(ExportContext context) { _context = context; _fileOps = new FilesOperations(context); }
public void CreateFile_ThrowException_WhenPathDataIsNull() { var path = string.Empty; FilesOperations.SaveDataIntoFile(path, null); }
public void CreateFile_ThrowException_WhenPathIsEmpty() { var path = string.Empty; FilesOperations.SaveDataIntoFile(path, new double[1][]); }