public async Task Should_replace_app_ids_on_rebuild() { var state = new Dictionary <string, Guid> { [appName1] = appId1, [appName2] = appId2 }; await sut.RebuildAsync(state); Assert.Equal(appId1, await sut.GetAppIdAsync(appName1)); Assert.Equal(appId2, await sut.GetAppIdAsync(appName2)); Assert.Equal(new List <Guid> { appId1, appId2 }, await sut.GetAppIdsAsync()); Assert.Equal(2, await sut.CountAsync()); A.CallTo(() => persistence.WriteSnapshotAsync(A <AppsByNameIndexGrain.State> .Ignored)) .MustHaveHappened(); }
public async Task Should_replace_app_ids_on_rebuild() { var state = new Dictionary <string, Guid> { [appId1.Name] = appId1.Id, [appId2.Name] = appId2.Id }; await sut.RebuildAsync(state); Assert.Equal(appId1.Id, await sut.GetAppIdAsync(appId1.Name)); Assert.Equal(appId2.Id, await sut.GetAppIdAsync(appId2.Name)); Assert.Equal(new List <Guid> { appId1.Id, appId2.Id }, await sut.GetAppIdsAsync()); Assert.Equal(2, await sut.CountAsync()); A.CallTo(() => grainState.WriteAsync()) .MustHaveHappened(); }