示例#1
0
        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();
        }
示例#2
0
 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();
        }
示例#4
0
 public async Task CleanupRestoreErrorAsync(DomainId appId)
 {
     await appsIndex.RemoveReservationAsync(appReservation);
 }
示例#5
0
 public override async Task CleanupRestoreErrorAsync(Guid appId)
 {
     await appsIndex.RemoveReservationAsync(appReservation);
 }