public async Task Should_remove_app_from_indexes_when_app_gets_archived() { SetupApp(isArchived: true); var command = new ArchiveApp { AppId = appId }; var context = new CommandContext(command, commandBus) .Complete(); await sut.HandleAsync(context); A.CallTo(() => indexByName.RemoveAsync(appId.Id)) .MustHaveHappened(); A.CallTo(() => indexForUser.RemoveAsync(appId.Id)) .MustHaveHappenedOnceExactly(); }
public async Task Should_remove_app_from_indexes_on_archive(bool isArchived) { var app = SetupApp(0, isArchived); var context = new CommandContext(new ArchiveApp { AppId = appId.Id }, commandBus) .Complete(); await sut.HandleAsync(context); A.CallTo(() => indexByName.RemoveAsync(appId.Id)) .MustHaveHappened(); A.CallTo(() => indexByUser.RemoveAsync(appId.Id)) .MustHaveHappened(); }