Template
chore: deploy initial code base
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
using Strata.DecisionSupport.Biz.Services;
|
||||
using System.Threading.Tasks;
|
||||
using VerifyNUnit;
|
||||
using VerifyTests;
|
||||
|
||||
namespace Strata.DecisionSupport.Biz.Test.Unit.Services
|
||||
{
|
||||
[TestFixture, Category("Unit"), Category("DSS")]
|
||||
public class AllChargeInfoQueryTests //: EncounterQueryServiceTests
|
||||
{
|
||||
private VerifySettings _verifySettings;
|
||||
|
||||
[SetUp]
|
||||
public void TestSetUp()
|
||||
{
|
||||
_verifySettings = TestExtensions.TestSettings();
|
||||
}
|
||||
|
||||
[Test]
|
||||
public async Task AllChargeInfoQueryTest()
|
||||
{
|
||||
var query = EncounterQueries.AllChargeInfoQuery();
|
||||
await Verifier.Verify(query, _verifySettings)
|
||||
.UseFileName(TestContext.CurrentContext.TestName());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
using Strata.DecisionSupport.Biz.Services;
|
||||
using System.Threading.Tasks;
|
||||
using VerifyNUnit;
|
||||
|
||||
namespace Strata.DecisionSupport.Biz.Test.Unit.Services
|
||||
{
|
||||
[TestFixture, Category("Unit"), Category("DSS")]
|
||||
public class ChargeInfoQueryTests : EncounterQueryServiceTests
|
||||
{
|
||||
[Test]
|
||||
public async Task ChargeInfoQueryTest()
|
||||
{
|
||||
var query = EncounterQueries.ChargeInfoQuery();
|
||||
await Verifier.Verify(query, verifySettings)
|
||||
.UseFileName(TestContext.CurrentContext.TestName());
|
||||
}
|
||||
}
|
||||
}
|
||||
+77
@@ -0,0 +1,77 @@
|
||||
using Strata.DecisionSupport.Biz.Parameters;
|
||||
using Strata.DecisionSupport.Biz.Services;
|
||||
using Strata.DecisionSupport.Models.Encounters;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using VerifyNUnit;
|
||||
|
||||
namespace Strata.DecisionSupport.Biz.Test.Unit.Services
|
||||
{
|
||||
[TestFixture, Category("Unit"), Category("DSS")]
|
||||
public class DepartmentEncounterUnitOfServiceQueryTests : EncounterQueryServiceTests
|
||||
{
|
||||
[SetUp]
|
||||
public void TestSetUp()
|
||||
{
|
||||
var uos = new List<DepartmentEncounterUnitOfService>
|
||||
{
|
||||
new DepartmentEncounterUnitOfService
|
||||
{
|
||||
DepartmentId = 1,
|
||||
EncounterId = 2,
|
||||
CostDriver = "LOS",
|
||||
EntityId = 2,
|
||||
Uos = 19.2486d
|
||||
}
|
||||
};
|
||||
//Mock.Get(snowflakeDbContext)
|
||||
// .Setup(x => x.QueryAsync<DepartmentEncounterUnitOfService>(It.IsAny<string>(), It.IsAny<string>(), It.IsAny<object>(), It.IsAny<TimeSpan>()))
|
||||
// .Returns(() => Task.FromResult(uos));
|
||||
}
|
||||
|
||||
[TestCaseSource(nameof(DepartmentEncounterUnitOfServiceQueryTestCases))]
|
||||
public async Task DepartmentEncounterUnitOfServiceQueryTest(string globalId)
|
||||
{
|
||||
var query = globalId.DepartmentEncounterUnitOfServiceQuery("DepartmentRollup1Id");
|
||||
await Verifier.Verify(query, verifySettings)
|
||||
.UseFileName(TestContext.CurrentContext.TestName());
|
||||
Console.WriteLine(query);
|
||||
}
|
||||
|
||||
public static IEnumerable<TestCaseData> DepartmentEncounterUnitOfServiceQueryTestCases()
|
||||
{
|
||||
yield return new TestCaseData("")
|
||||
.SetName("{m} Entity");
|
||||
yield return new TestCaseData("Location")
|
||||
.SetName("{m} Location");
|
||||
yield return new TestCaseData("DepartmentRollup1Id")
|
||||
.SetName("{m} Department Rollup");
|
||||
}
|
||||
|
||||
[TestCaseSource(nameof(EncounterUnitOfServiceQueryTestCases))]
|
||||
public async Task RunDepartmentEncounterUnitOfServiceQueryTest(string globalId, int observationUnitsDivisor, IEnumerable<long> encounterIds)
|
||||
{
|
||||
var queryInfo = new DepartmentEncounterUnitOfServiceQueryInfo(globalId, observationUnitsDivisor, encounterIds);
|
||||
var result = await service.RunDepartmentEncounterUnitOfServiceQuery(queryInfo, CancellationToken.None);
|
||||
await Verifier.Verify(result, verifySettings)
|
||||
.UseFileName(TestContext.CurrentContext.TestName());
|
||||
}
|
||||
|
||||
public static IEnumerable<TestCaseData> EncounterUnitOfServiceQueryTestCases()
|
||||
{
|
||||
yield return new TestCaseData("", 24, new[] { 2L })
|
||||
.SetName("{m} Entity 24 { 2 }")
|
||||
.Ignore("System.ArgumentException : Invalid callback. Setup on method with return type 'Task<IEnumerable<DepartmentEncounterUnitOfService>>' cannot invoke callback with return type 'Task<List<DepartmentEncounterUnitOfService>>'");
|
||||
yield return new TestCaseData("Location", 24, new[] { 2L })
|
||||
.SetName("{m} Location 24 { 2 }")
|
||||
.Ignore("System.ArgumentException : Invalid callback. Setup on method with return type 'Task<IEnumerable<DepartmentEncounterUnitOfService>>' cannot invoke callback with return type 'Task<List<DepartmentEncounterUnitOfService>>'");
|
||||
yield return new TestCaseData("Department Rollup 1", 24, new[] { 2L })
|
||||
.SetName("{m} Department Rollup 24 { 2 }")
|
||||
.Ignore("System.ArgumentException : Invalid callback. Setup on method with return type 'Task<IEnumerable<DepartmentEncounterUnitOfService>>' cannot invoke callback with return type 'Task<List<DepartmentEncounterUnitOfService>>'");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
using Strata.DecisionSupport.Biz.Services;
|
||||
using System.Threading.Tasks;
|
||||
using VerifyNUnit;
|
||||
|
||||
namespace Strata.DecisionSupport.Biz.Test.Unit.Services
|
||||
{
|
||||
[TestFixture, Category("Unit"), Category("DSS")]
|
||||
public class EncounterChargeQueryTests : EncounterQueryServiceTests
|
||||
{
|
||||
[Test]
|
||||
public async Task EncounterChargeQueryTest()
|
||||
{
|
||||
var query = EncounterQueries.EncounterChargeQuery();
|
||||
await Verifier.Verify(query, verifySettings)
|
||||
.UseFileName(TestContext.CurrentContext.TestName());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
using FluentAssertions;
|
||||
using Moq;
|
||||
using Strata.DecisionSupport.Biz.Parameters;
|
||||
using Strata.DecisionSupport.Biz.Services;
|
||||
using Strata.DecisionSupport.Models.Encounters;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using VerifyNUnit;
|
||||
|
||||
namespace Strata.DecisionSupport.Biz.Test.Unit.Services
|
||||
{
|
||||
[TestFixture, Category("Unit"), Category("DSS")]
|
||||
public class EncounterCostInfoQueryTests : EncounterQueryServiceTests
|
||||
{
|
||||
[SetUp]
|
||||
public void Setup()
|
||||
{
|
||||
var encounterCost = new List<EncounterCostInfo>
|
||||
{
|
||||
new EncounterCostInfo
|
||||
{
|
||||
EncounterId = 123456789,
|
||||
EntityId = 2,
|
||||
ChargeCodeId = 210,
|
||||
CostDriver = "LOS"
|
||||
|
||||
}
|
||||
}.AsEnumerable();
|
||||
Mock.Get(snowflakeDbContext)
|
||||
.Setup(x => x.QueryAsync<EncounterCostInfo>(It.IsAny<string>(), It.IsAny<string>(), It.IsAny<object>(), It.IsAny<TimeSpan>()))
|
||||
.Returns(() => Task.FromResult(encounterCost));
|
||||
}
|
||||
|
||||
[TestCase("", true, TestName = "{m} Specific Entity")]
|
||||
[TestCase("Location", true, TestName = "{m} Specific Location")]
|
||||
[TestCase("DepartmentRollup1Id", true, TestName = "{m} Specific Department Rollup")]
|
||||
[TestCase("", false, TestName = "{m} Static Entity")]
|
||||
[TestCase("Location", false, TestName = "{m} Static Location")]
|
||||
[TestCase("DepartmentRollup1Id", false, TestName = "{m} Static Department Rollup")]
|
||||
public async Task EncounterCostInfoQueryTest(string globalId, bool isPatientSpecific)
|
||||
{
|
||||
var query = globalId.EncounterCostInfoQuery(isPatientSpecific, "DepartmentRollup1Id", "AND cc.CostDriver <> '' \r\n AND cc.CostDriver <> 'Excluded' ");
|
||||
await Verifier.Verify(query, verifySettings)
|
||||
.UseFileName(TestContext.CurrentContext.TestName());
|
||||
}
|
||||
|
||||
[TestCaseSource(nameof(EncounterCostInfoQueryTestCases))]
|
||||
public async Task RunEncounterCostInfoQueryTest(bool isPatientSpecific, string deptRollupId)
|
||||
{
|
||||
var queryInfo = new EncounterCostQueryInfo(isPatientSpecific, configurationGuid, string.Empty, deptRollupId, new[] { 2L });
|
||||
var results = await service.RunEncounterCostInfoQuery(queryInfo, CancellationToken.None);
|
||||
results.Should().NotBeNullOrEmpty()
|
||||
.And.AllBeOfType<EncounterCostInfo>();
|
||||
}
|
||||
|
||||
public static IEnumerable<TestCaseData> EncounterCostInfoQueryTestCases()
|
||||
{
|
||||
yield return new TestCaseData(true, "").SetName("{m} {p}");
|
||||
yield return new TestCaseData(false, "").SetName("{m} {p}");
|
||||
yield return new TestCaseData(true, "DepartmentRollup1ID").SetName("{m} {p}");
|
||||
yield return new TestCaseData(false, "DepartmentRollup1ID").SetName("{m} {p}");
|
||||
yield return new TestCaseData(true, "Location").SetName("{m} {p}");
|
||||
yield return new TestCaseData(false, "Location").SetName("{m} {p}");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
using Moq;
|
||||
using Strata.DecisionSupport.Biz.Encounters;
|
||||
using Strata.DecisionSupport.Biz.Parameters;
|
||||
using Strata.DecisionSupport.Biz.Services;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using VerifyNUnit;
|
||||
|
||||
namespace Strata.DecisionSupport.Biz.Test.Unit.Services
|
||||
{
|
||||
[TestFixture, Category("Unit"), Category("DSS")]
|
||||
public class EncounterInfoQueryTests : EncounterQueryServiceTests
|
||||
{
|
||||
[SetUp]
|
||||
public void Setup()
|
||||
{
|
||||
var encounterInfo = new List<SnowflakeEncounterInfo> {
|
||||
new SnowflakeEncounterInfo
|
||||
{
|
||||
EncounterId = 123456789,
|
||||
EncounterRecordNumber = "123456789"
|
||||
}
|
||||
}.AsEnumerable();
|
||||
Mock.Get(snowflakeDbContext)
|
||||
.Setup(x => x.QueryAsync<SnowflakeEncounterInfo>(It.IsAny<string>(), It.IsAny<string>(), It.IsAny<object>(), It.IsAny<TimeSpan>()))
|
||||
.Returns(() => Task.FromResult(encounterInfo));
|
||||
}
|
||||
|
||||
[TestCaseSource(nameof(EncounterInfoQueryTestCases))]
|
||||
public async Task EncounterInfoQueryTest(string globalId, params object[] args)
|
||||
{
|
||||
var query = globalId.EncounterInfoQuery(args);
|
||||
await Verifier.Verify(query, verifySettings)
|
||||
.UseFileName(TestContext.CurrentContext.TestName());
|
||||
}
|
||||
|
||||
public static IEnumerable<TestCaseData> EncounterInfoQueryTestCases()
|
||||
{
|
||||
yield return new TestCaseData("", Array.Empty<object>())
|
||||
.SetName("{m} with no args");
|
||||
yield return new TestCaseData("Location", Array.Empty<object>())
|
||||
.SetName("{m} Location with no args");
|
||||
yield return new TestCaseData("DepartmentRollup1Id", Array.Empty<object>())
|
||||
.SetName("{m} Department Rollup with no args");
|
||||
yield return new TestCaseData("", new[] {
|
||||
"PrimaryServiceLine",
|
||||
"INNER JOIN serviceLineTableName sl on sl.serviceLineIdAttribute = OBJ.serviceLineIdAttribute",
|
||||
"DepartmentRollup1Id",
|
||||
"OBJ.MSDRGCaseTypeFamilyID AS CaseTypeFamilyId\r\n\t,msdrg.CCMCCCategory",
|
||||
"INNER JOIN dss.dimMSDRG msdrg ON obj.ReportingDRGID = msdrg.MSDRGID \r\n AND ((msdrg.Type IN ('MED', 'SURG') AND ptr.Type = 'Inpatient')\r\n OR ptr.Type <> 'Inpatient')"})
|
||||
.SetName("{m} Entity");
|
||||
yield return new TestCaseData("Location", new[] {
|
||||
"PrimaryServiceLine",
|
||||
"INNER JOIN serviceLineTableName sl on sl.serviceLineIdAttribute = OBJ.serviceLineIdAttribute",
|
||||
"DepartmentRollup1Id",
|
||||
"OBJ.MSDRGCaseTypeFamilyID AS CaseTypeFamilyId\r\n\t,msdrg.CCMCCCategory",
|
||||
"INNER JOIN dss.dimMSDRG msdrg ON obj.ReportingDRGID = msdrg.MSDRGID\r\n AND ((msdrg.Type IN ('MED', 'SURG') AND ptr.Type = 'Inpatient')\r\n OR ptr.Type <> 'Inpatient')"})
|
||||
.SetName("{m} Location");
|
||||
yield return new TestCaseData("DepartmentRollup1Id", new[] {
|
||||
"PrimaryServiceLine",
|
||||
"INNER JOIN serviceLineTableName sl on sl.serviceLineIdAttribute = OBJ.serviceLineIdAttribute",
|
||||
"DepartmentRollup1Id",
|
||||
"OBJ.MSDRGCaseTypeFamilyID AS CaseTypeFamilyId\r\n\t,msdrg.CCMCCCategory",
|
||||
"INNER JOIN dss.dimMSDRG msdrg ON obj.ReportingDRGID = msdrg.MSDRGID\r\n AND ((msdrg.Type IN ('MED', 'SURG') AND ptr.Type = 'Inpatient')\r\n OR ptr.Type <> 'Inpatient')"})
|
||||
.SetName("{m} Department Rollup");
|
||||
|
||||
}
|
||||
[TestCaseSource(nameof(EncounterInfoQueryTestCases1))]
|
||||
public async Task RunEncounterInfoQueryTest(Models.Queries.CaseTypeCategory caseTypeCategory, Guid serviceLineGuid)
|
||||
{
|
||||
var queryInfo = new EncounterQueryInfo(caseTypeCategory, 210,
|
||||
new DateTime(2023, 1, 1), new DateTime(2024, 1, 1), "",
|
||||
serviceLineGuid, 24, new[] { 2 });
|
||||
var results = await service.RunEncounterInfoQuery(queryInfo, CancellationToken.None);
|
||||
await Verifier.Verify(results, verifySettings)
|
||||
.UseFileName(TestContext.CurrentContext.TestName());
|
||||
}
|
||||
|
||||
public static IEnumerable<TestCaseData> EncounterInfoQueryTestCases1()
|
||||
{
|
||||
yield return new TestCaseData(Models.Queries.CaseTypeCategory.MSDRG, serviceLineDimensionGuid)
|
||||
.SetName("RunEncounterInfoQuery Msdrg ServiceLine");
|
||||
yield return new TestCaseData(Models.Queries.CaseTypeCategory.APRDRG, serviceLineDimensionGuid)
|
||||
.SetName("RunEncounterInfoQuery Aprdrg ServiceLine");
|
||||
yield return new TestCaseData(Models.Queries.CaseTypeCategory.CPTCode, serviceLineDimensionGuid)
|
||||
.SetName("RunEncounterInfoQuery CptCode ServiceLine");
|
||||
yield return new TestCaseData(Models.Queries.CaseTypeCategory.PatientPopulation, serviceLineDimensionGuid)
|
||||
.SetName("RunEncounterInfoQuery PatientPop ServiceLine");
|
||||
|
||||
yield return new TestCaseData(Models.Queries.CaseTypeCategory.MSDRG, sg2DimensionGuid)
|
||||
.SetName("RunEncounterInfoQuery Msdrg Sg2");
|
||||
yield return new TestCaseData(Models.Queries.CaseTypeCategory.APRDRG, sg2DimensionGuid)
|
||||
.SetName("RunEncounterInfoQuery Aprdrg Sg2");
|
||||
yield return new TestCaseData(Models.Queries.CaseTypeCategory.CPTCode, sg2DimensionGuid)
|
||||
.SetName("RunEncounterInfoQuery CptCode Sg2");
|
||||
yield return new TestCaseData(Models.Queries.CaseTypeCategory.PatientPopulation, sg2DimensionGuid)
|
||||
.SetName("RunEncounterInfoQuery PatientPop Sg2");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,122 @@
|
||||
using Moq;
|
||||
using Strata.CoreLib.Claims;
|
||||
using Strata.DecisionSupport.Biz.Services;
|
||||
using Strata.DecisionSupport.Biz.Snowflake;
|
||||
using Strata.Schema.Client;
|
||||
using Strata.Schema.Client.Dtos;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Security.Claims;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using VerifyTests;
|
||||
|
||||
namespace Strata.DecisionSupport.Biz.Test.Unit.Services
|
||||
{
|
||||
[TestFixture, Category("Unit"), Category("DSS")]
|
||||
public class EncounterQueryServiceTests
|
||||
{
|
||||
public VerifySettings verifySettings;
|
||||
|
||||
public EncounterQueryService service { get; set; }
|
||||
public ISnowflakeDatabaseContext snowflakeDbContext { get; set; }
|
||||
public ISchemaServiceClient schemaServiceClient { get; set; }
|
||||
public IClaimsPrincipalAccessor claimsPrincipalAccessor { get; set; }
|
||||
|
||||
internal static Guid configurationGuid { get; set; } = Guid.NewGuid();
|
||||
internal static Guid serviceLineDimensionGuid { get; set; } = Guid.NewGuid();
|
||||
internal static Guid sg2DimensionGuid { get; set; } = Guid.NewGuid();
|
||||
internal static Guid defaultKeyGuid { get; set; } = Guid.NewGuid();
|
||||
internal static Guid defaultLookupKeyGuid { get; set; } = Guid.NewGuid();
|
||||
|
||||
public const string UserGuid = "eb7e4993-c65a-493a-9614-986a55dd0744";
|
||||
public const string DbGuid = "54409f55-5ddf-4748-8222-9ccfb04fb4f5";
|
||||
public const string ClientDbGuid = "1742934B-C508-402B-B8B5-D18C506474CB";
|
||||
public const string Username = "a";
|
||||
public const string Key = UserGuid + Username;
|
||||
public const string DbVersion = "202133";
|
||||
|
||||
[OneTimeSetUp]
|
||||
public void Setup()
|
||||
{
|
||||
verifySettings = TestExtensions.TestSettings();
|
||||
snowflakeDbContext = Mock.Of<ISnowflakeDatabaseContext>();
|
||||
|
||||
var scoreDimension = new ScoreDimensionDto
|
||||
{
|
||||
DimensionGuid = serviceLineDimensionGuid,
|
||||
DefaultKeyGuid = defaultKeyGuid,
|
||||
DefaultLookupKeyGuid = defaultLookupKeyGuid,
|
||||
FriendlyName = "ServiceLine",
|
||||
SourceTableSchema = "fw",
|
||||
SourceTableName = "serviceLine",
|
||||
Attributes = new List<ScoreAttributeDto>
|
||||
{
|
||||
new ScoreAttributeDto
|
||||
{
|
||||
AttributeGuid = defaultKeyGuid,
|
||||
SqlColumnName = "Name"
|
||||
},
|
||||
new ScoreAttributeDto
|
||||
{
|
||||
AttributeGuid = defaultLookupKeyGuid,
|
||||
SqlColumnName = "Name"
|
||||
}
|
||||
}
|
||||
};
|
||||
var sg2Dimension = new ScoreDimensionDto
|
||||
{
|
||||
DimensionGuid = serviceLineDimensionGuid,
|
||||
DefaultKeyGuid = defaultKeyGuid,
|
||||
DefaultLookupKeyGuid = defaultLookupKeyGuid,
|
||||
FriendlyName = "Sg2 Service Line Crosswalk",
|
||||
SourceTableSchema = "fw",
|
||||
SourceTableName = "serviceLine",
|
||||
Attributes = new List<ScoreAttributeDto>
|
||||
{
|
||||
new ScoreAttributeDto
|
||||
{
|
||||
AttributeGuid = defaultKeyGuid,
|
||||
SqlColumnName = "Name"
|
||||
},
|
||||
new ScoreAttributeDto
|
||||
{
|
||||
AttributeGuid = defaultLookupKeyGuid,
|
||||
SqlColumnName = "Name"
|
||||
}
|
||||
}
|
||||
};
|
||||
schemaServiceClient = Mock.Of<ISchemaServiceClient>();
|
||||
Mock.Get(schemaServiceClient)
|
||||
.Setup(x => x.GetGMDimensionAsync(It.IsAny<Guid>(), It.IsAny<CancellationToken>()))
|
||||
.Returns<Guid, CancellationToken>((dimensionGuid, token) =>
|
||||
dimensionGuid.Equals(serviceLineDimensionGuid)
|
||||
? Task.FromResult(scoreDimension)
|
||||
: Task.FromResult(sg2Dimension));
|
||||
|
||||
claimsPrincipalAccessor = Mock.Of<IClaimsPrincipalAccessor>();
|
||||
var claims = new List<Claim>
|
||||
{
|
||||
new Claim(ClaimTypes.Name, "Name"),
|
||||
new Claim(StrataClaims.UserGuid, UserGuid),
|
||||
new Claim(StrataClaims.Username, Username),
|
||||
new Claim("given_name", "Firstname"),
|
||||
new Claim("family_name", "Lastname"),
|
||||
new Claim(StrataClaims.FirstName, "Firstname"),
|
||||
new Claim(StrataClaims.LastName, "Lastname"),
|
||||
new Claim(StrataClaims.DatabaseVersion, DbVersion),
|
||||
new Claim(StrataClaims.DatabaseGuid, ClientDbGuid),
|
||||
new Claim(StrataClaims.IsSdtEmployee,true.ToString())
|
||||
};
|
||||
var claimIdentity = new ClaimsIdentity(claims, "mock");
|
||||
var claimsPrincipal = new ClaimsPrincipal(new[] { claimIdentity });
|
||||
|
||||
Mock.Get(claimsPrincipalAccessor)
|
||||
.Setup(x => x.GetCurrentClaimsPrincipal())
|
||||
.Returns(claimsPrincipal);
|
||||
|
||||
service = new EncounterQueryService(snowflakeDbContext, schemaServiceClient);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
using Strata.DecisionSupport.Biz.Services;
|
||||
using System.Threading.Tasks;
|
||||
using VerifyNUnit;
|
||||
|
||||
namespace Strata.DecisionSupport.Biz.Test.Unit.Services
|
||||
{
|
||||
[TestFixture, Category("Unit"), Category("DSS")]
|
||||
public class EncounterUnitOfServiceQueryTests : EncounterQueryServiceTests
|
||||
{
|
||||
[Test]
|
||||
public async Task EncounterUnitOfServiceQueryTest()
|
||||
{
|
||||
var query = EncounterQueries.EncounterUnitOfServiceQuery();
|
||||
await Verifier.Verify(query, verifySettings)
|
||||
.UseFileName(TestContext.CurrentContext.TestName());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
using Strata.DecisionSupport.Biz.Services;
|
||||
using System.Threading.Tasks;
|
||||
using VerifyNUnit;
|
||||
|
||||
namespace Strata.DecisionSupport.Biz.Test.Unit.Services
|
||||
{
|
||||
[TestFixture, Category("Unit"), Category("DSS")]
|
||||
public class LOSOpportunityInfoQueryTests : EncounterQueryServiceTests
|
||||
{
|
||||
[Test]
|
||||
public async Task LOSOpportunityInfoQueryTest()
|
||||
{
|
||||
var query = EncounterQueries.LOSOpportunityInfoQuery();
|
||||
await Verifier.Verify(query, verifySettings)
|
||||
.UseFileName(TestContext.CurrentContext.TestName());
|
||||
}
|
||||
}
|
||||
}
|
||||
+61
@@ -0,0 +1,61 @@
|
||||
using Strata.DecisionSupport.Biz.Parameters;
|
||||
using Strata.DecisionSupport.Biz.Services;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using VerifyNUnit;
|
||||
|
||||
namespace Strata.DecisionSupport.Biz.Test.Unit.Services
|
||||
{
|
||||
[TestFixture, Category("Unit"), Category("DSS")]
|
||||
public class VariationEncounterChargeQueryTests : EncounterQueryServiceTests
|
||||
{
|
||||
|
||||
[TestCaseSource(nameof(VariationEncounterChargeQueryTestCaseDetails))]
|
||||
public async Task VariationEncounterChargeQueryTest(bool hasManufacturerClientDSS, bool isManufacturerInferred,
|
||||
bool hasSupplyClientDSS, bool isSupplyInferred, bool isUsingCustomEntityDimension,
|
||||
bool hasChargeCodeIds)
|
||||
{
|
||||
var queryInfo = new VariationEncounterChargeQueryInfo(hasManufacturerClientDSS, isManufacturerInferred,
|
||||
hasSupplyClientDSS, isSupplyInferred, isUsingCustomEntityDimension, true,
|
||||
new Guid[] { },
|
||||
hasChargeCodeIds ? new int[] { 1, 2 } : new int[] { },
|
||||
1, 1000);
|
||||
var query = EncounterQueries.VariationEncounterChargeQuery(queryInfo.First, queryInfo.Rows, queryInfo.Args());
|
||||
await Verifier.Verify(query, verifySettings)
|
||||
.UseFileName(TestContext.CurrentContext.TestName());
|
||||
}
|
||||
|
||||
public static IEnumerable<TestCaseData> VariationEncounterChargeQueryTestCaseDetails()
|
||||
{
|
||||
yield return new TestCaseData(true, true, true, true, true, true).SetName("{m} (1)");
|
||||
yield return new TestCaseData(false, false, true, true, true, true).SetName("{m} (2)");
|
||||
yield return new TestCaseData(true, true, false, false, true, true).SetName("{m} (3)");
|
||||
yield return new TestCaseData(false, false, false, false, true, false).SetName("{m} (4)");
|
||||
}
|
||||
|
||||
[TestCaseSource(nameof(VariationEncounterChargeQueryTestCases))]
|
||||
public async Task VariationEncounterChargeQueryTestFromCases(VariationEncounterChargeQueryInfo queryInfo)
|
||||
{
|
||||
var query = EncounterQueries.VariationEncounterChargeQuery(queryInfo.First, queryInfo.Rows, queryInfo.Args());
|
||||
await Verifier.Verify(query, verifySettings)
|
||||
.UseFileName(TestContext.CurrentContext.TestName());
|
||||
}
|
||||
|
||||
public static IEnumerable<TestCaseData> VariationEncounterChargeQueryTestCases()
|
||||
{
|
||||
yield return new TestCaseData(new VariationEncounterChargeQueryInfo(true, true, true, true, true, true,
|
||||
new Guid[] { }, new int[] { },
|
||||
1, 1000)).SetName("{m} (1)");
|
||||
yield return new TestCaseData(new VariationEncounterChargeQueryInfo(false, false, false, false, false, false,
|
||||
new Guid[] { }, new int[] { 1, 2 },
|
||||
1, 1000)).SetName("{m} (2)");
|
||||
yield return new TestCaseData(new VariationEncounterChargeQueryInfo(true, true, true, true, true, true,
|
||||
new Guid[] { }, new int[] { },
|
||||
1, 1000)).SetName("{m} (3)");
|
||||
yield return new TestCaseData(new VariationEncounterChargeQueryInfo(false, false, false, false, false, false,
|
||||
new Guid[] { }, new int[] { 1, 2 },
|
||||
1, 1000)).SetName("{m} (4)");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,185 @@
|
||||
using Strata.DecisionSupport.Biz.Encounters;
|
||||
using Strata.DecisionSupport.Biz.Parameters;
|
||||
using Strata.DecisionSupport.Biz.Services;
|
||||
using Strata.DecisionSupport.Models.Encounters;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
namespace Strata.DecisionSupport.Biz.Test.Unit
|
||||
{
|
||||
public static class SnowflakeTestCases
|
||||
{
|
||||
public static string LineReader(this string query)
|
||||
=> string.Join("", query.Split(Environment.NewLine)
|
||||
.Select((l, i) => $"{i:G}".PadLeft(3, ' ') + ": " + l + Environment.NewLine));
|
||||
|
||||
public static string Query<T>(T queryInfo) where T : class
|
||||
{
|
||||
var args = queryInfo is IWithArgs hasArgs ? hasArgs.Args() : [];
|
||||
var globalId = queryInfo is IWithGlobalId hasGlobalId ? hasGlobalId.GlobalId() : "";
|
||||
var patientSpecific = queryInfo is IWithPatientSpecific hasPatientSpecific ? hasPatientSpecific.PatientSpecific() : false;
|
||||
var first = 0; var rows = 1000;
|
||||
if (queryInfo is EncounterQueryInfo encounterQueryInfo)
|
||||
{
|
||||
args = encounterQueryInfo.Args("sl.serviceLineid", "INNER JOIN fw.DimServiceLine sl on sl.ServiceLineId = OBJ.ServiceLineId");
|
||||
}
|
||||
else if (queryInfo is EncounterChargeQueryInfo encounterChargeQueryInfo)
|
||||
{
|
||||
first = encounterChargeQueryInfo.First;
|
||||
rows = encounterChargeQueryInfo.Rows;
|
||||
}
|
||||
else if (queryInfo is VariationEncounterChargeQueryInfo variationEncounterChargeQueryInfo)
|
||||
{
|
||||
first = variationEncounterChargeQueryInfo.First;
|
||||
rows = variationEncounterChargeQueryInfo.Rows;
|
||||
}
|
||||
return typeof(T).Name switch
|
||||
{
|
||||
nameof(AllChargeQueryInfo) => EncounterQueries.AllChargeInfoQuery(args),
|
||||
nameof(ChargeQueryInfo) => EncounterQueries.ChargeInfoQuery(args),
|
||||
nameof(DepartmentEncounterUnitOfServiceQueryInfo) => EncounterQueries.DepartmentEncounterUnitOfServiceQuery(globalId, args),
|
||||
nameof(EncounterChargeQueryInfo) => EncounterQueries.EncounterChargeQuery(first, rows, args),
|
||||
nameof(EncounterCostQueryInfo) => EncounterQueries.EncounterCostInfoQuery(globalId, patientSpecific, args),
|
||||
nameof(EncounterQueryInfo) => EncounterQueries.EncounterInfoQuery(globalId, args),
|
||||
nameof(EncounterUnitOfServiceQueryInfo) => EncounterQueries.EncounterUnitOfServiceQuery(args),
|
||||
nameof(LOSOpportunityQueryInfo) => EncounterQueries.LOSOpportunityInfoQuery(args),
|
||||
nameof(VariationEncounterChargeQueryInfo) => EncounterQueries.VariationEncounterChargeQuery(first, rows, args),
|
||||
_ => $""
|
||||
};
|
||||
}
|
||||
|
||||
//Revisit these test cases for department rollups
|
||||
//If we're validating the query text there shouldn't be any string manipulation in here
|
||||
public static IEnumerable<TestCaseData> TestCases()
|
||||
{
|
||||
var assembly = AppDomain.CurrentDomain.GetAssemblies()
|
||||
.SingleOrDefault(a => a.GetName().Name.Equals("Strata.DecisionSupport.Biz", StringComparison.OrdinalIgnoreCase));
|
||||
var thisAssembly = Assembly.GetExecutingAssembly();
|
||||
var resourceNames = assembly.GetManifestResourceNames()
|
||||
.Where(r => r.EndsWith(".sql")).ToList();
|
||||
var testCases = assembly.GetManifestResourceNames()
|
||||
.Where(r => r.EndsWith(".json")).ToList();
|
||||
|
||||
foreach (var resource in resourceNames)
|
||||
{
|
||||
var name = resource.Split('.').TakeLast(2).First();
|
||||
var globalId = string.Empty;
|
||||
var testName = "{c}" + name;
|
||||
switch (name)
|
||||
{
|
||||
case "Billing":
|
||||
case "WithEncounterUnitOfServiceQuery":
|
||||
break;
|
||||
case "AllChargeInfoQuery":
|
||||
yield return new TestCaseData(new AllChargeInfo(), new AllChargeQueryInfo(
|
||||
Guid.NewGuid(),
|
||||
[1, 2]
|
||||
), null).SetName(testName);
|
||||
break;
|
||||
case "ChargeInfoQuery":
|
||||
yield return new TestCaseData(new ChargeInfo(), new ChargeQueryInfo(
|
||||
Guid.NewGuid(),
|
||||
2,
|
||||
[1, 2],
|
||||
Guid.NewGuid()
|
||||
), new Func<IEnumerable<ChargeInfo>, IEnumerable<ChargeInfo>>(x => x.OrderBy(y => y.ChargeCodeId)
|
||||
)).SetName(testName);
|
||||
break;
|
||||
case "DepartmentEncounterUnitOfServiceDepartmentRollupQuery":
|
||||
break;
|
||||
case "DepartmentEncounterUnitOfServiceEntityQuery":
|
||||
case "DepartmentEncounterUnitOfServiceLocationQuery":
|
||||
globalId = Regex.Replace(name, ".*UnitOfService(.*)Query", "$1")
|
||||
.Replace("DepartmentRollup", "DepartmentRollup1")
|
||||
.Replace("Entity", "");
|
||||
yield return new TestCaseData(new DepartmentEncounterUnitOfService(), new DepartmentEncounterUnitOfServiceQueryInfo
|
||||
(
|
||||
globalId,
|
||||
24,
|
||||
[2L]
|
||||
), null).SetName(testName);
|
||||
break;
|
||||
case "EncounterChargeQuery":
|
||||
yield return new TestCaseData(new EncounterChargeInfo(), new EncounterChargeQueryInfo(
|
||||
false, false,
|
||||
false, false,
|
||||
false, true,
|
||||
Guid.NewGuid(), [1]), null)
|
||||
.SetName(testName);
|
||||
yield return new TestCaseData(new EncounterChargeInfo(), new EncounterChargeQueryInfo(
|
||||
true, false,
|
||||
true, false,
|
||||
true, true,
|
||||
Guid.NewGuid(), [1]), null)
|
||||
.SetName($"{testName} hasManufacturer hasSupply usingCustomDimension");
|
||||
yield return new TestCaseData(new EncounterChargeInfo(), new EncounterChargeQueryInfo(
|
||||
true, true,
|
||||
true, true,
|
||||
true, true,
|
||||
Guid.NewGuid(), [1]), null)
|
||||
.SetName($"{testName} hasManufacturer Inferred hasSupply Inferred usingCustomDimension")
|
||||
.Ignore("Temporarily ignored: investigate manufacturer/supply table logic. This test always fails due to table not found.");
|
||||
break;
|
||||
case "EncounterInfoDepartmentRollupQuery":
|
||||
break;
|
||||
case "EncounterInfoEntityQuery":
|
||||
case "EncounterInfoLocationQuery":
|
||||
globalId = Regex.Replace(name, ".*Info(.*)Query", "$1")
|
||||
.Replace("DepartmentRollup", "DepartmentRollup1")
|
||||
.Replace("Entity", "");
|
||||
var skipCaseTypeCategories = new Models.Queries.CaseTypeCategory[] { Models.Queries.CaseTypeCategory.ExplorationPopulation };
|
||||
foreach (var caseType in Enum.GetValues<Models.Queries.CaseTypeCategory>().Where(x => !skipCaseTypeCategories.Contains(x)))
|
||||
{
|
||||
yield return new TestCaseData(new EncounterInfo(), new EncounterQueryInfo(caseType, 1,
|
||||
new DateTime(2023, 1, 1), new DateTime(2024, 1, 1), globalId, Guid.NewGuid(), 24, [1]), null)
|
||||
.SetName($"{testName} {Enum.GetName(caseType).ToLower()}");
|
||||
}
|
||||
break;
|
||||
case "EncounterSpecificCostInfoDepartmentRollupQuery":
|
||||
case "EncounterStaticCostInfoDepartmentRollupQuery":
|
||||
break;
|
||||
case "EncounterSpecificCostInfoEntityQuery":
|
||||
case "EncounterSpecificCostInfoLocationQuery":
|
||||
case "EncounterStaticCostInfoEntityQuery":
|
||||
case "EncounterStaticCostInfoLocationQuery":
|
||||
var isPatientSpecific = name.Contains("Specific");
|
||||
globalId = Regex.Replace(name, ".*CostInfo(.*)Query", "$1")
|
||||
.Replace("DepartmentRollup", "DepartmentRollup1")
|
||||
.Replace("Entity", "");
|
||||
yield return new TestCaseData(new EncounterCostInfo(), new EncounterCostQueryInfo(isPatientSpecific, Guid.NewGuid(), string.Empty, globalId, [1L]), null)
|
||||
.SetName(testName);
|
||||
break;
|
||||
case "EncounterUnitOfServiceQuery":
|
||||
yield return new TestCaseData(new EncounterUnitOfService(), new EncounterUnitOfServiceQueryInfo(24, [1L, 2L]), null)
|
||||
.SetName(testName);
|
||||
break;
|
||||
case "LOSOpportunityInfoQuery":
|
||||
yield return new TestCaseData(new LOSOpportunityInfo(), new LOSOpportunityQueryInfo(Guid.NewGuid(), 24, 2), null)
|
||||
.SetName(testName);
|
||||
break;
|
||||
case "VariationEncounterChargeQuery":
|
||||
yield return new TestCaseData(new VariationEncounterChargeInfo(), new VariationEncounterChargeQueryInfo(false, false,
|
||||
false, false,
|
||||
false, true, [Guid.NewGuid(), Guid.NewGuid()], [1, 2], 1, 1000), null)
|
||||
.SetName(testName);
|
||||
yield return new TestCaseData(new VariationEncounterChargeInfo(), new VariationEncounterChargeQueryInfo(true, false,
|
||||
true, false,
|
||||
true, true, [Guid.NewGuid(), Guid.NewGuid()], [1, 2], 1, 1000), null)
|
||||
.SetName($"{testName} hasManufacturer hasSupply usingCustomDimension");
|
||||
yield return new TestCaseData(new VariationEncounterChargeInfo(), new VariationEncounterChargeQueryInfo(true, true,
|
||||
true, true,
|
||||
true, true, [Guid.NewGuid(), Guid.NewGuid()], [1, 2], 1, 1000), null)
|
||||
.SetName($"{testName} hasManufacturer Inferred hasSupply Inferred usingCustomDimension")
|
||||
.Ignore("Temporarily ignored: investigate manufacturer/supply table logic. This test always fails due to table not found."); ;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
+36
@@ -0,0 +1,36 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<IsTestProject>true</IsTestProject>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="coverlet.msbuild" Version="6.0.2">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
|
||||
<PackageReference Include="Moq" Version="4.20.72" />
|
||||
<PackageReference Include="NUnit" Version="4.3.2" />
|
||||
<PackageReference Include="NUnit.Analyzers" Version="4.7.0">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="NUnit3TestAdapter" Version="5.0.0" />
|
||||
<PackageReference Include="Verify.NUnit" Version="29.3.1" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Using Include="NUnit.Framework" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="FluentAssertions" Version="6.12.1" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\src\Strata.DecisionSupport.Biz\Strata.DecisionSupport.Biz.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
@@ -0,0 +1,48 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Text.RegularExpressions;
|
||||
using VerifyTests;
|
||||
|
||||
namespace Strata.DecisionSupport.Biz.Test.Unit
|
||||
{
|
||||
public static class TestExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// The test name
|
||||
/// </summary>
|
||||
/// <param name="context"></param>
|
||||
/// <returns>
|
||||
/// The name of the test split by camel case for a max length of 200 characters.
|
||||
/// </returns>
|
||||
public static string TestName(this TestContext context)
|
||||
{
|
||||
var regexSpecial = new Regex($"[{Regex.Escape(new string(Path.GetInvalidFileNameChars()) + "<>")}]");
|
||||
var testName = regexSpecial.Replace(context.Test.Name, "").SplitCamelCase();
|
||||
testName = testName[..Math.Min(200, testName.Length)];
|
||||
return testName;
|
||||
}
|
||||
|
||||
public static string SplitCamelCase(this string input)
|
||||
{
|
||||
if (string.IsNullOrEmpty(input)) { return input; }
|
||||
|
||||
const string pattern = "([a-z](?=[A-Z])|[A-Z](?=[A-Z][a-r + t-z])|[A-Z](?=[A-Z][s][a-z]))";
|
||||
|
||||
if (input.StartsWith("FY", StringComparison.Ordinal))
|
||||
{ // hack for FY2012, etc
|
||||
return "FY " + Regex.Replace(input.Remove(0, 2), pattern, "$1 ");
|
||||
}
|
||||
input = Regex.Replace(input, @"\{|\}|:|,|\)|\(", "", RegexOptions.Singleline | RegexOptions.IgnoreCase);
|
||||
return Regex.Replace(input, pattern, "$1 ");
|
||||
}
|
||||
|
||||
public static VerifySettings TestSettings()
|
||||
{
|
||||
var settings = new VerifySettings();
|
||||
settings.UseDirectory("snapshots");
|
||||
settings.ScrubInlineGuids();
|
||||
return settings;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
using Strata.DecisionSupport.Biz.Parameters;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text.Json;
|
||||
using System.Threading.Tasks;
|
||||
using VerifyNUnit;
|
||||
using VerifyTests;
|
||||
|
||||
namespace Strata.DecisionSupport.Biz.Test.Unit
|
||||
{
|
||||
[ExcludeFromCodeCoverage]
|
||||
[SetUpFixture]
|
||||
public class UnitTestBase
|
||||
{
|
||||
protected VerifySettings verifySettings;
|
||||
|
||||
[OneTimeSetUp]
|
||||
public void Setup()
|
||||
{
|
||||
verifySettings = TestExtensions.TestSettings();
|
||||
}
|
||||
protected virtual async Task VerifyQuery<T>(T queryInfo)
|
||||
where T : class
|
||||
{
|
||||
var query = Query(queryInfo);
|
||||
await Verifier.Verify(query, verifySettings)
|
||||
.UseDirectory("snapshotQueries")
|
||||
.UseFileName(TestContext.CurrentContext.TestName());
|
||||
}
|
||||
|
||||
protected virtual async Task VerifyDictionary<T>(T queryInfo) where T : class
|
||||
{
|
||||
if (!(queryInfo is IWithDictionary withDictionary)) { return; }
|
||||
var dictionary = withDictionary.Dictionary();
|
||||
await Verifier.Verify(JsonSerializer.Serialize(dictionary), verifySettings)
|
||||
.UseDirectory("snapshotDictionary")
|
||||
.UseFileName(TestContext.CurrentContext.TestName());
|
||||
}
|
||||
|
||||
protected virtual async Task VerifyParameters<T>(T queryInfo) where T : class
|
||||
{
|
||||
if (!(queryInfo is IWithParameters withParameters)) { return; }
|
||||
var parameters = withParameters.Parameters();
|
||||
string json = JsonSerializer.Serialize(parameters);
|
||||
await Verifier.Verify(json, verifySettings)
|
||||
.UseDirectory("snapshotParameters")
|
||||
.UseFileName(TestContext.CurrentContext.TestName());
|
||||
}
|
||||
|
||||
protected virtual async Task VerifyArgs<T>(T queryInfo) where T : class
|
||||
{
|
||||
if (!(queryInfo is IWithArgs withArgs)) { return; }
|
||||
var args = withArgs.Args();
|
||||
await Verifier.Verify(args, verifySettings)
|
||||
.UseDirectory("snapshotArgs")
|
||||
.UseFileName(TestContext.CurrentContext.TestName());
|
||||
}
|
||||
|
||||
protected virtual string Query<T>(T queryInfo)
|
||||
where T : class => "";
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
using Strata.DecisionSupport.Biz.Parameters;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Strata.DecisionSupport.Biz.Test.Unit.UnitTests
|
||||
{
|
||||
public class GenericQueryInfo : IQueryInfo
|
||||
{
|
||||
public string Name { get; set; }
|
||||
|
||||
public GenericQueryInfo(string name)
|
||||
{
|
||||
Name = name;
|
||||
}
|
||||
|
||||
public Dictionary<string, object> Dictionary() => new Dictionary<string, object>
|
||||
{
|
||||
{ "name", Name }
|
||||
};
|
||||
|
||||
public dynamic Parameters() => new
|
||||
{
|
||||
Name
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Strata.DecisionSupport.Biz.Test.Unit.UnitTests
|
||||
{
|
||||
[ExcludeFromCodeCoverage]
|
||||
[TestFixture, Category("Unit"), Category("DSS")]
|
||||
public class TestSqlQueries : UnitTestBase
|
||||
{
|
||||
[TestCaseSource(typeof(SnowflakeTestCases), nameof(SnowflakeTestCases.TestCases))]
|
||||
public async Task VerifyQuery<TI, T>(TI obj, T queryInfo, Func<IEnumerable<TI>, IEnumerable<TI>> orderby) where T : class
|
||||
=> await base.VerifyQuery(queryInfo);
|
||||
|
||||
[TestCaseSource(typeof(SnowflakeTestCases), nameof(SnowflakeTestCases.TestCases))]
|
||||
public async Task VerifyDictionary<TI, T>(TI obj, T queryInfo, Func<IEnumerable<TI>, IEnumerable<TI>> orderby) where T : class
|
||||
=> await base.VerifyDictionary(queryInfo);
|
||||
|
||||
[TestCaseSource(typeof(SnowflakeTestCases), nameof(SnowflakeTestCases.TestCases))]
|
||||
public async Task VerifyParameters<TI, T>(TI obj, T queryInfo, Func<IEnumerable<TI>, IEnumerable<TI>> orderby) where T : class
|
||||
=> await base.VerifyParameters(queryInfo);
|
||||
|
||||
[TestCaseSource(typeof(SnowflakeTestCases), nameof(SnowflakeTestCases.TestCases))]
|
||||
public async Task VerifyArgs<TI, T>(TI obj, T queryInfo, Func<IEnumerable<TI>, IEnumerable<TI>> orderby) where T : class
|
||||
=> await base.VerifyArgs(queryInfo);
|
||||
|
||||
protected override string Query<T>(T queryInfo) where T : class
|
||||
=> SnowflakeTestCases.Query(queryInfo);
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user