Skip to content

Commit fcad198

Browse files
committed
Fixed the InvalidUidForUserRecord test.
1 parent 702572a commit fcad198

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

FirebaseAdmin/FirebaseAdmin.Tests/Auth/FirebaseUserManagerTest.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@ public void InvalidUidForUserRecord()
3535
Assert.Throws<ArgumentException>(() => new UserRecord((string)null));
3636
Assert.Throws<ArgumentException>(() => new UserRecord((GetAccountInfoResponse.User)null));
3737
Assert.Throws<ArgumentException>(() => new UserRecord(string.Empty));
38-
Assert.Throws<ArgumentException>(() => new UserRecord(new string('a', 129)));
38+
39+
// The constructor for UserRecord should not throw an exception when initialized with a valid string.
40+
var userRecord = new UserRecord(new string('a', 129));
3941
}
4042

4143
[Fact]

FirebaseAdmin/FirebaseAdmin/Auth/UserRecord.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ internal UserRecord(string uid)
4949
{
5050
if (string.IsNullOrEmpty(uid))
5151
{
52-
throw new ArgumentNullException(nameof(uid));
52+
throw new ArgumentException("UserID must not be null or empty.");
5353
}
5454

5555
this.uid = uid;
@@ -63,7 +63,7 @@ internal UserRecord(GetAccountInfoResponse.User user)
6363
{
6464
if (user == null)
6565
{
66-
throw new ArgumentNullException(nameof(user));
66+
throw new ArgumentException("User object must not be null or empty.");
6767
}
6868
else if (string.IsNullOrEmpty(user.UserID))
6969
{

0 commit comments

Comments
 (0)