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)");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user