Skip to content

Commit

Permalink
restructure folders
Browse files Browse the repository at this point in the history
  • Loading branch information
Barsonax committed Dec 1, 2024
1 parent 81e9873 commit d22bcc9
Show file tree
Hide file tree
Showing 59 changed files with 166 additions and 129 deletions.
4 changes: 2 additions & 2 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -156,12 +156,12 @@ dotnet_diagnostic.CA1848.severity = none
dotnet_diagnostic.CA1812.severity = none
# Is an internal class that is apparently never instantiated, too many false positives.
dotnet_diagnostic.CS1591.severity = none
# Types can be made internal
dotnet_diagnostic.CA1515.severity = none

[**/Endpoints/**.cs]
# Missing XML comment
dotnet_diagnostic.CS1591.severity = warning
# Types can be made internal
dotnet_diagnostic.CA1515.severity = none

[**.Tests/**.cs]
# Remove the underscores from member name
Expand Down
20 changes: 0 additions & 20 deletions CleanAspCore.Api.TestUtils/CleanAspCore.Api.TestUtils.csproj

This file was deleted.

38 changes: 0 additions & 38 deletions CleanAspCore.Api.Tests/CleanAspCore.Api.Tests.csproj

This file was deleted.

44 changes: 20 additions & 24 deletions CleanAspCore.Api/CleanAspCore.Api.csproj
Original file line number Diff line number Diff line change
@@ -1,37 +1,33 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<UserSecretsId>391763c2-1f84-411d-9a9d-868d2333be99</UserSecretsId>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Azure.Monitor.OpenTelemetry.AspNetCore" Version="1.2.0"/>
<PackageReference Include="FluentValidation" Version="11.11.0"/>
<PackageReference Include="FluentValidation.AspNetCore" Version="11.3.0"/>
<PackageReference Include="FluentValidation.DependencyInjectionExtensions" Version="11.11.0"/>
<PackageReference Include="MicroElements.Swashbuckle.FluentValidation" Version="6.1.0"/>
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="9.0.0"/>
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="9.0.0"/>
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="9.0.0"/>
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="9.0.0">
<PackageReference Include="Azure.Monitor.OpenTelemetry.AspNetCore" />
<PackageReference Include="FluentValidation" />
<PackageReference Include="FluentValidation.AspNetCore" />
<PackageReference Include="FluentValidation.DependencyInjectionExtensions" />
<PackageReference Include="MicroElements.Swashbuckle.FluentValidation" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" />
<PackageReference Include="Microsoft.AspNetCore.OpenApi" />
<PackageReference Include="Microsoft.EntityFrameworkCore" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="9.0.0"/>
<PackageReference Include="Microsoft.Extensions.Http.Polly" Version="9.0.0"/>
<PackageReference Include="Microsoft.Identity.Web" Version="3.4.0"/>
<PackageReference Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.10.0"/>
<PackageReference Include="OpenTelemetry.Extensions.Hosting" Version="1.10.0"/>
<PackageReference Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.9.0"/>
<PackageReference Include="OpenTelemetry.Instrumentation.EntityFrameworkCore" Version="1.0.0-beta.11"/>
<PackageReference Include="Polly.Contrib.WaitAndRetry" Version="1.1.1"/>
<PackageReference Include="Swashbuckle.AspNetCore" Version="7.1.0"/>
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" />
<PackageReference Include="Microsoft.Extensions.Http.Polly" />
<PackageReference Include="Microsoft.Identity.Web" />
<PackageReference Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" />
<PackageReference Include="OpenTelemetry.Extensions.Hosting" />
<PackageReference Include="OpenTelemetry.Instrumentation.AspNetCore" />
<PackageReference Include="OpenTelemetry.Instrumentation.EntityFrameworkCore" />
<PackageReference Include="Polly.Contrib.WaitAndRetry" />
<PackageReference Include="Swashbuckle.AspNetCore" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\CleanAspCore.Core\CleanAspCore.Core.csproj"/>
<ProjectReference Include="..\CleanAspCore.Core\CleanAspCore.Core.csproj" />
</ItemGroup>

</Project>
</Project>
25 changes: 9 additions & 16 deletions CleanAspCore.Core/CleanAspCore.Core.csproj
Original file line number Diff line number Diff line change
@@ -1,29 +1,22 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<FrameworkReference Include="Microsoft.AspNetCore.App"/>
</ItemGroup>

<ItemGroup>
<PackageReference Include="FluentValidation" Version="11.11.0"/>
<PackageReference Include="Azure.Monitor.OpenTelemetry.AspNetCore" Version="1.2.0"/>
<PackageReference Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.10.0"/>
<PackageReference Include="OpenTelemetry.Extensions.Hosting" Version="1.10.0"/>
<PackageReference Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.9.0"/>
<PackageReference Include="OpenTelemetry.Instrumentation.EntityFrameworkCore" Version="1.0.0-beta.11"/>

<PackageReference Include="Microsoft.EntityFrameworkCore" Version="9.0.0"/>
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="9.0.0">
<PackageReference Include="FluentValidation"/>
<PackageReference Include="Azure.Monitor.OpenTelemetry.AspNetCore"/>
<PackageReference Include="OpenTelemetry.Exporter.OpenTelemetryProtocol"/>
<PackageReference Include="OpenTelemetry.Extensions.Hosting"/>
<PackageReference Include="OpenTelemetry.Instrumentation.AspNetCore"/>
<PackageReference Include="OpenTelemetry.Instrumentation.EntityFrameworkCore"/>
<PackageReference Include="Microsoft.EntityFrameworkCore"/>
<PackageReference Include="Microsoft.EntityFrameworkCore.Design">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="9.0.0"/>
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer"/>
</ItemGroup>

</Project>
13 changes: 10 additions & 3 deletions CleanAspCore.sln
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,18 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SolutionItems", "SolutionIt
.github\workflows\deploy.yml = .github\workflows\deploy.yml
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CleanAspCore.Api.Tests", "CleanAspCore.Api.Tests\CleanAspCore.Api.Tests.csproj", "{4B45D679-E787-4236-BD9A-383364CD0E6F}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CleanAspCore.Api.Tests", "Tests\CleanAspCore.Api.Tests\CleanAspCore.Api.Tests.csproj", "{4B45D679-E787-4236-BD9A-383364CD0E6F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CleanAspCore.Api.TestDataGenerator", "CleanAspCore.Api.TestDataGenerator\CleanAspCore.Api.TestDataGenerator.csproj", "{308E3484-E719-474C-95F5-4094D27204E5}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CleanAspCore.TestDataGenerator", "Tests\CleanAspCore.TestDataGenerator\CleanAspCore.TestDataGenerator.csproj", "{308E3484-E719-474C-95F5-4094D27204E5}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CleanAspCore.Api.TestUtils", "CleanAspCore.Api.TestUtils\CleanAspCore.Api.TestUtils.csproj", "{78777B6E-16FC-4502-8943-0D5CEC91CC32}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CleanAspCore.TestUtils", "Tests\CleanAspCore.TestUtils\CleanAspCore.TestUtils.csproj", "{78777B6E-16FC-4502-8943-0D5CEC91CC32}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CleanAspCore.Core", "CleanAspCore.Core\CleanAspCore.Core.csproj", "{EFF51E1D-EE7E-42D2-A1A1-325E3EC97459}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CleanAspCore.Api", "CleanAspCore.Api\CleanAspCore.Api.csproj", "{8FD65EE3-5A93-44BB-8335-8FB74EB2D1CD}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{0F082E05-E08A-4084-87BF-86A8D0D5B05F}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -51,4 +53,9 @@ Global
{8FD65EE3-5A93-44BB-8335-8FB74EB2D1CD}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8FD65EE3-5A93-44BB-8335-8FB74EB2D1CD}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{308E3484-E719-474C-95F5-4094D27204E5} = {0F082E05-E08A-4084-87BF-86A8D0D5B05F}
{4B45D679-E787-4236-BD9A-383364CD0E6F} = {0F082E05-E08A-4084-87BF-86A8D0D5B05F}
{78777B6E-16FC-4502-8943-0D5CEC91CC32} = {0F082E05-E08A-4084-87BF-86A8D0D5B05F}
EndGlobalSection
EndGlobal
1 change: 1 addition & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<LangVersion>13.0</LangVersion>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<IsPackable>false</IsPackable>
</PropertyGroup>

<PropertyGroup>
Expand Down
40 changes: 40 additions & 0 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<Project>
<PropertyGroup>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
<CentralPackageTransitivePinningEnabled>true</CentralPackageTransitivePinningEnabled>
<NoWarn>$(NoWarn);NU1507</NoWarn>
</PropertyGroup>
<ItemGroup>
<PackageVersion Include="Azure.Monitor.OpenTelemetry.AspNetCore" Version="1.2.0" />
<PackageVersion Include="Bogus" Version="35.6.1" />
<PackageVersion Include="coverlet.collector" Version="6.0.2" />
<PackageVersion Include="FluentAssertions" Version="6.12.2" />
<PackageVersion Include="FluentValidation" Version="11.11.0" />
<PackageVersion Include="FluentValidation.AspNetCore" Version="11.3.0" />
<PackageVersion Include="FluentValidation.DependencyInjectionExtensions" Version="11.11.0" />
<PackageVersion Include="GitHubActionsTestLogger" Version="2.4.1" />
<PackageVersion Include="MicroElements.Swashbuckle.FluentValidation" Version="6.1.0" />
<PackageVersion Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="9.0.0" />
<PackageVersion Include="Microsoft.AspNetCore.Mvc.Testing" Version="9.0.0" />
<PackageVersion Include="Microsoft.AspNetCore.OpenApi" Version="9.0.0" />
<PackageVersion Include="Microsoft.EntityFrameworkCore" Version="9.0.0" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Design" Version="9.0.0" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Relational" Version="9.0.0" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.SqlServer" Version="9.0.0" />
<PackageVersion Include="Microsoft.Extensions.Http.Polly" Version="9.0.0" />
<PackageVersion Include="Microsoft.Identity.Web" Version="3.4.0" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageVersion Include="NUnit" Version="4.2.2" />
<PackageVersion Include="NUnit.Analyzers" Version="4.4.0" />
<PackageVersion Include="NUnit3TestAdapter" Version="4.6.0" />
<PackageVersion Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.10.0" />
<PackageVersion Include="OpenTelemetry.Extensions.Hosting" Version="1.10.0" />
<PackageVersion Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.9.0" />
<PackageVersion Include="OpenTelemetry.Instrumentation.EntityFrameworkCore" Version="1.0.0-beta.11" />
<PackageVersion Include="Polly.Contrib.WaitAndRetry" Version="1.1.1" />
<PackageVersion Include="Refit" Version="8.0.0" />
<PackageVersion Include="Respawn" Version="6.2.1" />
<PackageVersion Include="Swashbuckle.AspNetCore" Version="7.1.0" />
<PackageVersion Include="Testcontainers.MsSql" Version="4.0.0" />
</ItemGroup>
</Project>
32 changes: 32 additions & 0 deletions Tests/CleanAspCore.Api.Tests/CleanAspCore.Api.Tests.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<IsTestProject>true</IsTestProject>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Bogus"/>
<PackageReference Include="FluentAssertions"/>
<PackageReference Include="GitHubActionsTestLogger">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing"/>
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational"/>
<PackageReference Include="Microsoft.NET.Test.Sdk"/>
<PackageReference Include="NUnit"/>
<PackageReference Include="NUnit3TestAdapter"/>
<PackageReference Include="NUnit.Analyzers">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="coverlet.collector">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Refit"/>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\CleanAspCore.Api\CleanAspCore.Api.csproj"/>
<ProjectReference Include="..\CleanAspCore.TestUtils\CleanAspCore.TestUtils.csproj"/>
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System.Collections;
using CleanAspCore.Api.TestUtils.DataBaseSetup;
using CleanAspCore.Data;
using CleanAspCore.TestUtils.DataBaseSetup;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
namespace CleanAspCore.Api.Tests.Endpoints.Departments;
using CleanAspCore.Api.Tests.Fakers;

namespace CleanAspCore.Api.Tests.Endpoints.Departments;

internal sealed class AddDepartmentsTests : TestBase
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using CleanAspCore.Api.Endpoints.Employees;
using CleanAspCore.Api.Tests.Fakers;

namespace CleanAspCore.Api.Tests.Endpoints.Employees;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
using CleanAspCore.Api.Tests.Fakers;

namespace CleanAspCore.Api.Tests.Endpoints.Jobs;

internal sealed class CreateJobTests : TestBase
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using Bogus;
using CleanAspCore.Api.Endpoints.Departments;

namespace CleanAspCore.Api.TestUtils.Fakers;
namespace CleanAspCore.Api.Tests.Fakers;

public sealed class CreateDepartmentRequestFaker : Faker<CreateDepartmentRequest>
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using Bogus;
using CleanAspCore.Api.Endpoints.Employees;

namespace CleanAspCore.Api.TestUtils.Fakers;
namespace CleanAspCore.Api.Tests.Fakers;

public sealed class CreateEmployeeRequestFaker : Faker<CreateEmployeeRequest>
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using Bogus;
using CleanAspCore.Api.Endpoints.Jobs;

namespace CleanAspCore.Api.TestUtils.Fakers;
namespace CleanAspCore.Api.Tests.Fakers;

public sealed class CreateJobRequestFaker : Faker<CreateJobRequest>
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using CleanAspCore.Api.TestUtils.DataBaseSetup;
using CleanAspCore.Api.TestUtils.Logging;
using CleanAspCore.Api.TestUtils.Logging;
using CleanAspCore.Data;
using CleanAspCore.TestUtils.DataBaseSetup;
using Microsoft.Extensions.DependencyInjection;

[assembly: FixtureLifeCycle(LifeCycle.InstancePerTestCase)]
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System.Net.Http.Headers;
using System.Security.Claims;
using CleanAspCore.Api.TestUtils.DataBaseSetup;
using CleanAspCore.Data;
using CleanAspCore.TestUtils.DataBaseSetup;
using Microsoft.AspNetCore.Mvc.Testing;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net9.0</TargetFramework>
<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
Expand All @@ -13,7 +12,7 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\CleanAspCore.Api.TestUtils\CleanAspCore.Api.TestUtils.csproj"/>
<ProjectReference Include="..\CleanAspCore.TestUtils\CleanAspCore.TestUtils.csproj"/>
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System.Diagnostics.CodeAnalysis;
using CleanAspCore.Api.TestDataGenerator;
using CleanAspCore.Data;
using CleanAspCore.Data.Extensions;
using CleanAspCore.TestDataGenerator;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using CleanAspCore.Data.Extensions;
using Microsoft.Extensions.Hosting;

namespace CleanAspCore.Api.TestDataGenerator;
namespace CleanAspCore.TestDataGenerator;

internal sealed class TestDataGeneratorService(HrContext context, IHostApplicationLifetime lifetime) : IHostedService
{
Expand Down
File renamed without changes.
Loading

0 comments on commit d22bcc9

Please sign in to comment.