Esempio n. 1
0
        public void ThenByDescending_WithColumnName_SetsOrderByColumn()
        {
            var builder = new ThenOrderByBuilder("products", new OrderBy("products", "id", SortDirection.Ascending));

            builder.ThenByDescending("id");

            builder.OrderBy.Should().BeEquivalentTo(new OrderBy("products", "id", SortDirection.Descending));
        }
Esempio n. 2
0
        public void ThenBy_WithColumnName_SetsThenByOnOrderBy()
        {
            var orderBy = new OrderBy("products", "name", SortDirection.Ascending);
            var builder = new ThenOrderByBuilder("products", orderBy);

            builder.ThenBy("id");

            orderBy.ThenBy.Should().BeEquivalentTo(new OrderBy("products", "id", SortDirection.Ascending));
        }
Esempio n. 3
0
        public void ThenByDescending_WhenColumnIsNull_ThrowsException()
        {
            var builder = new ThenOrderByBuilder("products", new OrderBy("products", "name", SortDirection.Ascending));

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

            action.Should()
            .Throw <ArgumentNullException>()
            .Which.ParamName.Should()
            .Be("column");
        }