Beispiel #1
0
        public void TestUnionOfCalls()
        {
            var wlMetadata = MetadataProvider.Entity("fakeentity");
            var dto        = new PaginatedSearchRequestDto();

            dto.WhereClause       = "3=3";
            dto.UnionWhereClauses = new List <string> {
                "1=1", "2=2"
            };
            var result   = _builder.AllRows(wlMetadata, dto);
            var resultST = "select fakeentity.fakeid as \"fakeid\", fakeentity.rowstamp as \"rowstamp\" from fakeentity as fakeentity  where (3=3) union all select fakeentity.fakeid as \"fakeid\", fakeentity.rowstamp as \"rowstamp\" from fakeentity as fakeentity  where (1=1) union all select fakeentity.fakeid as \"fakeid\", fakeentity.rowstamp as \"rowstamp\" from fakeentity as fakeentity  where (2=2) order by 1 desc";

            Assert.AreEqual(resultST, result.Sql);
        }