public void Execute_FileIsNotReadOnly_FileDeleted() { var fileToDelete = new FakeFile("fileToDelete"); fileToDelete.ExistsReturnValue = true; var deleteCommand = new DeleteFileCommand(fileToDelete); deleteCommand.Execute(); Assert.IsTrue(fileToDelete.DeleteCalled); }
public void Execute_FileIsReadOnly_ReadonlyCleared() { var fileToDelete = new FakeFile("fileToDelete"); fileToDelete.ExistsReturnValue = true; fileToDelete.Attributes = FileAttributes.ReadOnly; var deleteCommand = new DeleteFileCommand(fileToDelete); deleteCommand.Execute(); Assert.AreEqual(FileAttributes.Normal, fileToDelete.Attributes); }
public void Execute_FileDoesNotExist_NoFileDeleteIsCalled() { var fileToDelete = new FakeFile("fileToDelete"); fileToDelete.ExistsReturnValue = false; fileToDelete.Attributes = FileAttributes.ReadOnly; var deleteCommand = new DeleteFileCommand(fileToDelete); deleteCommand.Execute(); Assert.IsFalse(fileToDelete.DeleteCalled); }