From ee7bf1e204710021183590f26d744a0f482d8f1f Mon Sep 17 00:00:00 2001 From: Leon Hoppe Date: Tue, 10 Dec 2024 16:39:28 +0100 Subject: [PATCH] Renamed test projects --- HopFrame.sln | 8 ++++---- src/HopFrame.Api/HopFrame.Api.csproj | 2 +- src/HopFrame.Database/HopFrame.Database.csproj | 2 +- src/HopFrame.Web/HopFrame.Web.csproj | 2 +- .../AuthLogicTests.cs | 4 ++-- .../Extensions/HttpContextExtensions.cs | 2 +- .../HopFrame.Tests.Api.csproj} | 0 .../Data/DatabaseContext.cs | 3 ++- .../HopFrame.Tests.Database.csproj} | 0 .../PermissionValidatorTests.cs | 4 +++- .../Repositories/GroupRepositoryTests.cs | 4 ++-- .../Repositories/PermissionRepositoryTests.cs | 4 ++-- .../Repositories/TokenRepositoryTests.cs | 4 ++-- .../Repositories/UserRepositoryTests.cs | 4 ++-- .../AuthenticationTests.cs | 2 +- .../AuthorizationTests.cs | 4 ++-- .../HopFrame.Tests.Security.csproj} | 0 .../AuthMiddlewareTests.cs | 3 ++- .../AuthServiceTests.cs | 4 ++-- .../Extensions/HttpContextExtensions.cs | 2 +- .../HopFrame.Tests.Web.csproj} | 0 21 files changed, 31 insertions(+), 27 deletions(-) rename tests/{HopFrame.Api.Tests => HopFrame.Tests.Api}/AuthLogicTests.cs (99%) rename tests/{HopFrame.Api.Tests => HopFrame.Tests.Api}/Extensions/HttpContextExtensions.cs (96%) rename tests/{HopFrame.Api.Tests/HopFrame.Api.Tests.csproj => HopFrame.Tests.Api/HopFrame.Tests.Api.csproj} (100%) rename tests/{HopFrame.Database.Tests => HopFrame.Tests.Database}/Data/DatabaseContext.cs (81%) rename tests/{HopFrame.Database.Tests/HopFrame.Database.Tests.csproj => HopFrame.Tests.Database/HopFrame.Tests.Database.csproj} (100%) rename tests/{HopFrame.Database.Tests => HopFrame.Tests.Database}/PermissionValidatorTests.cs (96%) rename tests/{HopFrame.Database.Tests => HopFrame.Tests.Database}/Repositories/GroupRepositoryTests.cs (98%) rename tests/{HopFrame.Database.Tests => HopFrame.Tests.Database}/Repositories/PermissionRepositoryTests.cs (97%) rename tests/{HopFrame.Database.Tests => HopFrame.Tests.Database}/Repositories/TokenRepositoryTests.cs (96%) rename tests/{HopFrame.Database.Tests => HopFrame.Tests.Database}/Repositories/UserRepositoryTests.cs (98%) rename tests/{HopFrame.Security.Tests => HopFrame.Tests.Security}/AuthenticationTests.cs (99%) rename tests/{HopFrame.Security.Tests => HopFrame.Tests.Security}/AuthorizationTests.cs (98%) rename tests/{HopFrame.Security.Tests/HopFrame.Security.Tests.csproj => HopFrame.Tests.Security/HopFrame.Tests.Security.csproj} (100%) rename tests/{HopFrame.Web.Tests => HopFrame.Tests.Web}/AuthMiddlewareTests.cs (98%) rename tests/{HopFrame.Web.Tests => HopFrame.Tests.Web}/AuthServiceTests.cs (99%) rename tests/{HopFrame.Web.Tests => HopFrame.Tests.Web}/Extensions/HttpContextExtensions.cs (96%) rename tests/{HopFrame.Web.Tests/HopFrame.Web.Tests.csproj => HopFrame.Tests.Web/HopFrame.Tests.Web.csproj} (100%) diff --git a/HopFrame.sln b/HopFrame.sln index 195f022..95067c5 100644 --- a/HopFrame.sln +++ b/HopFrame.sln @@ -20,13 +20,13 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Testing", "Testing", "{EEA2 EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{1D98E5DE-CB8B-4C1C-A319-D49AC137441A}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HopFrame.Database.Tests", "tests\HopFrame.Database.Tests\HopFrame.Database.Tests.csproj", "{1CAAC943-B8FE-48DD-9712-92699647DE18}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HopFrame.Tests.Database", "tests\HopFrame.Tests.Database\HopFrame.Tests.Database.csproj", "{1CAAC943-B8FE-48DD-9712-92699647DE18}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HopFrame.Security.Tests", "tests\HopFrame.Security.Tests\HopFrame.Security.Tests.csproj", "{6747753A-6059-48F1-B779-D73765A373A6}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HopFrame.Tests.Security", "tests\HopFrame.Tests.Security\HopFrame.Tests.Security.csproj", "{6747753A-6059-48F1-B779-D73765A373A6}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HopFrame.Api.Tests", "tests\HopFrame.Api.Tests\HopFrame.Api.Tests.csproj", "{25DE1510-47E5-46FF-89A4-B9F99542218E}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HopFrame.Tests.Api", "tests\HopFrame.Tests.Api\HopFrame.Tests.Api.csproj", "{25DE1510-47E5-46FF-89A4-B9F99542218E}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HopFrame.Web.Tests", "tests\HopFrame.Web.Tests\HopFrame.Web.Tests.csproj", "{566C13B9-4ECA-48C4-8D02-FEB6CDF523E6}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HopFrame.Tests.Web", "tests\HopFrame.Tests.Web\HopFrame.Tests.Web.csproj", "{566C13B9-4ECA-48C4-8D02-FEB6CDF523E6}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/src/HopFrame.Api/HopFrame.Api.csproj b/src/HopFrame.Api/HopFrame.Api.csproj index c8b21c4..091e5a1 100644 --- a/src/HopFrame.Api/HopFrame.Api.csproj +++ b/src/HopFrame.Api/HopFrame.Api.csproj @@ -24,7 +24,7 @@ - <_Parameter1>HopFrame.Api.Tests + <_Parameter1>HopFrame.Tests.Api diff --git a/src/HopFrame.Database/HopFrame.Database.csproj b/src/HopFrame.Database/HopFrame.Database.csproj index 621c7b9..cd670af 100644 --- a/src/HopFrame.Database/HopFrame.Database.csproj +++ b/src/HopFrame.Database/HopFrame.Database.csproj @@ -24,7 +24,7 @@ - <_Parameter1>HopFrame.Database.Tests + <_Parameter1>HopFrame.Tests.Database diff --git a/src/HopFrame.Web/HopFrame.Web.csproj b/src/HopFrame.Web/HopFrame.Web.csproj index c368805..1eb0490 100644 --- a/src/HopFrame.Web/HopFrame.Web.csproj +++ b/src/HopFrame.Web/HopFrame.Web.csproj @@ -37,7 +37,7 @@ - <_Parameter1>HopFrame.Web.Tests + <_Parameter1>HopFrame.Tests.Web diff --git a/tests/HopFrame.Api.Tests/AuthLogicTests.cs b/tests/HopFrame.Tests.Api/AuthLogicTests.cs similarity index 99% rename from tests/HopFrame.Api.Tests/AuthLogicTests.cs rename to tests/HopFrame.Tests.Api/AuthLogicTests.cs index ae82b65..ca86b5b 100644 --- a/tests/HopFrame.Api.Tests/AuthLogicTests.cs +++ b/tests/HopFrame.Tests.Api/AuthLogicTests.cs @@ -3,7 +3,7 @@ using System.Security.Claims; using HopFrame.Api.Logic; using HopFrame.Api.Logic.Implementation; using HopFrame.Api.Models; -using HopFrame.Api.Tests.Extensions; +using HopFrame.Tests.Api.Extensions; using HopFrame.Database.Models; using HopFrame.Database.Repositories; using HopFrame.Security.Authentication; @@ -12,7 +12,7 @@ using HopFrame.Security.Models; using Microsoft.AspNetCore.Http; using Moq; -namespace HopFrame.Api.Tests; +namespace HopFrame.Tests.Api; public class AuthLogicTests { diff --git a/tests/HopFrame.Api.Tests/Extensions/HttpContextExtensions.cs b/tests/HopFrame.Tests.Api/Extensions/HttpContextExtensions.cs similarity index 96% rename from tests/HopFrame.Api.Tests/Extensions/HttpContextExtensions.cs rename to tests/HopFrame.Tests.Api/Extensions/HttpContextExtensions.cs index 4ccbb38..8f4de69 100644 --- a/tests/HopFrame.Api.Tests/Extensions/HttpContextExtensions.cs +++ b/tests/HopFrame.Tests.Api/Extensions/HttpContextExtensions.cs @@ -1,7 +1,7 @@ using System.Web; using Microsoft.AspNetCore.Http; -namespace HopFrame.Api.Tests.Extensions; +namespace HopFrame.Tests.Api.Extensions; internal static class HttpContextExtensions { /// Extracts the partial cookie value from the header section. diff --git a/tests/HopFrame.Api.Tests/HopFrame.Api.Tests.csproj b/tests/HopFrame.Tests.Api/HopFrame.Tests.Api.csproj similarity index 100% rename from tests/HopFrame.Api.Tests/HopFrame.Api.Tests.csproj rename to tests/HopFrame.Tests.Api/HopFrame.Tests.Api.csproj diff --git a/tests/HopFrame.Database.Tests/Data/DatabaseContext.cs b/tests/HopFrame.Tests.Database/Data/DatabaseContext.cs similarity index 81% rename from tests/HopFrame.Database.Tests/Data/DatabaseContext.cs rename to tests/HopFrame.Tests.Database/Data/DatabaseContext.cs index 7bc93de..271628f 100644 --- a/tests/HopFrame.Database.Tests/Data/DatabaseContext.cs +++ b/tests/HopFrame.Tests.Database/Data/DatabaseContext.cs @@ -1,6 +1,7 @@ +using HopFrame.Database; using Microsoft.EntityFrameworkCore; -namespace HopFrame.Database.Tests.Data; +namespace HopFrame.Tests.Database.Data; public class DatabaseContext : HopDbContextBase { protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) { diff --git a/tests/HopFrame.Database.Tests/HopFrame.Database.Tests.csproj b/tests/HopFrame.Tests.Database/HopFrame.Tests.Database.csproj similarity index 100% rename from tests/HopFrame.Database.Tests/HopFrame.Database.Tests.csproj rename to tests/HopFrame.Tests.Database/HopFrame.Tests.Database.csproj diff --git a/tests/HopFrame.Database.Tests/PermissionValidatorTests.cs b/tests/HopFrame.Tests.Database/PermissionValidatorTests.cs similarity index 96% rename from tests/HopFrame.Database.Tests/PermissionValidatorTests.cs rename to tests/HopFrame.Tests.Database/PermissionValidatorTests.cs index 9d858f8..693f093 100644 --- a/tests/HopFrame.Database.Tests/PermissionValidatorTests.cs +++ b/tests/HopFrame.Tests.Database/PermissionValidatorTests.cs @@ -1,4 +1,6 @@ -namespace HopFrame.Database.Tests; +using HopFrame.Database; + +namespace HopFrame.Tests.Database; public class PermissionValidatorTests { diff --git a/tests/HopFrame.Database.Tests/Repositories/GroupRepositoryTests.cs b/tests/HopFrame.Tests.Database/Repositories/GroupRepositoryTests.cs similarity index 98% rename from tests/HopFrame.Database.Tests/Repositories/GroupRepositoryTests.cs rename to tests/HopFrame.Tests.Database/Repositories/GroupRepositoryTests.cs index 84270e0..e3fd4ff 100644 --- a/tests/HopFrame.Database.Tests/Repositories/GroupRepositoryTests.cs +++ b/tests/HopFrame.Tests.Database/Repositories/GroupRepositoryTests.cs @@ -1,9 +1,9 @@ using HopFrame.Database.Models; using HopFrame.Database.Repositories; using HopFrame.Database.Repositories.Implementation; -using HopFrame.Database.Tests.Data; +using HopFrame.Tests.Database.Data; -namespace HopFrame.Database.Tests.Repositories; +namespace HopFrame.Tests.Database.Repositories; public class GroupRepositoryTests { diff --git a/tests/HopFrame.Database.Tests/Repositories/PermissionRepositoryTests.cs b/tests/HopFrame.Tests.Database/Repositories/PermissionRepositoryTests.cs similarity index 97% rename from tests/HopFrame.Database.Tests/Repositories/PermissionRepositoryTests.cs rename to tests/HopFrame.Tests.Database/Repositories/PermissionRepositoryTests.cs index 52a9ef7..79fff4c 100644 --- a/tests/HopFrame.Database.Tests/Repositories/PermissionRepositoryTests.cs +++ b/tests/HopFrame.Tests.Database/Repositories/PermissionRepositoryTests.cs @@ -1,10 +1,10 @@ using HopFrame.Database.Models; using HopFrame.Database.Repositories; using HopFrame.Database.Repositories.Implementation; -using HopFrame.Database.Tests.Data; +using HopFrame.Tests.Database.Data; using Microsoft.EntityFrameworkCore; -namespace HopFrame.Database.Tests.Repositories; +namespace HopFrame.Tests.Database.Repositories; public class PermissionRepositoryTests { diff --git a/tests/HopFrame.Database.Tests/Repositories/TokenRepositoryTests.cs b/tests/HopFrame.Tests.Database/Repositories/TokenRepositoryTests.cs similarity index 96% rename from tests/HopFrame.Database.Tests/Repositories/TokenRepositoryTests.cs rename to tests/HopFrame.Tests.Database/Repositories/TokenRepositoryTests.cs index 97e382a..83dc770 100644 --- a/tests/HopFrame.Database.Tests/Repositories/TokenRepositoryTests.cs +++ b/tests/HopFrame.Tests.Database/Repositories/TokenRepositoryTests.cs @@ -1,10 +1,10 @@ using HopFrame.Database.Models; using HopFrame.Database.Repositories; using HopFrame.Database.Repositories.Implementation; -using HopFrame.Database.Tests.Data; +using HopFrame.Tests.Database.Data; using Microsoft.EntityFrameworkCore; -namespace HopFrame.Database.Tests.Repositories; +namespace HopFrame.Tests.Database.Repositories; public class TokenRepositoryTests { diff --git a/tests/HopFrame.Database.Tests/Repositories/UserRepositoryTests.cs b/tests/HopFrame.Tests.Database/Repositories/UserRepositoryTests.cs similarity index 98% rename from tests/HopFrame.Database.Tests/Repositories/UserRepositoryTests.cs rename to tests/HopFrame.Tests.Database/Repositories/UserRepositoryTests.cs index 7d8362b..5730064 100644 --- a/tests/HopFrame.Database.Tests/Repositories/UserRepositoryTests.cs +++ b/tests/HopFrame.Tests.Database/Repositories/UserRepositoryTests.cs @@ -1,9 +1,9 @@ using HopFrame.Database.Models; using HopFrame.Database.Repositories; using HopFrame.Database.Repositories.Implementation; -using HopFrame.Database.Tests.Data; +using HopFrame.Tests.Database.Data; -namespace HopFrame.Database.Tests.Repositories; +namespace HopFrame.Tests.Database.Repositories; public class UserRepositoryTests { diff --git a/tests/HopFrame.Security.Tests/AuthenticationTests.cs b/tests/HopFrame.Tests.Security/AuthenticationTests.cs similarity index 99% rename from tests/HopFrame.Security.Tests/AuthenticationTests.cs rename to tests/HopFrame.Tests.Security/AuthenticationTests.cs index 2594cbb..7c80e7d 100644 --- a/tests/HopFrame.Security.Tests/AuthenticationTests.cs +++ b/tests/HopFrame.Tests.Security/AuthenticationTests.cs @@ -8,7 +8,7 @@ using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; using Moq; -namespace HopFrame.Security.Tests; +namespace HopFrame.Tests.Security; public class AuthenticationTests { diff --git a/tests/HopFrame.Security.Tests/AuthorizationTests.cs b/tests/HopFrame.Tests.Security/AuthorizationTests.cs similarity index 98% rename from tests/HopFrame.Security.Tests/AuthorizationTests.cs rename to tests/HopFrame.Tests.Security/AuthorizationTests.cs index 730dfde..98032fb 100644 --- a/tests/HopFrame.Security.Tests/AuthorizationTests.cs +++ b/tests/HopFrame.Tests.Security/AuthorizationTests.cs @@ -2,14 +2,14 @@ using System.Security.Claims; using HopFrame.Security.Authentication; using HopFrame.Security.Authorization; using HopFrame.Security.Claims; -using Microsoft.AspNetCore.Routing; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.Abstractions; using Microsoft.AspNetCore.Mvc.Filters; +using Microsoft.AspNetCore.Routing; using Moq; -namespace HopFrame.Security.Tests; +namespace HopFrame.Tests.Security; public class AuthorizationTests { diff --git a/tests/HopFrame.Security.Tests/HopFrame.Security.Tests.csproj b/tests/HopFrame.Tests.Security/HopFrame.Tests.Security.csproj similarity index 100% rename from tests/HopFrame.Security.Tests/HopFrame.Security.Tests.csproj rename to tests/HopFrame.Tests.Security/HopFrame.Tests.Security.csproj diff --git a/tests/HopFrame.Web.Tests/AuthMiddlewareTests.cs b/tests/HopFrame.Tests.Web/AuthMiddlewareTests.cs similarity index 98% rename from tests/HopFrame.Web.Tests/AuthMiddlewareTests.cs rename to tests/HopFrame.Tests.Web/AuthMiddlewareTests.cs index 70d1f8e..d9e136f 100644 --- a/tests/HopFrame.Web.Tests/AuthMiddlewareTests.cs +++ b/tests/HopFrame.Tests.Web/AuthMiddlewareTests.cs @@ -2,11 +2,12 @@ using System.Security.Claims; using HopFrame.Database.Models; using HopFrame.Database.Repositories; using HopFrame.Security.Claims; +using HopFrame.Web; using HopFrame.Web.Services; using Microsoft.AspNetCore.Http; using Moq; -namespace HopFrame.Web.Tests; +namespace HopFrame.Tests.Web; public class AuthMiddlewareTests { private readonly RequestDelegate _delegate = _ => Task.CompletedTask; diff --git a/tests/HopFrame.Web.Tests/AuthServiceTests.cs b/tests/HopFrame.Tests.Web/AuthServiceTests.cs similarity index 99% rename from tests/HopFrame.Web.Tests/AuthServiceTests.cs rename to tests/HopFrame.Tests.Web/AuthServiceTests.cs index 4374148..a5df287 100644 --- a/tests/HopFrame.Web.Tests/AuthServiceTests.cs +++ b/tests/HopFrame.Tests.Web/AuthServiceTests.cs @@ -1,14 +1,14 @@ -using HopFrame.Api.Tests.Extensions; using HopFrame.Database.Models; using HopFrame.Database.Repositories; using HopFrame.Security.Claims; using HopFrame.Security.Models; +using HopFrame.Tests.Web.Extensions; using HopFrame.Web.Services; using HopFrame.Web.Services.Implementation; using Microsoft.AspNetCore.Http; using Moq; -namespace HopFrame.Web.Tests; +namespace HopFrame.Tests.Web; public class AuthServiceTests { private readonly Guid _refreshToken = Guid.NewGuid(); diff --git a/tests/HopFrame.Web.Tests/Extensions/HttpContextExtensions.cs b/tests/HopFrame.Tests.Web/Extensions/HttpContextExtensions.cs similarity index 96% rename from tests/HopFrame.Web.Tests/Extensions/HttpContextExtensions.cs rename to tests/HopFrame.Tests.Web/Extensions/HttpContextExtensions.cs index 4ccbb38..a26537a 100644 --- a/tests/HopFrame.Web.Tests/Extensions/HttpContextExtensions.cs +++ b/tests/HopFrame.Tests.Web/Extensions/HttpContextExtensions.cs @@ -1,7 +1,7 @@ using System.Web; using Microsoft.AspNetCore.Http; -namespace HopFrame.Api.Tests.Extensions; +namespace HopFrame.Tests.Web.Extensions; internal static class HttpContextExtensions { /// Extracts the partial cookie value from the header section. diff --git a/tests/HopFrame.Web.Tests/HopFrame.Web.Tests.csproj b/tests/HopFrame.Tests.Web/HopFrame.Tests.Web.csproj similarity index 100% rename from tests/HopFrame.Web.Tests/HopFrame.Web.Tests.csproj rename to tests/HopFrame.Tests.Web/HopFrame.Tests.Web.csproj