Пример #1
0
        public void BinaryExpression_WithRelationshipWithTwoProps_NotEquals_ShouldCreateCriteriaOnRelationshipFields()
        {
            //---------------Set up test pack-------------------
            MyBO.LoadClassDefWithAssociationRelationship();
            MyRelatedBo.LoadClassDefWithRelationshipWithTwoProperties();
            const string testValue = "test value";
            var          bo1       = new MyBO()
            {
                TestProp = testValue
            };
            var expectedCriteria =
                new Criteria(
                    new Criteria("MyRelationship.MyBoID", Criteria.ComparisonOp.NotEquals, bo1.ID.GetAsGuid()),
                    Criteria.LogicalOp.Or,
                    new Criteria("MyRelationship.MyRelatedTestProp", Criteria.ComparisonOp.NotEquals, testValue)
                    );
            //---------------Execute Test ----------------------
            var criteria = Criteria.Expr <MyRelatedBo>(bo => bo.MyRelationship != bo1).Build();

            //---------------Test Result -----------------------
            Assert.AreEqual(expectedCriteria, criteria);
        }