Пример #1
0
        public void Evaluate_CurrentContactIsNull_ReturnsFalse()
        {
            checker.CanProcessContactInCurrentContext().Returns(false);

            var evaluator = new IsInContactGroupConditionType();

            Assert.Multiple(() =>
            {
                Assert.That(ContactManagementContext.GetCurrentContact(), Is.Null);
                Assert.That(evaluator.Evaluate(), Is.False);
            });
        }
Пример #2
0
        public void Evaluate_IsNotInAnyContactGroup_ReturnsFalse()
        {
            currentContactProvider.GetCurrentContact(Arg.Any <IUserInfo>(), Arg.Any <bool>()).Returns(contact);
            var evaluator = new IsInContactGroupConditionType
            {
                SelectedContactGroups = new List <string> {
                    CONTACT_GROUP_NAME
                }
            };

            Assert.That(evaluator.Evaluate(), Is.False);
        }
Пример #3
0
        public void Evaluate_NoContactGroupSelected_ReturnsCorrectResult(int contactId, Constraint result)
        {
            var currentContact = ContactInfo.Provider.Get(contactId);

            currentContactProvider.GetCurrentContact(Arg.Any <IUserInfo>(), Arg.Any <bool>())
            .Returns(currentContact);

            var evaluatorEmpty = new IsInContactGroupConditionType
            {
                SelectedContactGroups = new List <string>()
            };

            var evaluatorNull = new IsInContactGroupConditionType
            {
                SelectedContactGroups = null
            };

            Assert.Multiple(() =>
            {
                Assert.That(() => evaluatorEmpty.Evaluate(), result);
                Assert.That(() => evaluatorNull.Evaluate(), result);
            });
        }