Ejemplo n.º 1
0
        public void Apply()
        {
            var result = _node.Apply(QueryModel, ClauseGenerationContext);

            Assert.That(result, Is.SameAs(QueryModel));

            var clause = (GroupJoinClause)QueryModel.BodyClauses[0];

            Assert.That(clause.ItemName, Is.EqualTo("into"));
            Assert.That(clause.ItemType, Is.SameAs(typeof(IEnumerable <string>)));
            Assert.That(clause.JoinClause.ItemName, Is.EqualTo("i"));
            Assert.That(clause.JoinClause.ItemType, Is.SameAs(typeof(string)));
            Assert.That(clause.JoinClause.InnerSequence, Is.SameAs(_innerSequence));
            Assert.That(clause.JoinClause.OuterKeySelector, Is.SameAs(_node.JoinExpressionNode.GetResolvedOuterKeySelector(ClauseGenerationContext)));
            Assert.That(clause.JoinClause.InnerKeySelector, Is.SameAs(_node.JoinExpressionNode.GetResolvedInnerKeySelector(ClauseGenerationContext)));
        }
Ejemplo n.º 2
0
        public void Apply()
        {
            var result = _node.Apply(QueryModel, ClauseGenerationContext);

            Assert.That(result, Is.SameAs(QueryModel));

            var clause = (GroupJoinClause)QueryModel.BodyClauses[0];

            Assert.That(clause.ItemName, Is.EqualTo("into"));
            Assert.That(clause.ItemType, Is.SameAs(typeof(IEnumerable <string>)));
            Assert.That(clause.JoinClause.ItemName, Is.EqualTo("i"));
            Assert.That(clause.JoinClause.ItemType, Is.SameAs(typeof(string)));
            Assert.That(clause.JoinClause.InnerSequence, Is.SameAs(_innerSequence));

            var expectedOuterKeySelector = ExpressionHelper.Resolve(SourceClause, _outerKeySelector);

            ExpressionTreeComparer.CheckAreEqualTrees(expectedOuterKeySelector, clause.JoinClause.OuterKeySelector);
            var expectedInnerKeySelector = ExpressionHelper.Resolve(clause.JoinClause, _innerKeySelector);

            ExpressionTreeComparer.CheckAreEqualTrees(expectedInnerKeySelector, clause.JoinClause.InnerKeySelector);
        }