public void GetFileDosentExistF() { StdFSDir dir = new StdFSDir(good_path, false); File422 gotten_file = dir.GetFile("f7"); Assert.Null(gotten_file); }
public void GetFileS() { StdFSDir dir = new StdFSDir(good_path, false); File422 gotten_file = dir.GetFile("f1"); Assert.AreEqual("f1", gotten_file.Name); }
public void CreateFileWhenFileDoesNotExist() { File422 file = _root.CreateFile("file2"); Assert.NotNull(file); Assert.AreEqual("file2", file.Name); Assert.AreEqual("FSROOT", file.Parent.Name); }
public void OpenReadWrite() { File422 file = _root.GetFile("file1"); Assert.NotNull(file); Stream stream = file.OpenReadWrite(); Assert.NotNull(stream); }
public void CreateFileS() { StdFSDir dir = new StdFSDir(good_path); dir.CreateFile("f4"); File422 gotten_file = dir.GetFile("f4"); Assert.AreEqual("f4", gotten_file.Name); }
public void WriteFileContents() { File422 file = _root.GetFile("file1"); byte[] buffer = Encoding.ASCII.GetBytes("this is a file with content"); Stream stream = file.OpenReadWrite(); stream.Write(buffer, 0, 0); _service.WriteFileContents(file); }
public void OpenReadOnly() { File422 file = _root.GetFile("file1"); Assert.NotNull(file); Stream stream = file.OpenReadOnly(); Assert.NotNull(stream); Assert.IsFalse(stream.CanWrite); }
public void GetFileContainsPathCharF() { StdFSDir dir = new StdFSDir(good_path, false); File422 gotten_file = dir.GetFile("f/3"); Assert.Null(gotten_file); gotten_file = dir.GetFile("f\\3"); Assert.Null(gotten_file); }