Example #1
0
        public void CandidateAlreadyHasLocalEventSubscriptionType_WhenHasLocalEventSubscription_ReturnsTrue()
        {
            _mockService.Setup(m => m.CreateQuery("contact", _context))
            .Returns(MockCandidates);

            var result = _crm.CandidateAlreadyHasLocalEventSubscriptionType(JaneDoeGuid);

            result.Should().BeTrue();
        }
Example #2
0
        protected override bool ShouldMap(ICrmService crm)
        {
            IsNewRegistrant = Id == null;

            var changingEventSubscriptionType = !IsNewRegistrant && EventsSubscriptionTypeId != null;

            if (changingEventSubscriptionType && crm.CandidateAlreadyHasLocalEventSubscriptionType((Guid)Id))
            {
                // Never down-grade to a 'single event' subscription type from
                // a 'local event' subscription type.
                EventsSubscriptionTypeId = (int)SubscriptionType.LocalEvent;
            }

            return(base.ShouldMap(crm));
        }
Example #3
0
        protected override bool ShouldMap(ICrmService crm)
        {
            IsNewRegistrant = Id == null;

            if (AssignmentStatusId == (int)AssignmentStatus.WaitingToBeAssigned)
            {
                StatusIsWaitingToBeAssignedAt = DateTime.UtcNow;
            }

            var changingEventSubscriptionType = !IsNewRegistrant && EventsSubscriptionTypeId != null;

            if (changingEventSubscriptionType && crm.CandidateAlreadyHasLocalEventSubscriptionType((Guid)Id))
            {
                // Never down-grade to a 'single event' subscription type from
                // a 'local event' subscription type.
                EventsSubscriptionTypeId = (int)SubscriptionType.LocalEvent;
            }

            return(base.ShouldMap(crm));
        }