Skip to content

WIP: bulk person API #185

WIP: bulk person API

WIP: bulk person API #185

GitHub Actions / Core test results succeeded Aug 19, 2024 in 0s

202 passed, 0 failed and 0 skipped

Tests passed successfully

✅ TeachingRecordSystem/tests/TeachingRecordSystem.Core.Tests/TestResults/_fv-az881-524_2024-08-19_13_11_04.trx

202 tests were completed in 55s with 202 passed, 0 failed and 0 skipped.

Test suite Passed Failed Skipped Time
TeachingRecordSystem.Core.Tests.DataStore.Postgres.Models.MandatoryQualificationProviderTests 40✅ 12ms
TeachingRecordSystem.Core.Tests.EventInfoTests 2✅ 92ms
TeachingRecordSystem.Core.Tests.Events.Processing.PublishEventsBackgroundServiceTests 3✅ 73ms
TeachingRecordSystem.Core.Tests.Jobs.BatchSendEytsAwardedEmailsJobTests 8✅ 284ms
TeachingRecordSystem.Core.Tests.Jobs.BatchSendInductionCompletedEmailsJobTests 8✅ 476ms
TeachingRecordSystem.Core.Tests.Jobs.BatchSendInternationalQtsAwardedEmailsJobTests 8✅ 347ms
TeachingRecordSystem.Core.Tests.Jobs.BatchSendQtsAwardedEmailsJobTests 8✅ 287ms
TeachingRecordSystem.Core.Tests.Jobs.EytsAwardedEmailJobDispatcherTests 1✅ 22ms
TeachingRecordSystem.Core.Tests.Jobs.InductionCompletedEmailJobDispatcherTests 1✅ 32ms
TeachingRecordSystem.Core.Tests.Jobs.InternationalQtsAwardedEmailJobDispatcherTests 1✅ 23ms
TeachingRecordSystem.Core.Tests.Jobs.QtsAwardedEmailJobDispatcherTests 1✅ 16ms
TeachingRecordSystem.Core.Tests.Jobs.SendInductionCompletedEmailJobTests 1✅ 95ms
TeachingRecordSystem.Core.Tests.Jobs.SendInternationalQtsAwardedEmailJobTests 1✅ 58ms
TeachingRecordSystem.Core.Tests.Jobs.SendQtsAwardedEmailJobTests 1✅ 39ms
TeachingRecordSystem.Core.Tests.Services.Certificates.CertificateGeneratorTests 1✅ 736ms
TeachingRecordSystem.Core.Tests.Services.Establishments.Gias.EstablishmentRefresherTests 2✅ 935ms
TeachingRecordSystem.Core.Tests.Services.Establishments.Tps.TpsEstablishmentRefresherTests 10✅ 120ms
TeachingRecordSystem.Core.Tests.Services.PersonMatching.PersonMatchingServiceTests 40✅ 21s
TeachingRecordSystem.Core.Tests.Services.TrsDataSync.TrsDataSyncHelperTests 20✅ 11s
TeachingRecordSystem.Core.Tests.Services.TrsDataSync.TrsDataSyncServiceTests 3✅ 1s
TeachingRecordSystem.Core.Tests.Services.WorkforceData.TpsCsvExtractFileImporterTests 25✅ 1s
TeachingRecordSystem.Core.Tests.Services.WorkforceData.TpsCsvExtractProcessorTests 17✅ 10s

✅ TeachingRecordSystem.Core.Tests.DataStore.Postgres.Models.MandatoryQualificationProviderTests

✅ TryMapFromDqtMqEstablishment_ReturnsExpectedResult(mqestablishmentValue: "10", expectedResult: False)
✅ TryMapFromDqtMqEstablishment_ReturnsExpectedResult(mqestablishmentValue: "100", expectedResult: False)
✅ TryMapFromDqtMqEstablishment_ReturnsExpectedResult(mqestablishmentValue: "110", expectedResult: False)
✅ TryMapFromDqtMqEstablishment_ReturnsExpectedResult(mqestablishmentValue: "120", expectedResult: True)
✅ TryMapFromDqtMqEstablishment_ReturnsExpectedResult(mqestablishmentValue: "130", expectedResult: False)
✅ TryMapFromDqtMqEstablishment_ReturnsExpectedResult(mqestablishmentValue: "140", expectedResult: True)
✅ TryMapFromDqtMqEstablishment_ReturnsExpectedResult(mqestablishmentValue: "150", expectedResult: True)
✅ TryMapFromDqtMqEstablishment_ReturnsExpectedResult(mqestablishmentValue: "160", expectedResult: True)
✅ TryMapFromDqtMqEstablishment_ReturnsExpectedResult(mqestablishmentValue: "170", expectedResult: False)
✅ TryMapFromDqtMqEstablishment_ReturnsExpectedResult(mqestablishmentValue: "180", expectedResult: True)
✅ TryMapFromDqtMqEstablishment_ReturnsExpectedResult(mqestablishmentValue: "190", expectedResult: False)
✅ TryMapFromDqtMqEstablishment_ReturnsExpectedResult(mqestablishmentValue: "20", expectedResult: True)
✅ TryMapFromDqtMqEstablishment_ReturnsExpectedResult(mqestablishmentValue: "200", expectedResult: False)
✅ TryMapFromDqtMqEstablishment_ReturnsExpectedResult(mqestablishmentValue: "210", expectedResult: True)
✅ TryMapFromDqtMqEstablishment_ReturnsExpectedResult(mqestablishmentValue: "220", expectedResult: False)
✅ TryMapFromDqtMqEstablishment_ReturnsExpectedResult(mqestablishmentValue: "230", expectedResult: False)
✅ TryMapFromDqtMqEstablishment_ReturnsExpectedResult(mqestablishmentValue: "240", expectedResult: False)
✅ TryMapFromDqtMqEstablishment_ReturnsExpectedResult(mqestablishmentValue: "30", expectedResult: True)
✅ TryMapFromDqtMqEstablishment_ReturnsExpectedResult(mqestablishmentValue: "40", expectedResult: False)
✅ TryMapFromDqtMqEstablishment_ReturnsExpectedResult(mqestablishmentValue: "50", expectedResult: True)
✅ TryMapFromDqtMqEstablishment_ReturnsExpectedResult(mqestablishmentValue: "60", expectedResult: False)
✅ TryMapFromDqtMqEstablishment_ReturnsExpectedResult(mqestablishmentValue: "70", expectedResult: False)
✅ TryMapFromDqtMqEstablishment_ReturnsExpectedResult(mqestablishmentValue: "80", expectedResult: False)
✅ TryMapFromDqtMqEstablishment_ReturnsExpectedResult(mqestablishmentValue: "90", expectedResult: True)
✅ TryMapFromDqtMqEstablishment_ReturnsExpectedResult(mqestablishmentValue: "950", expectedResult: False)
✅ TryMapFromDqtMqEstablishment_ReturnsExpectedResult(mqestablishmentValue: "951", expectedResult: True)
✅ TryMapFromDqtMqEstablishment_ReturnsExpectedResult(mqestablishmentValue: "952", expectedResult: False)
✅ TryMapFromDqtMqEstablishment_ReturnsExpectedResult(mqestablishmentValue: "953", expectedResult: False)
✅ TryMapFromDqtMqEstablishment_ReturnsExpectedResult(mqestablishmentValue: "954", expectedResult: True)
✅ TryMapFromDqtMqEstablishment_ReturnsExpectedResult(mqestablishmentValue: "955", expectedResult: True)
✅ TryMapFromDqtMqEstablishment_ReturnsExpectedResult(mqestablishmentValue: "956", expectedResult: True)
✅ TryMapFromDqtMqEstablishment_ReturnsExpectedResult(mqestablishmentValue: "957", expectedResult: True)
✅ TryMapFromDqtMqEstablishment_ReturnsExpectedResult(mqestablishmentValue: "958", expectedResult: True)
✅ TryMapFromDqtMqEstablishment_ReturnsExpectedResult(mqestablishmentValue: "959", expectedResult: True)
✅ TryMapFromDqtMqEstablishment_ReturnsExpectedResult(mqestablishmentValue: "960", expectedResult: True)
✅ TryMapFromDqtMqEstablishment_ReturnsExpectedResult(mqestablishmentValue: "961", expectedResult: True)
✅ TryMapFromDqtMqEstablishment_ReturnsExpectedResult(mqestablishmentValue: "962", expectedResult: True)
✅ TryMapFromDqtMqEstablishment_ReturnsExpectedResult(mqestablishmentValue: "963", expectedResult: True)
✅ TryMapFromDqtMqEstablishment_ReturnsExpectedResult(mqestablishmentValue: "964", expectedResult: True)
✅ TryMapFromDqtMqEstablishment_ReturnsExpectedResult(mqestablishmentValue: "965", expectedResult: True)

