public ImageFormControl(String imageFileToOpen) { FileName = imageFileToOpen; thread = null; fileManager = new FileManager(); ImageState = new ImageState(); }
public ServiceFileManager() { fileManager = new FileManager(); FilesPath = Directory.GetCurrentDirectory() + "\\" + filesFolder + "\\"; CurrentPresentationFolder = Directory.GetCurrentDirectory() + "\\" + currentPresentationFolder + "\\"; System.IO.Directory.CreateDirectory(CurrentPresentationFolder); System.IO.Directory.CreateDirectory(FilesPath); }
public void FileExistsTest() { FileManager target = new FileManager(); // TODO: Initialize to an appropriate value string fileName = "MyFile.txt"; // TODO: Initialize to an appropriate value bool expected = true; // TODO: Initialize to an appropriate value String content = "Content"; bool actual; actual = target.FileExists(fileName); Assert.AreEqual(false, actual); createFile(fileName, Encoding.ASCII.GetBytes(content)); actual = target.FileExists(fileName); Assert.AreEqual(expected, actual); System.IO.File.Delete(fileName); }
public void CreateFileTest() { FileManager target = new FileManager(); // TODO: Initialize to an appropriate value String fileName = "MyFile.txt"; String content = "Content of my file"; target.CreateFile(fileName, content); Assert.IsTrue(target.FileExists(fileName)); System.IO.File.Delete(fileName); }
public void DeleteFileTest() { FileManager target = new FileManager(); // TODO: Initialize to an appropriate value String fileName = "MyFile1.txt"; String content = "Content of my file"; createFile(fileName, Encoding.ASCII.GetBytes(content)); target.DeleteFile(fileName); Assert.IsFalse(target.FileExists(fileName)); try { System.IO.File.Delete(fileName); } catch (Exception e) { } }
public void ReadFileTest() { FileManager target = new FileManager(); // TODO: Initialize to an appropriate value String fileName = "MyFile.txt"; String content = "Content of my file"; createFile(fileName, Encoding.ASCII.GetBytes(content)); Assert.IsTrue(target.FileExists(fileName)); Assert.AreEqual(content, target.ReadFile(fileName).ToString()); System.IO.File.Delete(fileName); }