public void BuildWhenEndsWithTest()
        {
            var criteriaExpression = new CriteriaExpression();

            criteriaExpression.EndsWith("Name", "value");

            var builder    = new CriteriaBuilder();
            var expression = builder.Build <Customer>(criteriaExpression);

            Assert.IsNotNull(expression);
            Assert.AreEqual("((x.Name != null) AndAlso x.Name.EndsWith(\"value\"))", expression.Body.ToString());
        }
Пример #2
0
        public void ConstructorWhenEndWithTest()
        {
            var expression = new CriteriaExpression();

            expression.EndsWith("name", "value");

            var criteria = expression.Criterias.FirstOrDefault();

            Assert.IsNotNull(criteria);
            Assert.AreEqual("name", criteria.Property);
            Assert.AreEqual("value", criteria.Value);
            Assert.AreEqual(null, criteria.Value2);
            Assert.AreEqual(LogicalType.And, criteria.LogicalType);
            Assert.AreEqual(OperationType.EndsWith, criteria.OperationType);
        }