@@ -420,7 +420,6 @@ public async Task Run_NhsNumberFromNemsUpdateFileDoesNotMatchRetrievedPdsRecordN
420420 _httpClientFunctionMock . Setup ( x => x . SendGet ( "RetrievePdsDemographic" , It . IsAny < Dictionary < string , string > > ( ) ) )
421421 . ReturnsAsync ( JsonSerializer . Serialize ( new PdsDemographic ( ) { NhsNumber = supersededNhsNumber } ) ) ;
422422
423- // Mock the participant demographic check to return null (participant doesn't exist)
424423 _participantDemographicMock . Setup ( x => x . GetSingleByFilter ( It . IsAny < Expression < Func < ParticipantDemographic , bool > > > ( ) ) )
425424 . ReturnsAsync ( ( ParticipantDemographic ) null ) ;
426425
@@ -431,13 +430,11 @@ public async Task Run_NhsNumberFromNemsUpdateFileDoesNotMatchRetrievedPdsRecordN
431430 _fhirPatientDemographicMapperMock . Verify ( x => x . ParseFhirJsonNhsNumber ( It . IsAny < string > ( ) ) , Times . Once ) ;
432431 _httpClientFunctionMock . Verify ( x => x . SendGet ( "RetrievePdsDemographic" , It . IsAny < Dictionary < string , string > > ( ) ) , Times . Once ) ;
433432
434- //participant demographic check
435433 _participantDemographicMock . Verify ( x => x . GetSingleByFilter (
436434 It . Is < Expression < Func < ParticipantDemographic , bool > > > ( expr =>
437435 expr . Compile ( ) ( new ParticipantDemographic { NhsNumber = long . Parse ( _validNhsNumber ) } ) ) ) ,
438436 Times . Once ) ;
439437
440- // Verify logging for new participant case
441438 _loggerMock . Verify ( x => x . Log (
442439 LogLevel . Warning ,
443440 It . IsAny < EventId > ( ) ,
@@ -446,7 +443,6 @@ public async Task Run_NhsNumberFromNemsUpdateFileDoesNotMatchRetrievedPdsRecordN
446443 It . IsAny < Func < It . IsAnyType , Exception ? , string > > ( ) ) ,
447444 Times . Once ) ;
448445
449- // Verify the record type was set to New
450446 _addBatchToQueueMock . Verify ( x => x . ProcessBatch (
451447 It . Is < ConcurrentQueue < BasicParticipantCsvRecord > > ( q =>
452448 q . Any ( r => r . Participant . RecordType == Actions . New ) ) ,
@@ -494,7 +490,6 @@ public async Task Run_NhsNumberFromNemsUpdateFileDoesNotMatchRetrievedPdsRecordN
494490 _httpClientFunctionMock . Setup ( x => x . SendGet ( "RetrievePdsDemographic" , It . IsAny < Dictionary < string , string > > ( ) ) )
495491 . ReturnsAsync ( JsonSerializer . Serialize ( new PdsDemographic ( ) { NhsNumber = supersededNhsNumber } ) ) ;
496492
497- // Mock the participant demographic check to return an existing participant
498493 var existingParticipant = new ParticipantDemographic { NhsNumber = long . Parse ( _validNhsNumber ) } ;
499494 _participantDemographicMock . Setup ( x => x . GetSingleByFilter ( It . IsAny < Expression < Func < ParticipantDemographic , bool > > > ( ) ) )
500495 . ReturnsAsync ( existingParticipant ) ;
@@ -506,13 +501,11 @@ public async Task Run_NhsNumberFromNemsUpdateFileDoesNotMatchRetrievedPdsRecordN
506501 _fhirPatientDemographicMapperMock . Verify ( x => x . ParseFhirJsonNhsNumber ( It . IsAny < string > ( ) ) , Times . Once ) ;
507502 _httpClientFunctionMock . Verify ( x => x . SendGet ( "RetrievePdsDemographic" , It . IsAny < Dictionary < string , string > > ( ) ) , Times . Once ) ;
508503
509- // Verify participant demographic check was called
510504 _participantDemographicMock . Verify ( x => x . GetSingleByFilter (
511505 It . Is < Expression < Func < ParticipantDemographic , bool > > > ( expr =>
512506 expr . Compile ( ) ( existingParticipant ) ) ) ,
513507 Times . Once ) ;
514508
515- // Verify logging for EXISTING participant case
516509 _loggerMock . Verify ( x => x . Log (
517510 LogLevel . Warning ,
518511 It . IsAny < EventId > ( ) ,
@@ -521,14 +514,12 @@ public async Task Run_NhsNumberFromNemsUpdateFileDoesNotMatchRetrievedPdsRecordN
521514 It . IsAny < Func < It . IsAnyType , Exception ? , string > > ( ) ) ,
522515 Times . Once ) ;
523516
524- // Verify the record type was set to Amended (not New)
525517 _addBatchToQueueMock . Verify ( x => x . ProcessBatch (
526518 It . Is < ConcurrentQueue < BasicParticipantCsvRecord > > ( q =>
527519 q . Any ( r => r . Participant . RecordType == Actions . Amended ) ) ,
528520 It . IsAny < string > ( ) ) ,
529521 Times . Once ) ;
530522
531- // Verify superseded record processing
532523 _loggerMock . Verify ( x => x . Log (
533524 LogLevel . Information ,
534525 It . IsAny < EventId > ( ) ,
@@ -537,7 +528,6 @@ public async Task Run_NhsNumberFromNemsUpdateFileDoesNotMatchRetrievedPdsRecordN
537528 It . IsAny < Func < It . IsAnyType , Exception ? , string > > ( ) ) ,
538529 Times . Once ) ;
539530
540- // Verify NEMS unsubscribe
541531 _loggerMock . Verify ( x => x . Log (
542532 LogLevel . Information ,
543533 It . IsAny < EventId > ( ) ,
@@ -549,7 +539,6 @@ public async Task Run_NhsNumberFromNemsUpdateFileDoesNotMatchRetrievedPdsRecordN
549539 _httpClientFunctionMock . Verify ( x => x . SendPost ( "Unsubscribe" , It . IsAny < string > ( ) ) , Times . Once ) ;
550540 _addBatchToQueueMock . Verify ( queue => queue . ProcessBatch ( It . IsAny < ConcurrentQueue < BasicParticipantCsvRecord > > ( ) , It . IsAny < string > ( ) ) , Times . Once ) ;
551541
552- // Verify exception handler was called for superseded case
553542 _exceptionHandlerMock . Verify (
554543 x => x . CreateTransformExecutedExceptions (
555544 It . Is < CohortDistributionParticipant > ( p =>
0 commit comments