Skip to content

Commit

Permalink
change new exception types in unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
emrecoskun705 committed Sep 15, 2023
1 parent c314a0c commit b8361f8
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Unitagram.Identity.UnitTests/AuthServiceUnitTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ public async Task Login_InvalidCredentials_ReturnsBadRequestException()

// Assert
result.IsFaulted.Should().BeTrue();
result.IfFail(e => e.Should().BeOfType<BadRequestException>());
result.IfFail(e => e.Should().BeOfType<InvalidAccountCredentialsException>());
}

[Fact]
Expand Down Expand Up @@ -191,7 +191,7 @@ public async Task Login_UserNotFound_ReturnsNotFoundException()

// Assert
result.IsFaulted.Should().BeTrue();
result.IfFail(e => e.Should().BeOfType<NotFoundException>());
result.IfFail(e => e.Should().BeOfType<UserNotFoundException>());
}

#endregion
Expand Down Expand Up @@ -392,7 +392,7 @@ public async Task RefreshToken_UserNameNull_ClaimsPrincipal_ReturnsBadRequestExc

// Assert
result.IsFaulted.Should().BeTrue();
result.IfFail(e => e.Should().BeOfType<BadRequestException>());
result.IfFail(e => e.Should().BeOfType<JwtTokenException>());
}

[Fact]
Expand Down Expand Up @@ -424,7 +424,7 @@ public async Task RefreshToken_UserNull_ReturnsNotFoundException()

// Assert
result.IsFaulted.Should().BeTrue();
result.IfFail(e => e.Should().BeOfType<NotFoundException>());
result.IfFail(e => e.Should().BeOfType<UserNotFoundException>());
}

[Fact]
Expand Down Expand Up @@ -462,7 +462,7 @@ public async Task RefreshToken_InvalidRefreshToken_ReturnsBadException()

// Assert
result.IsFaulted.Should().BeTrue();
result.IfFail(e => e.Should().BeOfType<BadRequestException>());
result.IfFail(e => e.Should().BeOfType<JwtTokenException>());
result.IfFail(e => e.Message.Should().Be("Invalid refresh token"));
}

Expand Down

0 comments on commit b8361f8

Please sign in to comment.