Esempio n. 1
0
        public void Grouped_WhenWhereIsNull_ThrowsException()
        {
            var builder = new WhereBuilder("table", new List <WhereCondition>());

            Action action = () => builder.Grouped(null);

            action.Should()
            .Throw <ArgumentNullException>()
            .Which.ParamName.Should()
            .Be("where");
        }
Esempio n. 2
0
        public void Grouped_WithNestedConditions_AddsConditionToList()
        {
            var whereConditions = new List <WhereCondition>();
            var builder         = new WhereBuilder("table", whereConditions);

            builder.Grouped(where =>
            {
                where.Column("id", 2);
            });

            whereConditions.Should()
            .ContainSingle()
            .Which.Should()
            .BeEquivalentTo(new NestedCondition(new List <WhereCondition>
            {
                new CompareCondition("table", "id", "=", 2)
            }));
        }