Пример #1
0
        public void CreateOperationNotEqual()
        {
            Operation operation = factory.CreateComparationNotEqual(
                factory.CreateFieldNode("Field"),
                factory.CreateValueNode("Value", ValueNodeType.Text));

            Assert.IsNotNull(operation);
            Assert.AreEqual(typeof(OpNotEqual), operation.GetType());
        }
Пример #2
0
        /// <summary>
        /// Determines the correct oepration.
        /// If the value token after a distinct operator, is null the correct
        /// operation is IsNotNull
        /// </summary>
        /// <param name="field">The field.</param>
        /// <returns>The operation</returns>
        private Operation IsNotNullOrNotEqualRule(FieldNode field)
        {
            ValueNode valueNode = ValueRule();

            // TODO: Introduce a class for Null Values
            if (valueNode == null)
            {
                return(_astFactory.CreateComparationIsNotNull(field));
            }

            return(_astFactory.CreateComparationNotEqual(field, valueNode));
        }