From 6a97ea2617c0e4bb9c0a65a61d9fff6c1d82003c Mon Sep 17 00:00:00 2001 From: eddie4k Date: Sat, 7 Dec 2024 16:56:56 -0500 Subject: [PATCH] fix unit test to inject JwtCreator --- .../UserService.UnitTests/UserServiceTests.cs | 3 ++- shared/.vscode/settings.json | 1 + shared/shared.csproj | 7 ++++++ shared/shared.sln | 25 +++++++++++++++++++ 4 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 shared/.vscode/settings.json create mode 100644 shared/shared.sln diff --git a/UserService/UserService.UnitTests/UserServiceTests.cs b/UserService/UserService.UnitTests/UserServiceTests.cs index c03c8f5..e26bbe1 100644 --- a/UserService/UserService.UnitTests/UserServiceTests.cs +++ b/UserService/UserService.UnitTests/UserServiceTests.cs @@ -9,6 +9,7 @@ using UserService.Application.Services; using UserService.Domain.Entities; using UserService.Domain.ValueObjects; +using UserService.Infrastructure.Authentication; namespace UserService.UnitTests { public class UserServiceTests @@ -17,7 +18,7 @@ public class UserServiceTests private readonly Mock _userRepositoryMock = new Mock(); public UserServiceTests() { - this._userService = new AuthenticationService(_userRepositoryMock.Object); + this._userService = new AuthenticationService(_userRepositoryMock.Object, new JwtCreator()); } [Fact] diff --git a/shared/.vscode/settings.json b/shared/.vscode/settings.json new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/shared/.vscode/settings.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/shared/shared.csproj b/shared/shared.csproj index fa71b7a..c217651 100644 --- a/shared/shared.csproj +++ b/shared/shared.csproj @@ -6,4 +6,11 @@ enable + + + + + + + diff --git a/shared/shared.sln b/shared/shared.sln new file mode 100644 index 0000000..ac36849 --- /dev/null +++ b/shared/shared.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.5.002.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "shared", "shared.csproj", "{5DF65EDA-E226-4531-9FE4-D5B615C95718}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {5DF65EDA-E226-4531-9FE4-D5B615C95718}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5DF65EDA-E226-4531-9FE4-D5B615C95718}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5DF65EDA-E226-4531-9FE4-D5B615C95718}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5DF65EDA-E226-4531-9FE4-D5B615C95718}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {AF81B790-E65C-4B47-8442-E819AFB3B74C} + EndGlobalSection +EndGlobal