public async Task Should_replace_schema_ids_on_rebuild()
        {
            var state = new Dictionary <string, Guid>
            {
                [schemaId1.Name] = schemaId1.Id,
                [schemaId2.Name] = schemaId2.Id
            };

            await sut.RebuildAsync(state);

            Assert.Equal(schemaId1.Id, await sut.GetSchemaIdAsync(schemaId1.Name));
            Assert.Equal(schemaId2.Id, await sut.GetSchemaIdAsync(schemaId2.Name));

            Assert.Equal(new List <Guid> {
                schemaId1.Id, schemaId2.Id
            }, await sut.GetSchemaIdsAsync());

            A.CallTo(() => grainState.WriteAsync())
            .MustHaveHappened();
        }
Esempio n. 2
0
        public async Task Should_replace_schema_ids_on_rebuild()
        {
            var state = new Dictionary <string, Guid>
            {
                [schemaName1] = schemaId1,
                [schemaName2] = schemaId2
            };

            await sut.RebuildAsync(state);

            Assert.Equal(schemaId1, await sut.GetSchemaIdAsync(schemaName1));
            Assert.Equal(schemaId2, await sut.GetSchemaIdAsync(schemaName2));

            Assert.Equal(new List <Guid> {
                schemaId1, schemaId2
            }, await sut.GetSchemaIdsAsync());

            A.CallTo(() => persistence.WriteSnapshotAsync(A <SchemasByAppIndexGrain.State> .Ignored))
            .MustHaveHappened();
        }