public void And_AllTrue_Null()
        {
            // Arrange
            IConditionModifier modifier = new AndModifier();

            // Act
            Action action = () => modifier.IsConditionMet(true, null);

            // Assert
            Assert.ThrowsException<InvalidCastException>(action);
        }
示例#2
0
        public void And_AllTrue_Null()
        {
            // Arrange
            IConditionModifier modifier = new AndModifier();

            // Act
            Action action = () => modifier.IsConditionMet(true, null);

            // Assert
            Assert.ThrowsException <InvalidCastException>(action);
        }
示例#3
0
        public void And_NotAllTrue_Single()
        {
            // Arrange
            bool result;
            IConditionModifier modifier = new AndModifier();

            // Act
            result = modifier.IsConditionMet(true, false);

            // Assert
            Assert.IsFalse(result);
        }
        public void And_AllTrue_Single()
        {
            // Arrange
            bool result;
            IConditionModifier modifier = new AndModifier();

            // Act
            result = modifier.IsConditionMet(true, true);

            // Assert
            Assert.IsTrue(result);
        }
示例#5
0
        public void And_AllTrue_Multiple()
        {
            // Arrange
            bool result;
            var  inputs = new[] { true, true, true };
            IConditionModifier modifier = new AndModifier();

            // Act
            result = modifier.IsConditionMet(true, inputs.ToArray());

            // Assert
            Assert.IsTrue(result);
        }
        public void And_AllTrue_Multiple()
        {
            // Arrange
            bool result;
            var inputs = new[] { true, true, true };
            IConditionModifier modifier = new AndModifier();

            // Act
            result = modifier.IsConditionMet(true, inputs.ToArray());

            // Assert
            Assert.IsTrue(result);
        }
        public void And_AllowNullValue_ConditionNotMet()
        {
            // Arrange
            bool result;
            IConditionModifier modifier = new AndModifier();
            modifier.TreatNullAsConditionNotMet = true;

            // Act
            result = modifier.IsConditionMet(null, null);

            // Assert
            Assert.IsFalse(result);
        }
示例#8
0
        public void And_AllowNullValue_ConditionNotMet()
        {
            // Arrange
            bool result;
            IConditionModifier modifier = new AndModifier();

            modifier.TreatNullAsConditionNotMet = true;

            // Act
            result = modifier.IsConditionMet(null, null);

            // Assert
            Assert.IsFalse(result);
        }