public void SortingBuilder_ForNullExpression_ThrowsException() { // Arrange var options = new SortingOptions <TestSearchResultItem>(); var builder = new SortingOptionsBuilder <TestSearchResultItem>(options); // Act builder.By(null); // Assert }
public void SortingBuilder_ForExpression_AddsExpression() { // Arrange var options = new SortingOptions <TestSearchResultItem>(); var builder = new SortingOptionsBuilder <TestSearchResultItem>(options); // Act builder.By(result => result.Name, SortOrder.Descending); // Assert Assert.IsTrue(options.Operations.Count == 1); Assert.IsTrue(options.Operations.First().SortOrder == SortOrder.Descending); }