public void SqlOrder_WhenOrderByDelegateIsNull_ThrowsException() { var fieldConfig = new FieldConfig("name"); Action action = () => fieldConfig.SqlOrder(null); action.Should() .Throw <ArgumentNullException>() .Which.ParamName.Should() .Be("orderBy"); }
public void SqlOrder_WithOrderByDelegate_AddsOrderByDelegateToMetadata() { void OrderBy(OrderByBuilder order, IReadOnlyDictionary <string, object> arguments, IResolveFieldContext context, SqlTable sqlTable) => order.By("name"); var fieldConfig = new FieldConfig("name"); fieldConfig.SqlOrder(OrderBy); fieldConfig.GetMetadata <OrderByDelegate>(nameof(OrderByDelegate)) .Should() .Be((OrderByDelegate)OrderBy); }