File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed
FirebaseAdmin/FirebaseAdmin.IntegrationTests Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -93,6 +93,34 @@ public async Task CreateCustomTokenWithoutServiceAccount()
93
93
}
94
94
}
95
95
96
+ [ Fact ]
97
+ public async Task SetCustomUserClaims ( )
98
+ {
99
+ var customClaims = new Dictionary < string , object > ( )
100
+ {
101
+ { "admin" , true }
102
+ } ;
103
+
104
+ await FirebaseAuth . DefaultInstance . SetCustomUserClaimsAsync ( "testuser" , customClaims ) ;
105
+ }
106
+
107
+ [ Fact ]
108
+ public async Task SetCustomUserClaimsWithEmptyClaims ( )
109
+ {
110
+ var customClaims = new Dictionary < string , object > ( ) ;
111
+
112
+ await FirebaseAuth . DefaultInstance . SetCustomUserClaimsAsync ( "testuser" , customClaims ) ;
113
+ }
114
+
115
+ [ Fact ]
116
+ public async Task SetCustomUserClaimsWithWrongUid ( )
117
+ {
118
+ var customClaims = new Dictionary < string , object > ( ) ;
119
+
120
+ await Assert . ThrowsAsync < FirebaseException > (
121
+ async ( ) => await FirebaseAuth . DefaultInstance . SetCustomUserClaimsAsync ( "mock-uid" , customClaims ) ) ;
122
+ }
123
+
96
124
private static async Task < string > SignInWithCustomTokenAsync ( string customToken )
97
125
{
98
126
var rb = new Google . Apis . Requests . RequestBuilder ( )
You can’t perform that action at this time.
0 commit comments