✅ TeachingRecordSystem.Core.Tests.EventInfoTests

✅ EventSerializesCorrectly
✅ EventWithDqtUserIdSerializesRaisedByCorrectly

✅ TeachingRecordSystem.Core.Tests.Events.Processing.PublishEventsBackgroundServiceTests

✅ PublishEvents_DoesNotPublishAlreadyPublishedEvent
✅ PublishEvents_EventPublisherThrows_DoesNotThrow
✅ PublishEvents_PublishesUnpublishEventsAndSetsPublishedFlag

✅ TeachingRecordSystem.Core.Tests.Jobs.BatchSendEytsAwardedEmailsJobTests

✅ Execute_ForMultipleScenarios_EvaluatesDateRangeCorrectly(initialLastAwardedToUtc: 2022-05-23T00:00:00.0000000Z, previousJobLastAwardedToUtc: 2023-02-02T00:00:00.0000000Z, utcNow: 2023-02-06T08:00:00.0000000Z, startExpected: 2023-02-02T00:00:00.0000000Z, endExpected: 2023-02-03T00:00:00.0000000Z)
✅ Execute_ForMultipleScenarios_EvaluatesDateRangeCorrectly(initialLastAwardedToUtc: 2023-02-02T00:00:00.0000000Z, previousJobLastAwardedToUtc: null, utcNow: 2023-02-06T08:00:00.0000000Z, startExpected: 2023-02-02T00:00:00.0000000Z, endExpected: 2023-02-03T00:00:00.0000000Z)
✅ Execute_ForMultipleScenarios_EvaluatesDateRangeCorrectly(initialLastAwardedToUtc: 2023-03-26T00:00:00.0000000Z, previousJobLastAwardedToUtc: null, utcNow: 2023-03-30T08:00:00.0000000Z, startExpected: 2023-03-26T00:00:00.0000000Z, endExpected: 2023-03-27T00:00:00.0000000Z)
✅ Execute_ForMultipleScenarios_EvaluatesDateRangeCorrectly(initialLastAwardedToUtc: 2023-04-01T00:00:00.0000000Z, previousJobLastAwardedToUtc: null, utcNow: 2023-04-05T08:00:00.0000000Z, startExpected: 2023-04-01T00:00:00.0000000Z, endExpected: 2023-04-02T00:00:00.0000000Z)
✅ Execute_ForMultipleScenarios_EvaluatesDateRangeCorrectly(initialLastAwardedToUtc: 2023-10-29T00:00:00.0000000Z, previousJobLastAwardedToUtc: null, utcNow: 2023-11-02T08:00:00.0000000Z, startExpected: 2023-10-29T00:00:00.0000000Z, endExpected: 2023-10-30T00:00:00.0000000Z)
✅ Execute_WhenDoesNotHaveAwardeesForDateRange_UpdatesDatabaseOnly
✅ Execute_WhenEnqueueFails_DoesNotUpdateDatabase
✅ Execute_WhenHasAwardeesForDateRange_UpdatesDatabaseAndEnqueuesJobToSendEmail

✅ TeachingRecordSystem.Core.Tests.Jobs.BatchSendInductionCompletedEmailsJobTests

✅ Execute_ForMultipleScenarios_EvaluatesDateRangeCorrectly(initialLastAwardedToUtc: 2022-05-23T00:00:00.0000000Z, previousJobLastAwardedToUtc: 2023-02-02T00:00:00.0000000Z, utcNow: 2023-02-06T08:00:00.0000000Z, startExpected: 2023-02-02T00:00:00.0000000Z, endExpected: 2023-02-03T00:00:00.0000000Z)
✅ Execute_ForMultipleScenarios_EvaluatesDateRangeCorrectly(initialLastAwardedToUtc: 2023-02-02T00:00:00.0000000Z, previousJobLastAwardedToUtc: null, utcNow: 2023-02-06T08:00:00.0000000Z, startExpected: 2023-02-02T00:00:00.0000000Z, endExpected: 2023-02-03T00:00:00.0000000Z)
✅ Execute_ForMultipleScenarios_EvaluatesDateRangeCorrectly(initialLastAwardedToUtc: 2023-03-26T00:00:00.0000000Z, previousJobLastAwardedToUtc: null, utcNow: 2023-03-30T08:00:00.0000000Z, startExpected: 2023-03-26T00:00:00.0000000Z, endExpected: 2023-03-27T00:00:00.0000000Z)
✅ Execute_ForMultipleScenarios_EvaluatesDateRangeCorrectly(initialLastAwardedToUtc: 2023-04-01T00:00:00.0000000Z, previousJobLastAwardedToUtc: null, utcNow: 2023-04-05T08:00:00.0000000Z, startExpected: 2023-04-01T00:00:00.0000000Z, endExpected: 2023-04-02T00:00:00.0000000Z)
✅ Execute_ForMultipleScenarios_EvaluatesDateRangeCorrectly(initialLastAwardedToUtc: 2023-10-29T00:00:00.0000000Z, previousJobLastAwardedToUtc: null, utcNow: 2023-11-02T08:00:00.0000000Z, startExpected: 2023-10-29T00:00:00.0000000Z, endExpected: 2023-10-30T00:00:00.0000000Z)
✅ Execute_WhenDoesNotHaveCompleteesForDateRange_UpdatesDatabaseOnly
✅ Execute_WhenEnqueueFails_DoesNotUpdateDatabase
✅ Execute_WhenHasCompleteesForDateRange_UpdatesDatabaseAndEnqueuesJobToSendEmail

