Template
61 lines
2.1 KiB
C#
61 lines
2.1 KiB
C#
using Snowflake.Data.Client;
|
|
using Strata.DecisionSupport.Biz.Parameters;
|
|
using Strata.DecisionSupport.Biz.Services;
|
|
using Strata.DecisionSupport.Models.Encounters;
|
|
using System.Diagnostics.CodeAnalysis;
|
|
|
|
namespace Strata.DecisionSupport.Biz.Test.Integration.IntegrationTests
|
|
{
|
|
[ExcludeFromCodeCoverage]
|
|
[TestFixture, Category("Integration"), Category("DSS")]
|
|
public class TestEncounterUnitOfServiceQuery : IntegrationTestBase
|
|
{
|
|
[TestCaseSource(nameof(TestCases))]
|
|
public async Task QueryTest(EncounterUnitOfServiceQueryInfo queryInfo)
|
|
=> await base.QueryTest<EncounterUnitOfService, EncounterUnitOfServiceQueryInfo>(queryInfo);
|
|
|
|
protected override string Query<EnounterUnitOfServiceQueryInfo>(EnounterUnitOfServiceQueryInfo queryInfo)
|
|
=> (queryInfo is IWithArgs args)
|
|
? EncounterQueries.EncounterUnitOfServiceQuery(args)
|
|
: EncounterQueries.EncounterUnitOfServiceQuery();
|
|
|
|
[TestCaseSource(nameof(ServiceTestCases))]
|
|
public async Task EncounterUnitOfServiceQueryServiceTest(EncounterUnitOfServiceQueryInfo queryInfo)
|
|
{
|
|
try
|
|
{
|
|
var result = await _encounterQueryService.RunEncounterUnitOfServiceQuery(queryInfo, CancellationToken.None);
|
|
await Verifier.Verify(result, verifySettings)
|
|
.UseFileName(TestContext.CurrentContext.TestName(nameof(result)));
|
|
}
|
|
catch (SnowflakeDbException dbex)
|
|
{
|
|
// ILB
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
|
|
throw;
|
|
}
|
|
}
|
|
|
|
public static IEnumerable<TestCaseData> ServiceTestCases()
|
|
{
|
|
yield return new TestCaseData(new EncounterUnitOfServiceQueryInfo(
|
|
24,
|
|
[1L, 2L]
|
|
))
|
|
.SetName("{m}");
|
|
}
|
|
|
|
public static IEnumerable<TestCaseData> TestCases()
|
|
{
|
|
yield return new TestCaseData(new EncounterUnitOfServiceQueryInfo(
|
|
24,
|
|
[1L, 2L]
|
|
))
|
|
.SetName("{c} {m}");
|
|
}
|
|
}
|
|
}
|