Skip to content

Commit

Permalink
comment
Browse files Browse the repository at this point in the history
  • Loading branch information
Paahn committed Jan 6, 2025
1 parent 37acfd0 commit bc77fff
Showing 1 changed file with 65 additions and 65 deletions.
130 changes: 65 additions & 65 deletions backend/services.plr-intake.tests/Features/Intake/IntakeService.cs
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);
// }
// }

0 comments on commit bc77fff

Please sign in to comment.