public async Task Should_clear_cache_for_id_after_update_event() { var apps = ProviderResults(appV1, appV2); repository.Setup(x => x.FindAppAsync(appId.Id)).Returns(() => Task.FromResult(apps())); await ProvideAppById(appV1); sut.On(Envelope.Create(new AppLanguageAdded { AppId = appId }).To <IEvent>()).Wait(); await ProvideAppById(appV2); repository.Verify(x => x.FindAppAsync(appId.Id), Times.Exactly(2)); }
public async Task Should_clear_cache_for_id_after_update_event() { A.CallTo(() => repository.FindAppAsync(appId.Id)) .Returns(appV2); A.CallTo(() => repository.FindAppAsync(appId.Id)) .Returns(appV1).Once(); await ProvideAppByIdAsync(appV1); sut.On(Envelope.Create(new AppLanguageAdded { AppId = appId }).To <IEvent>()).Wait(); await ProvideAppByIdAsync(appV2); A.CallTo(() => repository.FindAppAsync(appId.Id)).MustHaveHappened(Repeated.Exactly.Times(2)); }