✅ TeachingRecordSystem.Core.Tests.Jobs.BatchSendInternationalQtsAwardedEmailsJobTests

✅ Execute_ForMultipleScenarios_EvaluatesDateRangeCorrectly(initialLastAwardedToUtc: 2022-05-23T00:00:00.0000000Z, previousJobLastAwardedToUtc: 2023-02-02T00:00:00.0000000Z, utcNow: 2023-02-06T08:00:00.0000000Z, startExpected: 2023-02-02T00:00:00.0000000Z, endExpected: 2023-02-03T00:00:00.0000000Z)
✅ Execute_ForMultipleScenarios_EvaluatesDateRangeCorrectly(initialLastAwardedToUtc: 2023-02-02T00:00:00.0000000Z, previousJobLastAwardedToUtc: null, utcNow: 2023-02-06T08:00:00.0000000Z, startExpected: 2023-02-02T00:00:00.0000000Z, endExpected: 2023-02-03T00:00:00.0000000Z)
✅ Execute_ForMultipleScenarios_EvaluatesDateRangeCorrectly(initialLastAwardedToUtc: 2023-03-26T00:00:00.0000000Z, previousJobLastAwardedToUtc: null, utcNow: 2023-03-30T08:00:00.0000000Z, startExpected: 2023-03-26T00:00:00.0000000Z, endExpected: 2023-03-27T00:00:00.0000000Z)
✅ Execute_ForMultipleScenarios_EvaluatesDateRangeCorrectly(initialLastAwardedToUtc: 2023-04-01T00:00:00.0000000Z, previousJobLastAwardedToUtc: null, utcNow: 2023-04-05T08:00:00.0000000Z, startExpected: 2023-04-01T00:00:00.0000000Z, endExpected: 2023-04-02T00:00:00.0000000Z)
✅ Execute_ForMultipleScenarios_EvaluatesDateRangeCorrectly(initialLastAwardedToUtc: 2023-10-29T00:00:00.0000000Z, previousJobLastAwardedToUtc: null, utcNow: 2023-11-02T08:00:00.0000000Z, startExpected: 2023-10-29T00:00:00.0000000Z, endExpected: 2023-10-30T00:00:00.0000000Z)
✅ Execute_WhenDoesNotHaveAwardeesForDateRange_UpdatesDatabaseOnly
✅ Execute_WhenEnqueueFails_DoesNotUpdateDatabase
✅ Execute_WhenHasAwardeesForDateRange_UpdatesDatabaseAndEnqueuesJobToSendEmail

✅ TeachingRecordSystem.Core.Tests.Jobs.BatchSendQtsAwardedEmailsJobTests

✅ Execute_ForMultipleScenarios_EvaluatesDateRangeCorrectly(initialLastAwardedToUtc: 2022-05-23T00:00:00.0000000Z, previousJobLastAwardedToUtc: 2023-02-02T00:00:00.0000000Z, utcNow: 2023-02-06T08:00:00.0000000Z, startExpected: 2023-02-02T00:00:00.0000000Z, endExpected: 2023-02-03T00:00:00.0000000Z)
✅ Execute_ForMultipleScenarios_EvaluatesDateRangeCorrectly(initialLastAwardedToUtc: 2023-02-02T00:00:00.0000000Z, previousJobLastAwardedToUtc: null, utcNow: 2023-02-06T08:00:00.0000000Z, startExpected: 2023-02-02T00:00:00.0000000Z, endExpected: 2023-02-03T00:00:00.0000000Z)
✅ Execute_ForMultipleScenarios_EvaluatesDateRangeCorrectly(initialLastAwardedToUtc: 2023-03-26T00:00:00.0000000Z, previousJobLastAwardedToUtc: null, utcNow: 2023-03-30T08:00:00.0000000Z, startExpected: 2023-03-26T00:00:00.0000000Z, endExpected: 2023-03-27T00:00:00.0000000Z)
✅ Execute_ForMultipleScenarios_EvaluatesDateRangeCorrectly(initialLastAwardedToUtc: 2023-04-01T00:00:00.0000000Z, previousJobLastAwardedToUtc: null, utcNow: 2023-04-05T08:00:00.0000000Z, startExpected: 2023-04-01T00:00:00.0000000Z, endExpected: 2023-04-02T00:00:00.0000000Z)
✅ Execute_ForMultipleScenarios_EvaluatesDateRangeCorrectly(initialLastAwardedToUtc: 2023-10-29T00:00:00.0000000Z, previousJobLastAwardedToUtc: null, utcNow: 2023-11-02T08:00:00.0000000Z, startExpected: 2023-10-29T00:00:00.0000000Z, endExpected: 2023-10-30T00:00:00.0000000Z)
✅ Execute_WhenDoesNotHaveAwardeesForDateRange_UpdatesDatabaseOnly
✅ Execute_WhenEnqueueFails_DoesNotUpdateDatabase
✅ Execute_WhenHasAwardeesForDateRange_UpdatesDatabaseAndEnqueuesJobToSendEmail

✅ TeachingRecordSystem.Core.Tests.Jobs.EytsAwardedEmailJobDispatcherTests

✅ Execute_WhenCalled_EnqueuesSendEmailJobForAllUnsentItems

✅ TeachingRecordSystem.Core.Tests.Jobs.InductionCompletedEmailJobDispatcherTests

✅ Execute_WhenCalled_EnqueuesSendEmailJobForAllUnsentItems

✅ TeachingRecordSystem.Core.Tests.Jobs.InternationalQtsAwardedEmailJobDispatcherTests

✅ Execute_WhenCalled_EnqueuesSendEmailJobForAllUnsentItems

✅ TeachingRecordSystem.Core.Tests.Jobs.QtsAwardedEmailJobDispatcherTests

✅ Execute_WhenCalled_EnqueuesSendEmailJobForAllUnsentItems

✅ TeachingRecordSystem.Core.Tests.Jobs.SendInductionCompletedEmailJobTests

✅ Execute_WhenCalled_GetsTrnTokenSendsEmailAddsEventAndUpdatesDatabase

✅ TeachingRecordSystem.Core.Tests.Jobs.SendInternationalQtsAwardedEmailJobTests

✅ Execute_WhenCalled_GetsTrnTokenSendsEmailAddsEventAndUpdatesDatabase

✅ TeachingRecordSystem.Core.Tests.Jobs.SendQtsAwardedEmailJobTests

✅ Execute_WhenCalled_GetsTrnTokenSendsEmailAddsEventAndUpdatesDatabase

