public void HandleFileDoesNotExistDoNothing() { var handler = new DeleteSuccessfulFileHandlingStrategy(); var processingFile = new ProcessingFile(Path.Combine(testDirectory, "somenonexistant.file.inprogress"), "somenonexistant.file", "nonexistantpath\\nonexistant.file"); handler.Handle(processingFile); Assert.IsTrue(true); }
public void HandleFileExistsDeleteFile() { var file = new FileInfo(Path.Combine(testDirectory, "test.file")); var processingFile = new ProcessingFile(file.FullName, "original.name", "originalpath\\original.name"); using (var sr = file.Create()) { } var handler = new DeleteSuccessfulFileHandlingStrategy(); handler.Handle(processingFile); Assert.IsFalse(file.Exists); }