public void By_WithSingleKey_SetsColumn() { var aliasGenerator = new DefaultAliasGenerator(); var builder = new SortKeyBuilder("products", aliasGenerator); builder.By("id", typeof(Guid)); builder.SortKey.Should().BeEquivalentTo(new SortKey("products", "id", "id", typeof(Guid), SortDirection.Ascending)); }
public void By_WithThenByDescending_SetsThenBy() { var aliasGenerator = new DefaultAliasGenerator(); var builder = new SortKeyBuilder("products", aliasGenerator); builder.By("sortOrder", typeof(int)).ThenByDescending("id", typeof(Guid)); builder.SortKey.Should() .BeEquivalentTo( new SortKey("products", "sortOrder", "sortOrder", typeof(int), SortDirection.Ascending) { ThenBy = new SortKey("products", "id", "id", typeof(Guid), SortDirection.Descending) }); }