✅ TeachingRecordSystem.Core.Tests.Services.Certificates.CertificateGeneratorTests

✅ GenerateCertificate_GetsTemplateFromBlobStorageAndSetFieldValuesAsExpected

✅ TeachingRecordSystem.Core.Tests.Services.Establishments.Gias.EstablishmentRefresherTests

✅ RefreshEstablishments_WhenCalledForExistingUrn_UpdatesEstablishment
✅ RefreshEstablishments_WhenCalledforNewUrn_AddsNewEstablishments

✅ TeachingRecordSystem.Core.Tests.Services.Establishments.Tps.TpsEstablishmentRefresherTests

✅ ImportFile_WithRowData_InsertsRecordsAsExpected(scenarioData: TpsEstablishmentFileImportTestScenarioData { IsExpectedToBeImported = False, Row = TpsEstablishmentCsvRow { EmployersName = "Employers Name", EstablishmentCode = "1234", LaCode = "123", SchoolClosedDate = "1234", SchoolGiasName = "School Gias Name" } })
✅ ImportFile_WithRowData_InsertsRecordsAsExpected(scenarioData: TpsEstablishmentFileImportTestScenarioData { IsExpectedToBeImported = False, Row = TpsEstablishmentCsvRow { EmployersName = "Employers Name", EstablishmentCode = "1234", LaCode = "1234", SchoolClosedDate = "03/02/2023", SchoolGiasName = "School Gias Name" } })
✅ ImportFile_WithRowData_InsertsRecordsAsExpected(scenarioData: TpsEstablishmentFileImportTestScenarioData { IsExpectedToBeImported = False, Row = TpsEstablishmentCsvRow { EmployersName = "Employers Name", EstablishmentCode = "12345", LaCode = "123", SchoolClosedDate = "03/02/2023", SchoolGiasName = "School Gias Name" } })
✅ ImportFile_WithRowData_InsertsRecordsAsExpected(scenarioData: TpsEstablishmentFileImportTestScenarioData { IsExpectedToBeImported = True, Row = TpsEstablishmentCsvRow { EmployersName = "Employers Name", EstablishmentCode = "1234", LaCode = "123", SchoolClosedDate = "03/02/2023", SchoolGiasName = "School Gias Name" } })
✅ RefreshEstablishments_WithTpsEstablishments_UpdatesEstablishmentsAsExpected(scenarioData: TpsEstablishmentRefreshTestScenarioData { ExpectedEstablishmentName = "Employers Name 2", ExpectedLaName = "Hackney", IsExpectedToGenerateEstablishment = True, TpsEstablishments = [TpsEstablishment { EmployersName = "Employers Name 1", EstablishmentCode = "0000", LaCode = "204", SchoolClosedDate = 01/01/2023, SchoolGiasName = null, ··· }, TpsEstablishment { EmployersName = "Employers Name 2", EstablishmentCode = "0000", LaCode = "204", SchoolClosedDate = null, SchoolGiasName = null, ··· }] })
✅ RefreshEstablishments_WithTpsEstablishments_UpdatesEstablishmentsAsExpected(scenarioData: TpsEstablishmentRefreshTestScenarioData { ExpectedEstablishmentName = "Employers Name", ExpectedLaName = "Hackney", IsExpectedToGenerateEstablishment = True, TpsEstablishments = [TpsEstablishment { EmployersName = "Employers Name", EstablishmentCode = "0000", LaCode = "204", SchoolClosedDate = null, SchoolGiasName = null, ··· }] })
✅ RefreshEstablishments_WithTpsEstablishments_UpdatesEstablishmentsAsExpected(scenarioData: TpsEstablishmentRefreshTestScenarioData { ExpectedEstablishmentName = "Employers Name", ExpectedLaName = null, IsExpectedToGenerateEstablishment = True, TpsEstablishments = [TpsEstablishment { EmployersName = "Employers Name", EstablishmentCode = "0000", LaCode = "751", SchoolClosedDate = null, SchoolGiasName = "School Gias Name", ··· }] })
✅ RefreshEstablishments_WithTpsEstablishments_UpdatesEstablishmentsAsExpected(scenarioData: TpsEstablishmentRefreshTestScenarioData { ExpectedEstablishmentName = "Full and Part-Time Youth and Community Worker", ExpectedLaName = "City of London", IsExpectedToGenerateEstablishment = True, TpsEstablishments = [TpsEstablishment { EmployersName = "CORPORATION OF LONDON", EstablishmentCode = "0972", LaCode = "201", SchoolClosedDate = null, SchoolGiasName = null, ··· }] })
✅ RefreshEstablishments_WithTpsEstablishments_UpdatesEstablishmentsAsExpected(scenarioData: TpsEstablishmentRefreshTestScenarioData { ExpectedEstablishmentName = "Full and Part-Time Youth and Community Worker", ExpectedLaName = "Hackney", IsExpectedToGenerateEstablishment = True, TpsEstablishments = [TpsEstablishment { EmployersName = "Hackney", EstablishmentCode = "0972", LaCode = "204", SchoolClosedDate = null, SchoolGiasName = null, ··· }] })
✅ RefreshEstablishments_WithTpsEstablishments_UpdatesEstablishmentsAsExpected(scenarioData: TpsEstablishmentRefreshTestScenarioData { ExpectedEstablishmentName = null, ExpectedLaName = null, IsExpectedToGenerateEstablishment = False, TpsEstablishments = [TpsEstablishment { EmployersName = "Hackney", EstablishmentCode = "2654", LaCode = "204", SchoolClosedDate = null, SchoolGiasName = null, ··· }] })

✅ TeachingRecordSystem.Core.Tests.Services.PersonMatching.PersonMatchingServiceTests

