-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
65 additions
and
65 deletions.
There are no files selected for viewing
130 changes: 65 additions & 65 deletions
130
backend/services.plr-intake.tests/Features/Intake/IntakeService.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,76 +1,76 @@ | ||
namespace PlrIntakeTests.Features.Intake; | ||
// namespace PlrIntakeTests.Features.Intake; | ||
|
||
using PlrIntake.Features.Intake; | ||
using PlrIntake.Models; | ||
using PlrIntakeTests.TestingExtensions; | ||
using Xunit; | ||
// using PlrIntake.Features.Intake; | ||
// using PlrIntake.Models; | ||
// using PlrIntakeTests.TestingExtensions; | ||
// using Xunit; | ||
|
||
|
||
public class IntakeServiceTests : InMemoryDbTest | ||
{ | ||
[Fact] | ||
public async Task CreateOrUpdateRecordAsync_RecordDoesNotExist_AddsRecord() | ||
{ | ||
// Arrange | ||
var cpn = "CPN"; | ||
var record = new PlrRecord | ||
{ | ||
Ipc = "IPC1", | ||
Cpn = cpn, | ||
IdentifierType = "CPSID", | ||
CollegeId = "12345", | ||
ProviderRoleType = "ProviderRoleType", | ||
StatusCode = "StatusCode", | ||
StatusStartDate = DateTime.Today, | ||
StatusReasonCode = "StatusReasonCode" | ||
}; | ||
// public class IntakeServiceTests : InMemoryDbTest | ||
// { | ||
// [Fact] | ||
// public async Task CreateOrUpdateRecordAsync_RecordDoesNotExist_AddsRecord() | ||
// { | ||
// // Arrange | ||
// var cpn = "CPN"; | ||
// var record = new PlrRecord | ||
// { | ||
// Ipc = "IPC1", | ||
// Cpn = cpn, | ||
// IdentifierType = "CPSID", | ||
// CollegeId = "12345", | ||
// ProviderRoleType = "ProviderRoleType", | ||
// StatusCode = "StatusCode", | ||
// StatusStartDate = DateTime.Today, | ||
// StatusReasonCode = "StatusReasonCode" | ||
// }; | ||
|
||
var service = this.MockDependenciesFor<IntakeService>(); | ||
// var service = this.MockDependenciesFor<IntakeService>(); | ||
|
||
// Act | ||
var result = await service.CreateOrUpdateRecordAsync(record, false); | ||
// // Act | ||
// var result = await service.CreateOrUpdateRecordAsync(record, false); | ||
|
||
// Assert | ||
Assert.Equal(record.Id, result); | ||
Assert.Single(this.TestDb.StatusChageLogs | ||
.Where(log => log.PlrRecordId == record.Id && log.ShouldBeProcessed)); | ||
} | ||
// // Assert | ||
// Assert.Equal(record.Id, result); | ||
// Assert.Single(this.TestDb.StatusChageLogs | ||
// .Where(log => log.PlrRecordId == record.Id && log.ShouldBeProcessed)); | ||
// } | ||
|
||
[Fact] | ||
public async Task CreateOrUpdateRecordAsync_RecordExists_UpdatesRecord() | ||
{ | ||
// Arrange | ||
var cpn = "CPN"; | ||
var record = this.TestDb.Has(new PlrRecord | ||
{ | ||
Ipc = "IPC1", | ||
Cpn = cpn, | ||
IdentifierType = "CPSID", | ||
CollegeId = "12345", | ||
ProviderRoleType = "ProviderRoleType", | ||
StatusCode = "StatusCode", | ||
StatusStartDate = DateTime.Today - TimeSpan.FromDays(7), | ||
StatusReasonCode = "StatusReasonCode" | ||
}); | ||
// [Fact] | ||
// public async Task CreateOrUpdateRecordAsync_RecordExists_UpdatesRecord() | ||
// { | ||
// // Arrange | ||
// var cpn = "CPN"; | ||
// var record = this.TestDb.Has(new PlrRecord | ||
// { | ||
// Ipc = "IPC1", | ||
// Cpn = cpn, | ||
// IdentifierType = "CPSID", | ||
// CollegeId = "12345", | ||
// ProviderRoleType = "ProviderRoleType", | ||
// StatusCode = "StatusCode", | ||
// StatusStartDate = DateTime.Today - TimeSpan.FromDays(7), | ||
// StatusReasonCode = "StatusReasonCode" | ||
// }); | ||
|
||
var newRecord = new PlrRecord | ||
{ | ||
Ipc = "IPC1", | ||
Cpn = cpn, | ||
IdentifierType = "CPSID", | ||
CollegeId = "12345", | ||
ProviderRoleType = "ProviderRoleType", | ||
StatusCode = "BadStatusCode", | ||
StatusStartDate = DateTime.Today, | ||
StatusReasonCode = "BadStatusReasonCode" | ||
}; | ||
// var newRecord = new PlrRecord | ||
// { | ||
// Ipc = "IPC1", | ||
// Cpn = cpn, | ||
// IdentifierType = "CPSID", | ||
// CollegeId = "12345", | ||
// ProviderRoleType = "ProviderRoleType", | ||
// StatusCode = "BadStatusCode", | ||
// StatusStartDate = DateTime.Today, | ||
// StatusReasonCode = "BadStatusReasonCode" | ||
// }; | ||
|
||
var service = this.MockDependenciesFor<IntakeService>(); | ||
// var service = this.MockDependenciesFor<IntakeService>(); | ||
|
||
// Act | ||
var result = await service.CreateOrUpdateRecordAsync(newRecord, true); | ||
// // Act | ||
// var result = await service.CreateOrUpdateRecordAsync(newRecord, true); | ||
|
||
// Assert | ||
Assert.Equal(record.Id, result); | ||
} | ||
} | ||
// // Assert | ||
// Assert.Equal(record.Id, result); | ||
// } | ||
// } |