0
0
RhSolutions-Api/RhSolutions.Api.Tests/ProductQueryModifierTests.cs
Serghei Cebotari 118761ebc2
All checks were successful
Test API / test (push) Successful in 2m17s
Use Service Provider for test purposes
2024-01-26 16:48:47 +03:00

15 lines
472 B
C#

using Microsoft.Extensions.DependencyInjection;
namespace RhSolutions.Api.Tests;
public abstract class ProductQueryModifierTests
{
public void Invoke(string productType, string query, string expected)
{
var modifier = TestServiceCollection.ServiceProvider?.GetRequiredKeyedService<IProductMLModifier>(productType);
string actual = string.Empty;
Assert.That(modifier?.TryQueryModify(query, out actual), Is.True);
Assert.That(actual, Is.EqualTo(expected));
}
}