@@ -441,128 +441,4 @@ mod tests {
441
441
assert_eq ! ( card. brand, Some ( "Mastercard" . to_string( ) ) ) ;
442
442
assert_eq ! ( card. number, Some ( "1234 5678 9012 3456" . to_string( ) ) ) ;
443
443
}
444
-
445
- #[ test]
446
- fn test_passport_complete_mapping_with_custom_fields ( ) {
447
- let result = load_sample_cxf ( ) ;
448
- assert ! ( result. is_ok( ) ) ;
449
- let ciphers = result. unwrap ( ) ;
450
- let passport_cipher = ciphers
451
- . iter ( )
452
- . find ( |c| c. name == "Passport" )
453
- . expect ( "Should find Passport item" ) ;
454
- let identity = match & passport_cipher. r#type {
455
- CipherType :: Identity ( identity) => identity,
456
- _ => panic ! ( "Expected Identity cipher" ) ,
457
- } ;
458
-
459
- // Verify Identity field mappings
460
- assert_eq ! ( identity. passport_number, Some ( "A12345678" . to_string( ) ) ) ;
461
- assert_eq ! ( identity. first_name, Some ( "John" . to_string( ) ) ) ;
462
- assert_eq ! ( identity. last_name, Some ( "Doe" . to_string( ) ) ) ;
463
- assert_eq ! ( identity. ssn, Some ( "ID123456789" . to_string( ) ) ) ;
464
- assert_eq ! ( identity. country, None ) ; // Now custom field
465
-
466
- // Verify custom fields preserve all other data
467
- assert ! (
468
- passport_cipher. fields. len( ) >= 4 ,
469
- "Should have multiple custom fields"
470
- ) ;
471
- let issuing_country = passport_cipher
472
- . fields
473
- . iter ( )
474
- . find ( |f| f. name . as_deref ( ) == Some ( "Issuing Country" ) )
475
- . expect ( "Should have Issuing Country" ) ;
476
- assert_eq ! ( issuing_country. value, Some ( "US" . to_string( ) ) ) ;
477
- let nationality = passport_cipher
478
- . fields
479
- . iter ( )
480
- . find ( |f| f. name . as_deref ( ) == Some ( "Nationality" ) )
481
- . expect ( "Should have Nationality" ) ;
482
- assert_eq ! ( nationality. value, Some ( "American" . to_string( ) ) ) ;
483
- }
484
-
485
- #[ test]
486
- fn test_drivers_license_complete_mapping_with_custom_fields ( ) {
487
- let result = load_sample_cxf ( ) ;
488
- assert ! ( result. is_ok( ) ) ;
489
- let ciphers = result. unwrap ( ) ;
490
- let drivers_license_cipher = ciphers
491
- . iter ( )
492
- . find ( |c| c. name == "Driver License" )
493
- . expect ( "Should find Driver License item" ) ;
494
- let identity = match & drivers_license_cipher. r#type {
495
- CipherType :: Identity ( identity) => identity,
496
- _ => panic ! ( "Expected Identity cipher" ) ,
497
- } ;
498
-
499
- // Verify Identity field mappings
500
- assert_eq ! ( identity. license_number, Some ( "D12345678" . to_string( ) ) ) ;
501
- assert_eq ! ( identity. first_name, Some ( "John" . to_string( ) ) ) ;
502
- assert_eq ! ( identity. last_name, Some ( "Doe" . to_string( ) ) ) ;
503
- assert_eq ! ( identity. state, Some ( "CA" . to_string( ) ) ) ;
504
- assert_eq ! ( identity. country, Some ( "US" . to_string( ) ) ) ;
505
- assert_eq ! ( identity. company, None ) ; // Now custom field
506
-
507
- // Verify custom fields preserve all other data
508
- assert ! (
509
- drivers_license_cipher. fields. len( ) >= 3 ,
510
- "Should have multiple custom fields"
511
- ) ;
512
- let issuing_authority = drivers_license_cipher
513
- . fields
514
- . iter ( )
515
- . find ( |f| f. name . as_deref ( ) == Some ( "Issuing Authority" ) )
516
- . expect ( "Should have Issuing Authority" ) ;
517
- assert_eq ! (
518
- issuing_authority. value,
519
- Some ( "Department of Motor Vehicles" . to_string( ) )
520
- ) ;
521
- let license_class = drivers_license_cipher
522
- . fields
523
- . iter ( )
524
- . find ( |f| f. name . as_deref ( ) == Some ( "License Class" ) )
525
- . expect ( "Should have License Class" ) ;
526
- assert_eq ! ( license_class. value, Some ( "C" . to_string( ) ) ) ;
527
- }
528
-
529
- #[ test]
530
- fn test_person_name_complete_mapping_with_custom_fields ( ) {
531
- let result = load_sample_cxf ( ) ;
532
- assert ! ( result. is_ok( ) ) ;
533
- let ciphers = result. unwrap ( ) ;
534
- let person_name_cipher = ciphers
535
- . iter ( )
536
- . find ( |c| c. name == "John Doe" )
537
- . expect ( "Should find John Doe item" ) ;
538
- let identity = match & person_name_cipher. r#type {
539
- CipherType :: Identity ( identity) => identity,
540
- _ => panic ! ( "Expected Identity cipher" ) ,
541
- } ;
542
-
543
- // Verify Identity field mappings
544
- assert_eq ! ( identity. title, Some ( "Dr." . to_string( ) ) ) ;
545
- assert_eq ! ( identity. first_name, Some ( "John" . to_string( ) ) ) ;
546
- assert_eq ! ( identity. middle_name, Some ( "Michael" . to_string( ) ) ) ;
547
- assert_eq ! ( identity. last_name, Some ( "van Doe Smith" . to_string( ) ) ) ;
548
- assert_eq ! ( identity. company, Some ( "PhD" . to_string( ) ) ) ;
549
-
550
- // Verify custom fields preserve unmapped data
551
- assert ! (
552
- person_name_cipher. fields. len( ) >= 2 ,
553
- "Should have custom fields"
554
- ) ;
555
- let informal_given = person_name_cipher
556
- . fields
557
- . iter ( )
558
- . find ( |f| f. name . as_deref ( ) == Some ( "Informal Given Name" ) )
559
- . expect ( "Should have Informal Given Name" ) ;
560
- assert_eq ! ( informal_given. value, Some ( "Johnny" . to_string( ) ) ) ;
561
- let generation = person_name_cipher
562
- . fields
563
- . iter ( )
564
- . find ( |f| f. name . as_deref ( ) == Some ( "Generation" ) )
565
- . expect ( "Should have Generation" ) ;
566
- assert_eq ! ( generation. value, Some ( "III" . to_string( ) ) ) ;
567
- }
568
444
}
0 commit comments