Esempio n. 1
0
 public ImageFormControl(String imageFileToOpen)
 {
     FileName = imageFileToOpen;
     thread = null;
     fileManager = new FileManager();
     ImageState = new ImageState();
 }
Esempio n. 2
0
        public ServiceFileManager()
        {
            fileManager = new FileManager();

            FilesPath = Directory.GetCurrentDirectory() + "\\" + filesFolder + "\\";

            CurrentPresentationFolder = Directory.GetCurrentDirectory() + "\\" + currentPresentationFolder + "\\";

            System.IO.Directory.CreateDirectory(CurrentPresentationFolder);
            System.IO.Directory.CreateDirectory(FilesPath);
        }
Esempio n. 3
0
        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);
        }
Esempio n. 4
0
        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);
        }
Esempio n. 5
0
        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)
            {
            }
        }
Esempio n. 6
0
        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);
        }