✅ GetMatchedAttributes_ReturnsExpectedResults(usePersonNino: False)
✅ GetMatchedAttributes_ReturnsExpectedResults(usePersonNino: True)
✅ GetSuggestedMatches_ReturnsExpectedResults(usePersonNino: False)
✅ GetSuggestedMatches_ReturnsExpectedResults(usePersonNino: True)
✅ Match_ReturnsExpectedResult(nameOption: MatchesAlias, dateOfBirthOption: MatchesPersonDateOfBirth, nationalInsuranceNumberOption: NotSpecified, trnOption: SpecifiedAndMatches, expectMatch: True, expectedMatchedAttributes: [FullName, DateOfBirth, Trn])
✅ Match_ReturnsExpectedResult(nameOption: MatchesAlias, dateOfBirthOption: MatchesPersonDateOfBirth, nationalInsuranceNumberOption: SpecifiedAndMatchesEmploymentNino, trnOption: NotSpecified, expectMatch: True, expectedMatchedAttributes: [FullName, DateOfBirth, NationalInsuranceNumber])
✅ Match_ReturnsExpectedResult(nameOption: MatchesAlias, dateOfBirthOption: MatchesPersonDateOfBirth, nationalInsuranceNumberOption: SpecifiedAndMatchesEmploymentNino, trnOption: SpecifiedAndMatches, expectMatch: True, expectedMatchedAttributes: [FullName, DateOfBirth, NationalInsuranceNumber, Trn])
✅ Match_ReturnsExpectedResult(nameOption: MatchesAlias, dateOfBirthOption: MatchesPersonDateOfBirth, nationalInsuranceNumberOption: SpecifiedAndMatchesEmploymentNino, trnOption: SpecifiedButDifferent, expectMatch: True, expectedMatchedAttributes: [FullName, DateOfBirth, NationalInsuranceNumber])
✅ Match_ReturnsExpectedResult(nameOption: MatchesAlias, dateOfBirthOption: MatchesPersonDateOfBirth, nationalInsuranceNumberOption: SpecifiedAndMatchesPersonNino, trnOption: NotSpecified, expectMatch: True, expectedMatchedAttributes: [FullName, DateOfBirth, NationalInsuranceNumber])
✅ Match_ReturnsExpectedResult(nameOption: MatchesAlias, dateOfBirthOption: MatchesPersonDateOfBirth, nationalInsuranceNumberOption: SpecifiedAndMatchesPersonNino, trnOption: SpecifiedAndMatches, expectMatch: True, expectedMatchedAttributes: [FullName, DateOfBirth, NationalInsuranceNumber, Trn])
✅ Match_ReturnsExpectedResult(nameOption: MatchesAlias, dateOfBirthOption: MatchesPersonDateOfBirth, nationalInsuranceNumberOption: SpecifiedAndMatchesPersonNino, trnOption: SpecifiedButDifferent, expectMatch: True, expectedMatchedAttributes: [FullName, DateOfBirth, NationalInsuranceNumber])
✅ Match_ReturnsExpectedResult(nameOption: MatchesAlias, dateOfBirthOption: MatchesPersonDateOfBirth, nationalInsuranceNumberOption: SpecifiedButDifferent, trnOption: SpecifiedAndMatches, expectMatch: True, expectedMatchedAttributes: [FullName, DateOfBirth, Trn])
✅ Match_ReturnsExpectedResult(nameOption: MatchesPersonName, dateOfBirthOption: MatchesPersonDateOfBirth, nationalInsuranceNumberOption: NotSpecified, trnOption: NotSpecified, expectMatch: False, expectedMatchedAttributes: null)
✅ Match_ReturnsExpectedResult(nameOption: MatchesPersonName, dateOfBirthOption: MatchesPersonDateOfBirth, nationalInsuranceNumberOption: NotSpecified, trnOption: SpecifiedAndMatches, expectMatch: True, expectedMatchedAttributes: [FullName, DateOfBirth, Trn])
✅ Match_ReturnsExpectedResult(nameOption: MatchesPersonName, dateOfBirthOption: MatchesPersonDateOfBirth, nationalInsuranceNumberOption: NotSpecified, trnOption: SpecifiedButDifferent, expectMatch: False, expectedMatchedAttributes: null)
✅ Match_ReturnsExpectedResult(nameOption: MatchesPersonName, dateOfBirthOption: MatchesPersonDateOfBirth, nationalInsuranceNumberOption: SpecifiedAndMatchesEmploymentNino, trnOption: NotSpecified, expectMatch: True, expectedMatchedAttributes: [FullName, DateOfBirth, NationalInsuranceNumber])
✅ Match_ReturnsExpectedResult(nameOption: MatchesPersonName, dateOfBirthOption: MatchesPersonDateOfBirth, nationalInsuranceNumberOption: SpecifiedAndMatchesEmploymentNino, trnOption: SpecifiedAndMatches, expectMatch: True, expectedMatchedAttributes: [FullName, DateOfBirth, NationalInsuranceNumber, Trn])
✅ Match_ReturnsExpectedResult(nameOption: MatchesPersonName, dateOfBirthOption: MatchesPersonDateOfBirth, nationalInsuranceNumberOption: SpecifiedAndMatchesEmploymentNino, trnOption: SpecifiedButDifferent, expectMatch: True, expectedMatchedAttributes: [FullName, DateOfBirth, NationalInsuranceNumber])
✅ Match_ReturnsExpectedResult(nameOption: MatchesPersonName, dateOfBirthOption: MatchesPersonDateOfBirth, nationalInsuranceNumberOption: SpecifiedAndMatchesPersonNino, trnOption: NotSpecified, expectMatch: True, expectedMatchedAttributes: [FullName, DateOfBirth, NationalInsuranceNumber])
✅ Match_ReturnsExpectedResult(nameOption: MatchesPersonName, dateOfBirthOption: MatchesPersonDateOfBirth, nationalInsuranceNumberOption: SpecifiedAndMatchesPersonNino, trnOption: SpecifiedAndMatches, expectMatch: True, expectedMatchedAttributes: [FullName, DateOfBirth, NationalInsuranceNumber, Trn])
✅ Match_ReturnsExpectedResult(nameOption: MatchesPersonName, dateOfBirthOption: MatchesPersonDateOfBirth, nationalInsuranceNumberOption: SpecifiedAndMatchesPersonNino, trnOption: SpecifiedButDifferent, expectMatch: True, expectedMatchedAttributes: [FullName, DateOfBirth, NationalInsuranceNumber])
✅ Match_ReturnsExpectedResult(nameOption: MatchesPersonName, dateOfBirthOption: MatchesPersonDateOfBirth, nationalInsuranceNumberOption: SpecifiedButDifferent, trnOption: NotSpecified, expectMatch: False, expectedMatchedAttributes: null)
✅ Match_ReturnsExpectedResult(nameOption: MatchesPersonName, dateOfBirthOption: MatchesPersonDateOfBirth, nationalInsuranceNumberOption: SpecifiedButDifferent, trnOption: SpecifiedAndMatches, expectMatch: True, expectedMatchedAttributes: [FullName, DateOfBirth, Trn])
✅ Match_ReturnsExpectedResult(nameOption: MatchesPersonName, dateOfBirthOption: NotSpecifed, nationalInsuranceNumberOption: SpecifiedAndMatchesPersonNino, trnOption: SpecifiedAndMatches, expectMatch: False, expectedMatchedAttributes: null)
✅ Match_ReturnsExpectedResult(nameOption: MultipleSpecifiedAndOneMatchesPersonName, dateOfBirthOption: MatchesPersonDateOfBirth, nationalInsuranceNumberOption: NotSpecified, trnOption: SpecifiedAndMatches, expectMatch: True, expectedMatchedAttributes: [FullName, DateOfBirth, Trn])
✅ Match_ReturnsExpectedResult(nameOption: MultipleSpecifiedAndOneMatchesPersonName, dateOfBirthOption: MatchesPersonDateOfBirth, nationalInsuranceNumberOption: SpecifiedAndMatchesEmploymentNino, trnOption: NotSpecified, expectMatch: True, expectedMatchedAttributes: [FullName, DateOfBirth, NationalInsuranceNumber])
✅ Match_ReturnsExpectedResult(nameOption: MultipleSpecifiedAndOneMatchesPersonName, dateOfBirthOption: MatchesPersonDateOfBirth, nationalInsuranceNumberOption: SpecifiedAndMatchesEmploymentNino, trnOption: SpecifiedAndMatches, expectMatch: True, expectedMatchedAttributes: [FullName, DateOfBirth, NationalInsuranceNumber, Trn])
✅ Match_ReturnsExpectedResult(nameOption: MultipleSpecifiedAndOneMatchesPersonName, dateOfBirthOption: MatchesPersonDateOfBirth, nationalInsuranceNumberOption: SpecifiedAndMatchesEmploymentNino, trnOption: SpecifiedButDifferent, expectMatch: True, expectedMatchedAttributes: [FullName, DateOfBirth, NationalInsuranceNumber])
✅ Match_ReturnsExpectedResult(nameOption: MultipleSpecifiedAndOneMatchesPersonName, dateOfBirthOption: MatchesPersonDateOfBirth, nationalInsuranceNumberOption: SpecifiedAndMatchesPersonNino, trnOption: NotSpecified, expectMatch: True, expectedMatchedAttributes: [FullName, DateOfBirth, NationalInsuranceNumber])
✅ Match_ReturnsExpectedResult(nameOption: MultipleSpecifiedAndOneMatchesPersonName, dateOfBirthOption: MatchesPersonDateOfBirth, nationalInsuranceNumberOption: SpecifiedAndMatchesPersonNino, trnOption: SpecifiedAndMatches, expectMatch: True, expectedMatchedAttributes: [FullName, DateOfBirth, NationalInsuranceNumber, Trn])
✅ Match_ReturnsExpectedResult(nameOption: MultipleSpecifiedAndOneMatchesPersonName, dateOfBirthOption: MatchesPersonDateOfBirth, nationalInsuranceNumberOption: SpecifiedAndMatchesPersonNino, trnOption: SpecifiedButDifferent, expectMatch: True, expectedMatchedAttributes: [FullName, DateOfBirth, NationalInsuranceNumber])
✅ Match_ReturnsExpectedResult(nameOption: MultipleSpecifiedAndOneMatchesPersonName, dateOfBirthOption: MatchesPersonDateOfBirth, nationalInsuranceNumberOption: SpecifiedButDifferent, trnOption: SpecifiedAndMatches, expectMatch: True, expectedMatchedAttributes: [FullName, DateOfBirth, Trn])
✅ Match_ReturnsExpectedResult(nameOption: NoFullName, dateOfBirthOption: MatchesPersonDateOfBirth, nationalInsuranceNumberOption: SpecifiedAndMatchesPersonNino, trnOption: SpecifiedAndMatches, expectMatch: False, expectedMatchedAttributes: null)
✅ Match_ReturnsExpectedResult(nameOption: NotSpecifed, dateOfBirthOption: MatchesPersonDateOfBirth, nationalInsuranceNumberOption: SpecifiedAndMatchesPersonNino, trnOption: SpecifiedAndMatches, expectMatch: False, expectedMatchedAttributes: null)
✅ Match_ReturnsExpectedResult(nameOption: SpecifiedButDifferentFirstName, dateOfBirthOption: MatchesPersonDateOfBirth, nationalInsuranceNumberOption: NotSpecified, trnOption: NotSpecified, expectMatch: False, expectedMatchedAttributes: null)
✅ Match_ReturnsExpectedResult(nameOption: SpecifiedButDifferentLastName, dateOfBirthOption: MatchesPersonDateOfBirth, nationalInsuranceNumberOption: NotSpecified, trnOption: NotSpecified, expectMatch: False, expectedMatchedAttributes: null)
✅ Match_ReturnsExpectedResult(nameOption: SpecifiedButDifferentLastName, dateOfBirthOption: MatchesPersonDateOfBirth, nationalInsuranceNumberOption: SpecifiedButDifferent, trnOption: SpecifiedButDifferent, expectMatch: False, expectedMatchedAttributes: null)
✅ Match_ReturnsExpectedResult(nameOption: SpecifiedButDifferentLastName, dateOfBirthOption: SpecifiedButDifferent, nationalInsuranceNumberOption: NotSpecified, trnOption: NotSpecified, expectMatch: False, expectedMatchedAttributes: null)
✅ Match_WithMultipleMatchingNames_ReturnsResult
✅ Match_WithMultipleMatchingResults_ReturnsNull

