15 lines
456 B
C#
15 lines
456 B
C#
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
namespace RhSolutions.Api.Tests;
|
|
|
|
public abstract class ProductParsersTests
|
|
{
|
|
public void Invoke(string productType, string query, string expected)
|
|
{
|
|
var modifier = TestServiceCollection.ServiceProvider?.GetRequiredKeyedService<IProductParser>(productType);
|
|
string actual = string.Empty;
|
|
Assert.That(modifier?.TryParse(query, out actual), Is.True);
|
|
Assert.That(actual, Is.EqualTo(expected));
|
|
}
|
|
}
|