@@ -612,4 +612,49 @@ public async Task IsDeployed_ReturnsFalse_WhenContractIsNotDeployed()
612612
613613 Assert . False ( isDeployed ) ;
614614 }
615+
616+ [ Fact ( Timeout = 120000 ) ]
617+ public async Task GetSocialProfiles_WithENS ( )
618+ {
619+ var socialProfiles = await Utils . GetSocialProfiles ( this . Client , "joenrv.eth" ) ;
620+
621+ Assert . NotNull ( socialProfiles ) ;
622+ Assert . True ( socialProfiles . EnsProfiles . Count > 0 ) ;
623+ }
624+
625+ [ Fact ( Timeout = 120000 ) ]
626+ public async Task GetSocialProfiles_WithAddress ( )
627+ {
628+ var address = "0x2247d5d238d0f9d37184d8332aE0289d1aD9991b" ;
629+ var socialProfiles = await Utils . GetSocialProfiles ( this . Client , address ) ;
630+
631+ Assert . NotNull ( socialProfiles ) ;
632+ Assert . True ( socialProfiles . EnsProfiles . Count > 0 ) ;
633+ }
634+
635+ [ Fact ( Timeout = 120000 ) ]
636+ public async Task GetSocialProfiles_ThrowsException_WhenInputIsInvalid ( )
637+ {
638+ var invalidInput = "invalid_input" ;
639+ var exception = await Assert . ThrowsAsync < ArgumentException > ( async ( ) => await Utils . GetSocialProfiles ( this . Client , invalidInput ) ) ;
640+
641+ Assert . Contains ( "Invalid address or ENS." , exception . Message ) ;
642+ }
643+
644+ [ Fact ( Timeout = 120000 ) ]
645+ public async Task GetSocialProfiles_ThrowsException_WhenInputIsNull ( )
646+ {
647+ var exception = await Assert . ThrowsAsync < ArgumentNullException > ( async ( ) => await Utils . GetSocialProfiles ( this . Client , null ) ) ;
648+
649+ Assert . Equal ( "addressOrEns" , exception . ParamName ) ;
650+ }
651+
652+ [ Fact ( Timeout = 120000 ) ]
653+ public async Task GetSocialProfiles_ThrowsException_InvalidAuth ( )
654+ {
655+ var client = ThirdwebClient . Create ( "a" ) ;
656+ var exception = await Assert . ThrowsAsync < Exception > ( async ( ) => await Utils . GetSocialProfiles ( client , "joenrv.eth" ) ) ;
657+
658+ Assert . Contains ( "Failed to fetch social profiles" , exception . Message ) ;
659+ }
615660}
0 commit comments