Пример #1
0
        public async Task ResetCollection_ContactNotInCollection_DoNotDisableOtherPlans()
        {
            var contact = CreateContact();
            var plans   = CreatePlansWithCampaign();

            await Model.ResetCollectionAsync(contact, plans, 1);

            MockPlans.Verify(x => x.RemoveFromCampaignAsync(It.IsAny <int>(), It.IsAny <int>()), Times.Never);
        }
Пример #2
0
        public async Task ResetCollection_InCollectionByOtherPlan_DisableThisPlan()
        {
            var contact = CreateContact(2);
            var plans   = CreatePlansWithCampaign();

            await Model.ResetCollectionAsync(contact, plans, 1);

            MockPlans.Verify(x => x.RemoveFromCampaignAsync(1, It.IsAny <int>()), Times.Once);
            MockPlans.Verify(x => x.RemoveFromCampaignAsync(2, It.IsAny <int>()), Times.Never);
        }
Пример #3
0
        public async Task ResetCollection_InCollectionAlreadyDisabled_DoesNotRemoveFromCampaign()
        {
            var contact = CreateContact(2);
            var plans   = CreatePlansWithCampaign();

            plans[0].ListCampaigns.Clear();

            await Model.ResetCollectionAsync(contact, plans, 1);

            MockPlans.Verify(x => x.RemoveFromCampaignAsync(It.IsAny <int>(), It.IsAny <int>()), Times.Never);
        }