public void ToQueryParams_WithoutOrderBy_NotContainsOrderKeys(IPaging paging) { var result = paging.ToQueryParams(); result.Should().HaveCount(2); result.Should().ContainKey(nameof(paging.Page)); result.Should().ContainKey(nameof(paging.Take)); result[nameof(paging.Page)].Should().Be(paging.Page); result[nameof(paging.Take)].Should().Be(paging.Take); }
public void ToQueryParams_WithOrderBy_MustContainsOrderKeys(IPaging paging) { var result = paging.ToQueryParams(); const string column = nameof(paging.OrderBy) + "." + nameof(paging.OrderBy.Column); const string order = nameof(paging.OrderBy) + "." + nameof(paging.OrderBy.Order); result.Should().HaveCount(4); result.Should().ContainKey(column); result.Should().ContainKey(order); result[column].Should().Be(paging.OrderBy.Column); result[order].Should().Be(paging.OrderBy.Order); }