public void Cleanup_deletes_commands_that_were_applied_before_the_cutoff() { // arrange: set up some test data WriteScheduledCommand( finalAttemptTime: null, appliedTime: Clock.Now().Subtract(10.Days()), dueTime: Clock.Now().Subtract(100.Days())); // act var migration = new CommandSchedulerCleanupMigration( frequencyInDays: 1, completedCommandsOlderThan: 7.Days()); Run(migration); // assert ScheduledCommandExists().Should().BeFalse(); }
public void Cleanup_does_not_delete_commands_that_have_not_been_applied() { // arrange: set up some test data WriteScheduledCommand( finalAttemptTime: null, appliedTime: null, dueTime: Clock.Now().Subtract(1.Days())); // act var migration = new CommandSchedulerCleanupMigration( frequencyInDays: 1, completedCommandsOlderThan: 7.Days()); Run(migration); // assert ScheduledCommandExists().Should().BeTrue(); }