Exemplo n.º 1
0
        public void When_building_union_all_Then_builds_properly()
        {
            var first  = SqlStatements.Select("*").From("Users u");
            var second = SqlStatements.Select("*").From("Teams t");
            var union  = new UnionOperation(first, second, true);

            union.ToSql().Should().BeEquivalentToIgnoringNewLines(@"SELECT
    *
FROM
    Users u

UNION ALL

SELECT
    *
FROM
    Teams t");
        }
        public void When_building_union_Then_builds_properly()
        {
            var first  = SqlStatements.Select("*").From("Users u");
            var second = SqlStatements.Select("*").From("Teams t");
            var union  = new UnionOperation(first, second);

            Assert.That(
                union.ToSql(),
                SqlCompareConstraint.EqualTo(@"SELECT
    *
FROM
    Users u

UNION

SELECT
    *
FROM
    Teams t"));
        }