public void CreatesTargetFile() { IDirectoryObject sourceDirectory = DirectoryHelper.CreateDirectoryWithFile(); IDirectoryObject targetDirectory = new MemoryDirectoryObject("directory"); var syncNet = new Processor(sourceDirectory, targetDirectory, new SyncTaskQueue()); syncNet.ProcessSourceDirectory(); var targetFile = targetDirectory.GetFile(DirectoryHelper.FileName); Assert.IsTrue(targetFile.Exists); }
public void WritesFileContentToTargetFile() { IDirectoryObject sourceDirectory = DirectoryHelper.CreateDirectoryWithFile(); IDirectoryObject targetDirectory = new MemoryDirectoryObject("directory"); var syncNet = new Processor(sourceDirectory, targetDirectory, new SyncTaskQueue()); syncNet.ProcessSourceDirectory(); var targetFile = targetDirectory.GetFile(DirectoryHelper.FileName); using (var sr = new StreamReader(targetFile.GetStream())) { var targetFileContents = sr.ReadToEnd().Replace("\0", string.Empty); Assert.AreEqual(DirectoryHelper.Contents, targetFileContents); } }