public async Task Should_complete_reservation_with_previous_token() { const string appName = "my-app"; var context = CreateRestoreContext(); A.CallTo(() => appsIndex.ReserveAsync(appId, appName, ct)) .Returns("Reservation"); await sut.RestoreEventAsync(Envelope.Create(new AppCreated { Name = appName }), context, ct); await sut.CompleteRestoreAsync(context, appName); A.CallTo(() => appsIndex.RemoveReservationAsync("Reservation", default)) .MustHaveHappened(); A.CallTo(() => appsIndex.RegisterAsync(appId, appName, default)) .MustHaveHappened(); A.CallTo(() => rebuilder.InsertManyAsync <AppDomainObject, AppDomainObject.State>(A <IEnumerable <DomainId> > .That.Is(appId), 1, default)) .MustHaveHappened(); }
public async Task CleanupRestoreErrorAsync(Guid appId) { if (appReservation != null) { await appsIndex.RemoveReservationAsync(appReservation); } }
public async Task Should_cleanup_reservation_with_previous_token() { const string appName = "my-app"; var context = CreateRestoreContext(); A.CallTo(() => index.ReserveAsync(appId, appName)) .Returns("Reservation"); await sut.RestoreEventAsync(Envelope.Create(new AppCreated { Name = appName }), context); await sut.CleanupRestoreErrorAsync(appId); A.CallTo(() => index.RemoveReservationAsync("Reservation")) .MustHaveHappened(); }
public async Task CleanupRestoreErrorAsync(DomainId appId) { await appsIndex.RemoveReservationAsync(appReservation); }
public override async Task CleanupRestoreErrorAsync(Guid appId) { await appsIndex.RemoveReservationAsync(appReservation); }