✅ TeachingRecordSystem.Core.Tests.Services.TrsDataSync.TrsDataSyncHelperTests

✅ DeleteRecords_WithMq_RemovesRowFromDb
✅ DeleteRecords_WithPerson_RemovesRowFromDb
✅ SyncMandatoryQualification_AlreadyHaveNewerVersion_DoesNotUpdateDatabase
✅ SyncMandatoryQualification_ExistingRecord_UpdatesExistingRowInDb
✅ SyncMandatoryQualification_NewRecord_WritesNewRowToDb(personAlreadySynced: False)
✅ SyncMandatoryQualification_NewRecord_WritesNewRowToDb(personAlreadySynced: True)
✅ SyncMandatoryQualification_WithDeactivatedEvent_SetsDeletedOnAttribute
✅ SyncMandatoryQualification_WithDeletedAudit_CreatesExpectedEvent
✅ SyncMandatoryQualification_WithDeletedEvent_SetsDeletedOnAttribute
✅ SyncMandatoryQualification_WithDqtCreateAudit_CreatesExpectedEvents
✅ SyncMandatoryQualification_WithDqtDeactivatedAudit_CreatesExpectedEvent
✅ SyncMandatoryQualification_WithDqtReactivatedAudit_CreatesExpectedEvents
✅ SyncMandatoryQualification_WithDqtUpdateAudit_CreatesExpectedEvents
✅ SyncMandatoryQualification_WithNoDqtAudit_CreatesExpectedEvents
✅ SyncMandatoryQualification_WithNoDqtCreateButWithUpdateAudits_CreatesExpectedEvents
✅ SyncMandatoryQualification_WithTrsEventAttributeOnDqtCreateAudit_CreatesExpectedEvents
✅ SyncMandatoryQualification_WithTrsEventAttributeOnDqtUpdateAudit_CreatesExpectedEvents
✅ SyncPerson_AlreadyHaveNewerVersion_DoesNotUpdateDatabase
✅ SyncPerson_ExistingRecord_UpdatesExistingRowInDb
✅ SyncPerson_NewRecord_WritesNewRowToDb

✅ TeachingRecordSystem.Core.Tests.Services.TrsDataSync.TrsDataSyncServiceTests

✅ Contact_DeletedRecord_DeletesPersonRecordFromDatabase
✅ Contact_NewRecord_WritesNewPersonRecordToDatabase
✅ Contact_UpdatedRecord_WritesUpdatedPersonRecordToDatabase

✅ TeachingRecordSystem.Core.Tests.Services.WorkforceData.TpsCsvExtractFileImporterTests

