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

15 lines
456 B
C#
Raw Normal View History

2024-01-26 16:48:47 +03:00
using Microsoft.Extensions.DependencyInjection;
2023-12-30 14:43:25 +03:00
namespace RhSolutions.Api.Tests;
2024-02-08 17:11:11 +03:00
public abstract class ProductParsersTests
2023-09-29 10:07:41 +03:00
{
2024-01-26 16:48:47 +03:00
public void Invoke(string productType, string query, string expected)
2023-10-01 22:14:47 +03:00
{
2024-02-08 17:11:11 +03:00
var modifier = TestServiceCollection.ServiceProvider?.GetRequiredKeyedService<IProductParser>(productType);
2024-01-26 16:48:47 +03:00
string actual = string.Empty;
2024-02-08 17:11:11 +03:00
Assert.That(modifier?.TryParse(query, out actual), Is.True);
2023-10-20 22:35:44 +03:00
Assert.That(actual, Is.EqualTo(expected));
2023-10-01 22:14:47 +03:00
}
2024-01-26 16:48:47 +03:00
}