@@ -560,5 +560,53 @@ public void GetProfileSettings()
560
560
Assert . Equal ( expectedProfileSettings . Hidden , actualProfileSettings . Hidden ) ;
561
561
Assert . Equal ( expectedProfileSettings . PublishNewOrcidData , actualProfileSettings . PublishNewOrcidData ) ;
562
562
}
563
+
564
+ [ Fact ( DisplayName = "ProfileSettings from DimUserProfile" ) ]
565
+ public void GetFullNameFromLastNameAndFistNames_01 ( )
566
+ {
567
+ // Arrange
568
+ UserProfileService userProfileService = new ( ) ;
569
+ string expectedFullname = "Smith John" ;
570
+ // Act
571
+ string actualFullname = userProfileService . GetFullname ( "Smith" , "John" ) ;
572
+ // Assert
573
+ Assert . Equal ( expectedFullname , actualFullname ) ;
574
+ }
575
+
576
+ [ Fact ( DisplayName = "ProfileSettings from DimUserProfile - last name is empty" ) ]
577
+ public void GetFullNameFromLastNameAndFistNames_02 ( )
578
+ {
579
+ // Arrange
580
+ UserProfileService userProfileService = new ( ) ;
581
+ string expectedFullname = "John" ;
582
+ // Act
583
+ string actualFullname = userProfileService . GetFullname ( "" , "John" ) ;
584
+ // Assert
585
+ Assert . Equal ( expectedFullname , actualFullname ) ;
586
+ }
587
+
588
+ [ Fact ( DisplayName = "ProfileSettings from DimUserProfile - fist name is empty" ) ]
589
+ public void GetFullNameFromLastNameAndFistNames_03 ( )
590
+ {
591
+ // Arrange
592
+ UserProfileService userProfileService = new ( ) ;
593
+ string expectedFullname = "Smith" ;
594
+ // Act
595
+ string actualFullname = userProfileService . GetFullname ( "Smith" , "" ) ;
596
+ // Assert
597
+ Assert . Equal ( expectedFullname , actualFullname ) ;
598
+ }
599
+
600
+ [ Fact ( DisplayName = "ProfileSettings from DimUserProfile - trim whitespaces" ) ]
601
+ public void GetFullNameFromLastNameAndFistNames_04 ( )
602
+ {
603
+ // Arrange
604
+ UserProfileService userProfileService = new ( ) ;
605
+ string expectedFullname = "Smith John" ;
606
+ // Act
607
+ string actualFullname = userProfileService . GetFullname ( " Smith " , " John " ) ;
608
+ // Assert
609
+ Assert . Equal ( expectedFullname , actualFullname ) ;
610
+ }
563
611
}
564
612
}
0 commit comments