Example #1
0
        public async Task Should_replace_rule_ids_on_rebuild()
        {
            var state = new HashSet <Guid>
            {
                ruleId1,
                ruleId2
            };

            await sut.RebuildAsync(state);

            var result = await sut.GetRuleIdsAsync();

            Assert.Equal(new List <Guid> {
                ruleId1, ruleId2
            }, result);

            A.CallTo(() => persistence.WriteSnapshotAsync(A <RulesByAppIndexGrain.State> .Ignored))
            .MustHaveHappened();
        }
        public async Task Should_replace_rule_ids_on_rebuild()
        {
            var state = new HashSet <Guid>
            {
                ruleId1,
                ruleId2
            };

            await sut.RebuildAsync(state);

            var result = await sut.GetRuleIdsAsync();

            Assert.Equal(new List <Guid> {
                ruleId1, ruleId2
            }, result);

            A.CallTo(() => grainState.WriteAsync())
            .MustHaveHappened();
        }