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)); }
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)); }
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"); }