✅ CopyValidFormatDataToStaging_WithValidData_InsertsRecordWithExpectedResult
✅ ImportFile_WithRowData_InsertsRecordWithExpectedResult(testScenarioData: TpsCsvExtractFileImportTestScenarioData { ExpectedResult = DateOfBirthIncorrectFormat, Row = TpsCsvExtractRowRaw { DateOfBirth = "1234", DateOfDeath = "01/02/2024", EmploymentEndDate = "03/05/2024", EmploymentStartDate = "03/02/2023", EstablishmentCode = "1234", ··· } })
✅ ImportFile_WithRowData_InsertsRecordWithExpectedResult(testScenarioData: TpsCsvExtractFileImportTestScenarioData { ExpectedResult = DateOfBirthIncorrectFormat, Row = TpsCsvExtractRowRaw { DateOfBirth = null, DateOfDeath = "01/02/2024", EmploymentEndDate = "03/05/2024", EmploymentStartDate = "03/02/2023", EstablishmentCode = "1234", ··· } })
✅ ImportFile_WithRowData_InsertsRecordWithExpectedResult(testScenarioData: TpsCsvExtractFileImportTestScenarioData { ExpectedResult = DateOfDeathIncorrectFormat, Row = TpsCsvExtractRowRaw { DateOfBirth = "01/01/1980", DateOfDeath = "1234", EmploymentEndDate = "03/05/2024", EmploymentStartDate = "03/02/2023", EstablishmentCode = "1234", ··· } })
✅ ImportFile_WithRowData_InsertsRecordWithExpectedResult(testScenarioData: TpsCsvExtractFileImportTestScenarioData { ExpectedResult = EmploymentEndDateIncorrectFormat, Row = TpsCsvExtractRowRaw { DateOfBirth = "01/01/1980", DateOfDeath = "01/02/2024", EmploymentEndDate = "1234", EmploymentStartDate = "03/02/2023", EstablishmentCode = "1234", ··· } })
✅ ImportFile_WithRowData_InsertsRecordWithExpectedResult(testScenarioData: TpsCsvExtractFileImportTestScenarioData { ExpectedResult = EmploymentEndDateIncorrectFormat, Row = TpsCsvExtractRowRaw { DateOfBirth = "01/01/1980", DateOfDeath = "01/02/2024", EmploymentEndDate = null, EmploymentStartDate = "03/02/2023", EstablishmentCode = "1234", ··· } })
✅ ImportFile_WithRowData_InsertsRecordWithExpectedResult(testScenarioData: TpsCsvExtractFileImportTestScenarioData { ExpectedResult = EmploymentStartDateIncorrectFormat, Row = TpsCsvExtractRowRaw { DateOfBirth = "01/01/1980", DateOfDeath = "01/02/2024", EmploymentEndDate = "03/05/2024", EmploymentStartDate = "1234", EstablishmentCode = "1234", ··· } })
✅ ImportFile_WithRowData_InsertsRecordWithExpectedResult(testScenarioData: TpsCsvExtractFileImportTestScenarioData { ExpectedResult = EmploymentStartDateIncorrectFormat, Row = TpsCsvExtractRowRaw { DateOfBirth = "01/01/1980", DateOfDeath = "01/02/2024", EmploymentEndDate = "03/05/2024", EmploymentStartDate = null, EstablishmentCode = "1234", ··· } })
✅ ImportFile_WithRowData_InsertsRecordWithExpectedResult(testScenarioData: TpsCsvExtractFileImportTestScenarioData { ExpectedResult = EstablishmentNumberIncorrectFormat, Row = TpsCsvExtractRowRaw { DateOfBirth = "01/01/1980", DateOfDeath = "01/02/2024", EmploymentEndDate = "03/05/2024", EmploymentStartDate = "03/02/2023", EstablishmentCode = "12345", ··· } })
✅ ImportFile_WithRowData_InsertsRecordWithExpectedResult(testScenarioData: TpsCsvExtractFileImportTestScenarioData { ExpectedResult = ExtractDateIncorrectFormat, Row = TpsCsvExtractRowRaw { DateOfBirth = "01/01/1980", DateOfDeath = "01/02/2024", EmploymentEndDate = "03/05/2024", EmploymentStartDate = "03/02/2023", EstablishmentCode = "1234", ··· } })
✅ ImportFile_WithRowData_InsertsRecordWithExpectedResult(testScenarioData: TpsCsvExtractFileImportTestScenarioData { ExpectedResult = ExtractDateIncorrectFormat, Row = TpsCsvExtractRowRaw { DateOfBirth = "01/01/1980", DateOfDeath = "01/02/2024", EmploymentEndDate = "03/05/2024", EmploymentStartDate = "03/02/2023", EstablishmentCode = "1234", ··· } })
✅ ImportFile_WithRowData_InsertsRecordWithExpectedResult(testScenarioData: TpsCsvExtractFileImportTestScenarioData { ExpectedResult = FullOrPartTimeIndicatorIncorrectFormat, Row = TpsCsvExtractRowRaw { DateOfBirth = "01/01/1980", DateOfDeath = "01/02/2024", EmploymentEndDate = "03/05/2024", EmploymentStartDate = "03/02/2023", EstablishmentCode = "1234", ··· } })
✅ ImportFile_WithRowData_InsertsRecordWithExpectedResult(testScenarioData: TpsCsvExtractFileImportTestScenarioData { ExpectedResult = FullOrPartTimeIndicatorIncorrectFormat, Row = TpsCsvExtractRowRaw { DateOfBirth = "01/01/1980", DateOfDeath = "01/02/2024", EmploymentEndDate = "03/05/2024", EmploymentStartDate = "03/02/2023", EstablishmentCode = "1234", ··· } })
✅ ImportFile_WithRowData_InsertsRecordWithExpectedResult(testScenarioData: TpsCsvExtractFileImportTestScenarioData { ExpectedResult = GenderIncorrectFormat, Row = TpsCsvExtractRowRaw { DateOfBirth = "01/01/1980", DateOfDeath = "01/02/2024", EmploymentEndDate = "03/05/2024", EmploymentStartDate = "03/02/2023", EstablishmentCode = "1234", ··· } })
✅ ImportFile_WithRowData_InsertsRecordWithExpectedResult(testScenarioData: TpsCsvExtractFileImportTestScenarioData { ExpectedResult = GenderIncorrectFormat, Row = TpsCsvExtractRowRaw { DateOfBirth = "01/01/1980", DateOfDeath = "01/02/2024", EmploymentEndDate = "03/05/2024", EmploymentStartDate = "03/02/2023", EstablishmentCode = "1234", ··· } })
✅ ImportFile_WithRowData_InsertsRecordWithExpectedResult(testScenarioData: TpsCsvExtractFileImportTestScenarioData { ExpectedResult = LocalAuthorityCodeIncorrectFormat, Row = TpsCsvExtractRowRaw { DateOfBirth = "01/01/1980", DateOfDeath = "01/02/2024", EmploymentEndDate = "03/05/2024", EmploymentStartDate = "03/02/2023", EstablishmentCode = "1234", ··· } })
✅ ImportFile_WithRowData_InsertsRecordWithExpectedResult(testScenarioData: TpsCsvExtractFileImportTestScenarioData { ExpectedResult = LocalAuthorityCodeIncorrectFormat, Row = TpsCsvExtractRowRaw { DateOfBirth = "01/01/1980", DateOfDeath = "01/02/2024", EmploymentEndDate = "03/05/2024", EmploymentStartDate = "03/02/2023", EstablishmentCode = "1234", ··· } })
✅ ImportFile_WithRowData_InsertsRecordWithExpectedResult(testScenarioData: TpsCsvExtractFileImportTestScenarioData { ExpectedResult = NationalInsuranceNumberIncorrectFormat, Row = TpsCsvExtractRowRaw { DateOfBirth = "01/01/1980", DateOfDeath = "01/02/2024", EmploymentEndDate = "03/05/2024", EmploymentStartDate = "03/02/2023", EstablishmentCode = "1234", ··· } })
✅ ImportFile_WithRowData_InsertsRecordWithExpectedResult(testScenarioData: TpsCsvExtractFileImportTestScenarioData { ExpectedResult = NationalInsuranceNumberIncorrectFormat, Row = TpsCsvExtractRowRaw { DateOfBirth = "01/01/1980", DateOfDeath = "01/02/2024", EmploymentEndDate = "03/05/2024", EmploymentStartDate = "03/02/2023", EstablishmentCode = "1234", ··· } })
✅ ImportFile_WithRowData_InsertsRecordWithExpectedResult(testScenarioData: TpsCsvExtractFileImportTestScenarioData { ExpectedResult = None, Row = TpsCsvExtractRowRaw { DateOfBirth = "01/01/1980", DateOfDeath = "01/02/2024", EmploymentEndDate = "03/05/2024", EmploymentStartDate = "03/02/2023", EstablishmentCode = "1234", ··· } })
✅ ImportFile_WithRowData_InsertsRecordWithExpectedResult(testScenarioData: TpsCsvExtractFileImportTestScenarioData { ExpectedResult = None, Row = TpsCsvExtractRowRaw { DateOfBirth = "01/01/1980", DateOfDeath = "01/02/2024", EmploymentEndDate = "03/05/2024", EmploymentStartDate = "03/02/2023", EstablishmentCode = null, ··· } })
✅ ImportFile_WithRowData_InsertsRecordWithExpectedResult(testScenarioData: TpsCsvExtractFileImportTestScenarioData { ExpectedResult = None, Row = TpsCsvExtractRowRaw { DateOfBirth = "01/01/1980", DateOfDeath = null, EmploymentEndDate = "03/05/2024", EmploymentStartDate = "03/02/2023", EstablishmentCode = "1234", ··· } })
✅ ImportFile_WithRowData_InsertsRecordWithExpectedResult(testScenarioData: TpsCsvExtractFileImportTestScenarioData { ExpectedResult = TrnIncorrectFormat, Row = TpsCsvExtractRowRaw { DateOfBirth = "01/01/1980", DateOfDeath = "01/02/2024", EmploymentEndDate = "03/05/2024", EmploymentStartDate = "03/02/2023", EstablishmentCode = "1234", ··· } })
✅ ImportFile_WithRowData_InsertsRecordWithExpectedResult(testScenarioData: TpsCsvExtractFileImportTestScenarioData { ExpectedResult = TrnIncorrectFormat, Row = TpsCsvExtractRowRaw { DateOfBirth = "01/01/1980", DateOfDeath = "01/02/2024", EmploymentEndDate = "03/05/2024", EmploymentStartDate = "03/02/2023", EstablishmentCode = "1234", ··· } })
✅ ImportFile_WithRowData_InsertsRecordWithExpectedResult(testScenarioData: TpsCsvExtractFileImportTestScenarioData { ExpectedResult = WithdrawlIndicatorIncorrectFormat, Row = TpsCsvExtractRowRaw { DateOfBirth = "01/01/1980", DateOfDeath = "01/02/2024", EmploymentEndDate = "03/05/2024", EmploymentStartDate = "03/02/2023", EstablishmentCode = "1234", ··· } })

