Skip to content

Commit

Permalink
fix unit test to inject JwtCreator
Browse files Browse the repository at this point in the history
  • Loading branch information
Eddie4k-code committed Dec 7, 2024
1 parent 6a97ea2 commit b200e52
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion UserService/UserService.UnitTests/UserServiceTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using System.Linq;
using System.Threading.Tasks;
using Castle.Core.Logging;
using Microsoft.Extensions.Options;
using Moq;
using UserService.Application.Interfaces.Persistence;
using UserService.Application.Results;
Expand All @@ -16,9 +17,11 @@ public class UserServiceTests
{
private readonly IAuthenticationService _userService;
private readonly Mock<IUserRepository> _userRepositoryMock = new Mock<IUserRepository>();


public UserServiceTests() {
this._userService = new AuthenticationService(_userRepositoryMock.Object, new JwtCreator());
var jwtSettings = Options.Create(new JwtSettings());
this._userService = new AuthenticationService(_userRepositoryMock.Object, new JwtCreator(jwtSettings));
}

[Fact]
Expand Down

0 comments on commit b200e52

Please sign in to comment.