/// <summary> /// Get query parameters. /// </summary> /// <returns>Dictionary of query parameters.</returns> protected Dictionary <string, string> GetQueryParameters() { var queryParams = new Dictionary <string, string>(); queryParams.AddRange(_page.GetQueryParameters()); queryParams.AddRange(_filter.GetQueryParameters()); queryParams.AddRange(_sort.GetQueryParameters()); queryParams.AddRange(_select.GetQueryParameters()); return(queryParams); }
public void PageModifier_Page_DefaultValue_ReturnsDefaultQueryParam() { // Arrange var modifier = new PageModifier(); // Act var queryParams = modifier.GetQueryParameters(); // Assert Assert.IsTrue(queryParams.TryGetValue("page", out var page)); Assert.AreEqual($"{Constants.DefaultPage}", page); }
public void PageModifier_Page_CustomValue_ReturnsCorrectQueryParam() { // Arrange var modifier = new PageModifier(); var customPage = 3; modifier.Page = customPage; // Act var queryParams = modifier.GetQueryParameters(); // Assert Assert.IsTrue(queryParams.TryGetValue("page", out var page)); Assert.AreEqual($"{customPage}", page); }