Esempio n. 1
0
        public async Task Should_remove_rule_id_from_index()
        {
            await sut.AddRuleAsync(ruleId1);

            await sut.AddRuleAsync(ruleId2);

            await sut.RemoveRuleAsync(ruleId1);

            var result = await sut.GetRuleIdsAsync();

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

            A.CallTo(() => persistence.WriteSnapshotAsync(A <RulesByAppIndexGrain.State> .Ignored))
            .MustHaveHappenedTwiceOrMore();
        }
        public async Task Should_remove_rule_id_from_index()
        {
            await sut.AddRuleAsync(ruleId1);

            await sut.AddRuleAsync(ruleId2);

            await sut.RemoveRuleAsync(ruleId1);

            var result = await sut.GetRuleIdsAsync();

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

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