-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
330f836
commit c054a54
Showing
3 changed files
with
14 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,7 +35,7 @@ public async Task TestGetUserById() | |
User user = await _usersRepository.GetUserByIdAsync("60848ae8fb71edf2a7ebf846"); | ||
|
||
Assert.IsNotNull(user); | ||
Assert.AreEqual(user.Email, "[email protected]"); | ||
Assert.AreEqual("[email protected]", user.Email); | ||
} | ||
|
||
[Test] | ||
|
@@ -44,7 +44,7 @@ public async Task TestGetUserByEmail() | |
User user = await _usersRepository.GetUserByEmailAsync("[email protected]"); | ||
|
||
Assert.IsNotNull(user); | ||
Assert.AreEqual(user.Id, "60848ae8fb71edf2a7ebf846"); | ||
Assert.AreEqual("60848ae8fb71edf2a7ebf846", user.Id); | ||
} | ||
|
||
[Test] | ||
|
@@ -98,8 +98,8 @@ public async Task TestAuthenticate() | |
User result = await _usersRepository.AuthenticateAsync(email, password); | ||
|
||
Assert.IsNotNull(result); | ||
Assert.AreEqual(result.Id, "60848ae8fb71edf2a7ebf846"); | ||
Assert.AreEqual(result.Email, email); | ||
Assert.AreEqual("60848ae8fb71edf2a7ebf846", result.Id); | ||
Assert.AreEqual(email, result.Email); | ||
Assert.True(BCrypt.Net.BCrypt.Verify(password, result.PasswordHash)); | ||
} | ||
catch (Exception ex) | ||
|
@@ -138,7 +138,7 @@ public async Task TestUpdateUser() | |
await _usersRepository.UpdateUserAsync(replacement); | ||
User updatedUser = await _usersCollection.Find(u => u.Email == "newEmail").FirstOrDefaultAsync(); | ||
Assert.NotNull(updatedUser); | ||
Assert.AreEqual(updatedUser.Id, replacement.Id); | ||
Assert.AreEqual(replacement.Id, updatedUser.Id); | ||
|
||
await _usersRepository.UpdateUserAsync(updatedUser, "newPassword"); | ||
updatedUser = await _usersCollection.Find(u => u.Id == "60848ae8fb71edf2a7ebf846").FirstOrDefaultAsync(); | ||
|
@@ -148,7 +148,7 @@ public async Task TestUpdateUser() | |
|
||
await _usersRepository.UpdateUserAsync(replacement, "oldPassword"); | ||
updatedUser = await _usersCollection.Find(u => u.Id == "60848ae8fb71edf2a7ebf846").FirstOrDefaultAsync(); | ||
Assert.AreEqual(updatedUser.Email, "[email protected]"); | ||
Assert.AreEqual("[email protected]", updatedUser.Email); | ||
Assert.True(BCrypt.Net.BCrypt.Verify("oldPassword", updatedUser.PasswordHash)); | ||
} | ||
catch (Exception ex) | ||
|