Exemplo n.º 1
0
        public void TestManyToManyJoinEmpty()
        {
            var testCriteria = new TestManyToManyJoinCriteria
            {
                WithAnotherTable = false,
            };
            var builder = new TestQueryBuilder <TestManyToManyJoinCriteria>(testCriteria);
            var query   = builder.Build();

            Assert.AreEqual(
                "Select TableName.* , 0 as SplitOnAnotherTableAnotherId from TableName"
                , SimplifyString(query.Sql)
                );
        }
Exemplo n.º 2
0
        public void TestManyToManyJoin()
        {
            var testCriteria = new TestManyToManyJoinCriteria
            {
                WithAnotherTable = true,
            };
            var builder = new TestQueryBuilder <TestManyToManyJoinCriteria>(testCriteria);
            var query   = builder.Build();

            Assert.AreEqual(
                "Select TableName.* , 0 as SplitOnAnotherTableAnotherId , AnotherTable.* from TableName " +
                "LEFT JOIN AnotherTableCurrentTable on AnotherTableCurrentTable.CurrentId = TableName.CurrentId " +
                "LEFT JOIN AnotherTable on AnotherTable.AnotherId = AnotherTableCurrentTable.AnotherId"
                , SimplifyString(query.Sql)
                );
        }