0
0
RhSolutions-Api/RhSolutions.Parsers.Tests/ProductParsersTests.cs

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));
}
}