✅ TeachingRecordSystem.Core.Tests.Services.WorkforceData.TpsCsvExtractProcessorTests

✅ BackfillNinoAndPersonPostcodeInEmploymentHistory_WhenCalledWithPersonEmploymentRecordsWithoutNinoAndPersonPostcode_SetsNinoAndPersonPostcode
✅ ProcessEndedEmployments_WithLastKnownEmployedDateGreaterThanThreeMonthsBeforeLastExtractDate_SetsEndDateOnPersonEmploymentRecord
✅ ProcessNewEmploymentHistory_ForLaCodeAndEstablishmentNumberWithMultipleEstablishmentEntries_MatchesToTheMostOpenEstablishment
✅ ProcessNewEmploymentHistory_WhenCalledWithEndDateInTheFuture_SetsLastKnownEmployedDateToExtractDate
✅ ProcessNewEmploymentHistory_WhenCalledWithLastKnownEmployedDateOlderThanFiveMonths_SetsEndDate
✅ ProcessNewEmploymentHistory_WhenCalledWithNewEmploymentHistory_InsertsNewPersonEmploymentRecord
✅ ProcessNewEmploymentHistory_WhenCalledWithWithdrawalIndicatorSet_SetsEndDate
✅ ProcessNewEmploymentHistory_WithValidData_OnlyMatchesToLaCodeAndPostCodeForHigherEducationIfNoMatchOnLaCodeAndEstablishment
✅ ProcessNonMatchingEstablishments_WhenCalledWithEstablishmentsNotMatchingEstablishmentsInTrs_SetsResultToInvalidEstablishment
✅ ProcessNonMatchingTrns_WhenCalledWithTrnsNotMatchingPersonsInTrs_SetsResultToInvalidTrn
✅ ProcessUpdatedEmploymentHistory_WhenCalledWithEndDateInTheFuture_SetsLastKnownEmployedDateToExtractDate
✅ ProcessUpdatedEmploymentHistory_WhenCalledWithLastKnownEmployedDateOlderThanFiveMonths_SetsEndDate
✅ ProcessUpdatedEmploymentHistory_WhenCalledWithUpdatedEmploymentHistory_UpdatesPersonEmploymentRecord
✅ ProcessUpdatedEmploymentHistory_WhenCalledWithUpdatedEmploymentHistoryWithNoChanges_SetsResultToValidNoChanges
✅ ProcessUpdatedEmploymentHistory_WhenCalledWithWithdrawalIndicatorNowRemoved_ResetsEndDate
✅ ProcessUpdatedEmploymentHistory_WhenCalledWithWithdrawalIndicatorSet_SetsEndDate
✅ UpdateLatestEstablishmentVersions_WithEstablishmentChangingUrn_UpdatesPersonEmploymentRecord