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");
        }
Exemplo n.º 2
0
        public void ShouldCopyFileToDirectory()
        {
            SystemPath file1 = tempRoot.CreateEmptyFile("File1");

            new SystemIoFileSystem().Copy(file1.ToString(), tempSubRoot.ToString());
            Assert.IsTrue(tempSubRoot.Combine("File1").Exists());
        }
Exemplo n.º 3
0
        public void ShouldAllowOverwrites()
        {
            SystemPath sourceFile = tempRoot.CreateEmptyFile("File1");
            SystemPath targetFile = tempSubRoot.CreateEmptyFile("File2");

            new SystemIoFileSystem().Copy(sourceFile.ToString(), targetFile.ToString());
            Assert.IsTrue(targetFile.Exists());
        }
Exemplo n.º 4
0
 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);
        }