diff options
Diffstat (limited to 'RhSolutions.Api.Tests')
-rw-r--r-- | RhSolutions.Api.Tests/ProductQueryModifierTests.cs | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/RhSolutions.Api.Tests/ProductQueryModifierTests.cs b/RhSolutions.Api.Tests/ProductQueryModifierTests.cs index 7166899..b9f0e06 100644 --- a/RhSolutions.Api.Tests/ProductQueryModifierTests.cs +++ b/RhSolutions.Api.Tests/ProductQueryModifierTests.cs @@ -1,6 +1,3 @@ -using System.Web; -using Microsoft.AspNetCore.Http; -using Microsoft.Extensions.Primitives; public abstract class ProductQueryModifierTests { protected ProductQueryModifierFactory _factory; @@ -10,17 +7,10 @@ public abstract class ProductQueryModifierTests { _factory = new ProductQueryModifierFactory(); } - public void Execute(string productType, string query, string modified) + public void Execute(string productType, string query, string expected) { - Dictionary<string, StringValues> queryPair = new() - { - ["query"] = new StringValues(query) - }; - QueryCollection collection = new(queryPair); - var modifier = _factory.GetModifier(productType); - - Assert.True(modifier.TryQueryModify(collection, out var actual)); - string? result = HttpUtility.ParseQueryString(actual.ToString())["query"]; - Assert.That(result, Is.EqualTo(modified)); + var modifier = _factory.GetModifier(productType); + Assert.True(modifier.TryQueryModify(query, out var actual)); + Assert.That(actual, Is.EqualTo(expected)); } }
\ No newline at end of file |