Ejemplo n.º 1
0
 public void TestFileServiceOpenFileAndSave()
 {
     var fileName = "TestOpenFileAndSave.txt";
     var fs = new FileService();
     var stream = fs.OpenFile(fileName);
     Assert.IsNotNull(stream, "FileService OpenFile did not return an object");
     var sw = new StreamWriter(stream);
     sw.WriteLine("Testing testing");
     sw.Flush();
     sw.Close();
     stream.Close();
     stream = fs.OpenFile(fileName);
     var sr = new StreamReader(stream);
     var readValue = sr.ReadToEnd();
     Assert.IsFalse(string.IsNullOrEmpty(readValue), "No text was read from the saved file");
     stream.Close();
 }
Ejemplo n.º 2
0
 public void TestFileServiceOpenFile()
 {
     var fs = new FileService();
     var stream = fs.OpenFile("TestOpenFile.txt");
     Assert.IsNotNull(stream, "FileService OpenFile did not return an object");
     stream.Close();
 }
Ejemplo n.º 3
0
 public void TestFileServiceDeleteOpenedFile()
 {
     var fs = new FileService();
     Assert.IsNotNull(fs, "FileService ctor did not return an object");
     fs.DeleteFile("TestOpenFile.txt");
 }
Ejemplo n.º 4
0
 public void TestFileServiceCtor()
 {
     var fs = new FileService();
     Assert.IsNotNull(fs, "FileService ctor did not return an object");
 }
Ejemplo n.º 5
0
 public void TestDeleteDirectory()
 {
     var fs = new FileService();
     fs.DeleteDirectory("TestDirectory");
 }
Ejemplo n.º 6
0
 public void TestCreateDirectory()
 {
     var fs = new FileService();
     fs.CreateDirectory("TestDirectory");
 }