public void ReadEmptyFile() { SystemPath filename = tempDir.CreateEmptyFile("ReadEmptyFile.log"); ServerLogFileReader reader = new ServerLogFileReader(filename.ToString(), 10); Assert.AreEqual("", reader.Read(), "Error reading empty log file"); }
public void ShouldCopyFileToDirectory() { SystemPath file1 = tempRoot.CreateEmptyFile("File1"); new SystemIoFileSystem().Copy(file1.ToString(), tempSubRoot.ToString()); Assert.IsTrue(tempSubRoot.Combine("File1").Exists()); }
public void ShouldAllowOverwrites() { SystemPath sourceFile = tempRoot.CreateEmptyFile("File1"); SystemPath targetFile = tempSubRoot.CreateEmptyFile("File2"); new SystemIoFileSystem().Copy(sourceFile.ToString(), targetFile.ToString()); Assert.IsTrue(targetFile.Exists()); }
private void CreateTempFiles(SystemPath path, string[] filenames) { foreach (string filename in filenames) { path.CreateEmptyFile(filename); } }
public void OverwriteReadOnlyFileAtDestination() { srcRoot.CreateDirectory().CreateTextFile(fileName, fileContents); pubRoot.CreateDirectory(); FileInfo readOnlyDestFile = new FileInfo(pubRoot.CreateEmptyFile(fileName).ToString()); readOnlyDestFile.Attributes = FileAttributes.ReadOnly; publisher.UseLabelSubDirectory = false; publisher.Run(result); }