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

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

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

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

            // Assert
            Assert.ThrowsException <InvalidCastException>(action);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }