コード例 #1
0
        public void ByDescending_WithColumnName_SetsOrderByProperty()
        {
            var builder = new OrderByBuilder("products");

            builder.ByDescending("id");

            builder.OrderBy.Should().BeEquivalentTo(new OrderBy("products", "id", SortDirection.Descending));
        }
コード例 #2
0
        public void ByDescending_WhenColumnIsNull_ThrowsException()
        {
            var builder = new OrderByBuilder("table");

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

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