From 87d11efcb449e6eca1aa734e9a9a987e89a045bf Mon Sep 17 00:00:00 2001 From: Humberto Rodrigues Date: Wed, 16 Mar 2022 01:19:46 -0400 Subject: [PATCH] rename projects to Store (#4) --- .github/workflows/build.yml | 8 +- PubDev.UnitTest.sln => PubDev.Store.sln | 25 +++--- README.md | 3 +- .../20220308070017_Initial.Designer.cs | 28 +++---- .../Migrations/20220308070017_Initial.cs | 2 +- .../PubDevDbContextModelSnapshot.cs | 28 +++---- .../Configuration/PubDevDbContext.cs | 2 +- .../Tables/ClientConfiguration.cs | 4 +- .../Tables/OrderConfiguration.cs | 4 +- .../Tables/OrderProductConfiguration.cs | 4 +- .../Tables/ProductConfiguration.cs | 4 +- .../Controllers/ClientController.cs | 12 +-- .../Controllers/OrderController.cs | 12 +-- .../Controllers/ProductController.cs | 12 +-- .../Entities/BaseEntity.cs | 2 +- .../Entities/Client.cs | 2 +- .../Entities/Order.cs | 2 +- .../Entities/OrderProduct.cs | 2 +- .../Entities/Product.cs | 2 +- .../Enums/ErrorType.cs | 2 +- .../ErrorMessage.cs | 4 +- .../Interfaces/Presenters/IPresenter.cs | 2 +- .../Repositories/IClientRepository.cs | 4 +- .../Repositories/IOrderProductRepository.cs | 4 +- .../Repositories/IOrderRepository.cs | 4 +- .../Repositories/IProductRepository.cs | 4 +- .../Interfaces/Services/IClientService.cs | 4 +- .../Interfaces/Services/IOrderService.cs | 4 +- .../Interfaces/Services/IProductService.cs | 4 +- .../Messages/Error.cs | 2 +- .../Middlewares/ExceptionMiddleware.cs | 4 +- .../NotificationContext.cs | 4 +- .../Presenters/Presenter.cs | 8 +- src/{PubDev.UnitTests.API => API}/Program.cs | 10 +-- .../Properties/launchSettings.json | 0 .../Providers/PersistenceConfiguration.cs | 4 +- .../Providers/RepositoriesConfiguration.cs | 6 +- .../Providers/ServicesConfiguration.cs | 6 +- .../PubDev.Store.API.csproj} | 0 .../Repositories/ClientRepository.cs | 6 +- .../Repositories/OrderProductRepository.cs | 6 +- .../Repositories/OrderRepository.cs | 6 +- .../Repositories/ProductRepository.cs | 6 +- .../Requests/ClientCreateRequest.cs | 4 +- .../Requests/ClientPatchRequest.cs | 4 +- .../Requests/OrderCreateRequest.cs | 4 +- .../Requests/OrderProductRequest.cs | 4 +- .../Requests/ProductCreateRequest.cs | 4 +- .../Requests/ProductPatchRequest.cs | 4 +- .../Responses/ClientGetAllResponse.cs | 4 +- .../Responses/ClientGetByIdResponse.cs | 4 +- .../Responses/ClientPatchResponse.cs | 4 +- .../Responses/ClientResponse.cs | 4 +- .../Responses/CreateClientResponse.cs | 4 +- .../Responses/ErrorMessageResponse.cs | 2 +- .../Responses/ErrorResponse.cs | 2 +- .../Responses/OrderCreateResponse.cs | 4 +- .../Responses/OrderGetByIdResponse.cs | 4 +- .../Responses/OrderProductResponse.cs | 4 +- .../Responses/ProductCreateResponse.cs | 4 +- .../Responses/ProductGetAllResponse.cs | 4 +- .../Responses/ProductGetByIdResponse.cs | 4 +- .../Responses/ProductPatchResponse.cs | 4 +- .../Responses/ProductResponse.cs | 4 +- .../Services/ClientService.cs | 10 +-- .../Services/OrderService.cs | 10 +-- .../Services/ProductService.cs | 12 +-- .../appsettings.Development.json | 0 .../appsettings.json | 0 tests/API.Tests/GlobalUsings.cs | 9 ++ .../PubDev.Store.API.Tests.csproj} | 6 +- .../Services/ClientServiceTest.cs | 2 +- .../Services/OrderServiceTest.cs | 2 +- .../Services/ProductServiceTest.cs | 83 ++++++++++++------- .../GlobalUsings.cs | 9 -- 75 files changed, 252 insertions(+), 233 deletions(-) rename PubDev.UnitTest.sln => PubDev.Store.sln (58%) rename src/{PubDev.UnitTests.API => API}/Configuration/Migrations/20220308070017_Initial.Designer.cs (84%) rename src/{PubDev.UnitTests.API => API}/Configuration/Migrations/20220308070017_Initial.cs (98%) rename src/{PubDev.UnitTests.API => API}/Configuration/Migrations/PubDevDbContextModelSnapshot.cs (84%) rename src/{PubDev.UnitTests.API => API}/Configuration/PubDevDbContext.cs (90%) rename src/{PubDev.UnitTests.API => API}/Configuration/Tables/ClientConfiguration.cs (88%) rename src/{PubDev.UnitTests.API => API}/Configuration/Tables/OrderConfiguration.cs (90%) rename src/{PubDev.UnitTests.API => API}/Configuration/Tables/OrderProductConfiguration.cs (93%) rename src/{PubDev.UnitTests.API => API}/Configuration/Tables/ProductConfiguration.cs (90%) rename src/{PubDev.UnitTests.API => API}/Controllers/ClientController.cs (91%) rename src/{PubDev.UnitTests.API => API}/Controllers/OrderController.cs (87%) rename src/{PubDev.UnitTests.API => API}/Controllers/ProductController.cs (91%) rename src/{PubDev.UnitTests.API => API}/Entities/BaseEntity.cs (62%) rename src/{PubDev.UnitTests.API => API}/Entities/Client.cs (79%) rename src/{PubDev.UnitTests.API => API}/Entities/Order.cs (84%) rename src/{PubDev.UnitTests.API => API}/Entities/OrderProduct.cs (86%) rename src/{PubDev.UnitTests.API => API}/Entities/Product.cs (84%) rename src/{PubDev.UnitTests.API => API}/Enums/ErrorType.cs (57%) rename src/{PubDev.UnitTests.API => API}/ErrorMessage.cs (83%) rename src/{PubDev.UnitTests.API => API}/Interfaces/Presenters/IPresenter.cs (93%) rename src/{PubDev.UnitTests.API => API}/Interfaces/Repositories/IClientRepository.cs (70%) rename src/{PubDev.UnitTests.API => API}/Interfaces/Repositories/IOrderProductRepository.cs (55%) rename src/{PubDev.UnitTests.API => API}/Interfaces/Repositories/IOrderRepository.cs (64%) rename src/{PubDev.UnitTests.API => API}/Interfaces/Repositories/IProductRepository.cs (70%) rename src/{PubDev.UnitTests.API => API}/Interfaces/Services/IClientService.cs (70%) rename src/{PubDev.UnitTests.API => API}/Interfaces/Services/IOrderService.cs (64%) rename src/{PubDev.UnitTests.API => API}/Interfaces/Services/IProductService.cs (71%) rename src/{PubDev.UnitTests.API => API}/Messages/Error.cs (94%) rename src/{PubDev.UnitTests.API => API}/Middlewares/ExceptionMiddleware.cs (95%) rename src/{PubDev.UnitTests.API => API}/NotificationContext.cs (95%) rename src/{PubDev.UnitTests.API => API}/Presenters/Presenter.cs (93%) rename src/{PubDev.UnitTests.API => API}/Program.cs (88%) rename src/{PubDev.UnitTests.API => API}/Properties/launchSettings.json (100%) rename src/{PubDev.UnitTests.API => API}/Providers/PersistenceConfiguration.cs (89%) rename src/{PubDev.UnitTests.API => API}/Providers/RepositoriesConfiguration.cs (76%) rename src/{PubDev.UnitTests.API => API}/Providers/ServicesConfiguration.cs (73%) rename src/{PubDev.UnitTests.API/PubDev.UnitTests.API.csproj => API/PubDev.Store.API.csproj} (100%) rename src/{PubDev.UnitTests.API => API}/Repositories/ClientRepository.cs (92%) rename src/{PubDev.UnitTests.API => API}/Repositories/OrderProductRepository.cs (83%) rename src/{PubDev.UnitTests.API => API}/Repositories/OrderRepository.cs (96%) rename src/{PubDev.UnitTests.API => API}/Repositories/ProductRepository.cs (93%) rename src/{PubDev.UnitTests.API => API}/Requests/ClientCreateRequest.cs (78%) rename src/{PubDev.UnitTests.API => API}/Requests/ClientPatchRequest.cs (75%) rename src/{PubDev.UnitTests.API => API}/Requests/OrderCreateRequest.cs (83%) rename src/{PubDev.UnitTests.API => API}/Requests/OrderProductRequest.cs (81%) rename src/{PubDev.UnitTests.API => API}/Requests/ProductCreateRequest.cs (81%) rename src/{PubDev.UnitTests.API => API}/Requests/ProductPatchRequest.cs (81%) rename src/{PubDev.UnitTests.API => API}/Responses/ClientGetAllResponse.cs (83%) rename src/{PubDev.UnitTests.API => API}/Responses/ClientGetByIdResponse.cs (83%) rename src/{PubDev.UnitTests.API => API}/Responses/ClientPatchResponse.cs (83%) rename src/{PubDev.UnitTests.API => API}/Responses/ClientResponse.cs (78%) rename src/{PubDev.UnitTests.API => API}/Responses/CreateClientResponse.cs (83%) rename src/{PubDev.UnitTests.API => API}/Responses/ErrorMessageResponse.cs (88%) rename src/{PubDev.UnitTests.API => API}/Responses/ErrorResponse.cs (89%) rename src/{PubDev.UnitTests.API => API}/Responses/OrderCreateResponse.cs (88%) rename src/{PubDev.UnitTests.API => API}/Responses/OrderGetByIdResponse.cs (88%) rename src/{PubDev.UnitTests.API => API}/Responses/OrderProductResponse.cs (83%) rename src/{PubDev.UnitTests.API => API}/Responses/ProductCreateResponse.cs (85%) rename src/{PubDev.UnitTests.API => API}/Responses/ProductGetAllResponse.cs (85%) rename src/{PubDev.UnitTests.API => API}/Responses/ProductGetByIdResponse.cs (85%) rename src/{PubDev.UnitTests.API => API}/Responses/ProductPatchResponse.cs (85%) rename src/{PubDev.UnitTests.API => API}/Responses/ProductResponse.cs (82%) rename src/{PubDev.UnitTests.API => API}/Services/ClientService.cs (86%) rename src/{PubDev.UnitTests.API => API}/Services/OrderService.cs (93%) rename src/{PubDev.UnitTests.API => API}/Services/ProductService.cs (83%) rename src/{PubDev.UnitTests.API => API}/appsettings.Development.json (100%) rename src/{PubDev.UnitTests.API => API}/appsettings.json (100%) create mode 100644 tests/API.Tests/GlobalUsings.cs rename tests/{PubDev.UnitTests.API.Tests/PubDev.UnitTests.API.Tests.csproj => API.Tests/PubDev.Store.API.Tests.csproj} (74%) rename tests/{PubDev.UnitTests.API.Tests => API.Tests}/Services/ClientServiceTest.cs (98%) rename tests/{PubDev.UnitTests.API.Tests => API.Tests}/Services/OrderServiceTest.cs (99%) rename tests/{PubDev.UnitTests.API.Tests => API.Tests}/Services/ProductServiceTest.cs (84%) delete mode 100644 tests/PubDev.UnitTests.API.Tests/GlobalUsings.cs diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 23455a7..8b53b7a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -20,13 +20,13 @@ jobs: dotnet-version: 6.0.x - name: Restore dependencies - run: dotnet restore ./PubDev.UnitTest.sln + run: dotnet restore ./PubDev.Store.sln - name: Build - run: dotnet build ./PubDev.UnitTest.sln --no-restore + run: dotnet build ./PubDev.Store.sln --no-restore - name: Test - run: dotnet test ./PubDev.UnitTest.sln /p:CollectCoverage=true /p:CoverletOutputFormat=opencover + run: dotnet test ./PubDev.Store.sln /p:CollectCoverage=true /p:CoverletOutputFormat=opencover - name: Set up JDK 11 uses: actions/setup-java@v1 @@ -62,5 +62,5 @@ jobs: shell: pwsh run: | ./.sonar/scanner/dotnet-sonarscanner begin /k:"Pub-Dev_Lesson-DotNet-UnitTest" /o:"pub-dev" /d:sonar.login="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" - dotnet build ./PubDev.UnitTest.sln --no-restore + dotnet build ./PubDev.Store.sln --no-restore ./.sonar/scanner/dotnet-sonarscanner end /d:sonar.login="${{ secrets.SONAR_TOKEN }}" diff --git a/PubDev.UnitTest.sln b/PubDev.Store.sln similarity index 58% rename from PubDev.UnitTest.sln rename to PubDev.Store.sln index 95c0e38..8c505c7 100644 --- a/PubDev.UnitTest.sln +++ b/PubDev.Store.sln @@ -9,13 +9,14 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{121BD010 EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{EA9921F2-52AD-4934-A29A-4C3E160858D8}" ProjectSection(SolutionItems) = preProject + .github\workflows\build.yml = .github\workflows\build.yml docker-compose.yml = docker-compose.yml README.md = README.md EndProjectSection EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PubDev.UnitTests.API", "src\PubDev.UnitTests.API\PubDev.UnitTests.API.csproj", "{F50E1378-5553-4042-BFCF-4DD38AB4B200}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PubDev.Store.API.Tests", "tests\API.Tests\PubDev.Store.API.Tests.csproj", "{912FFF3C-7C09-4361-93C1-00B295035B39}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PubDev.UnitTests.API.Tests", "tests\PubDev.UnitTests.API.Tests\PubDev.UnitTests.API.Tests.csproj", "{88808EA3-F60A-4190-A3DF-0D2BA62DF69A}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PubDev.Store.API", "src\API\PubDev.Store.API.csproj", "{031A81AC-5AA3-4AB9-B8B5-159FF59C4706}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -23,21 +24,21 @@ Global Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {F50E1378-5553-4042-BFCF-4DD38AB4B200}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F50E1378-5553-4042-BFCF-4DD38AB4B200}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F50E1378-5553-4042-BFCF-4DD38AB4B200}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F50E1378-5553-4042-BFCF-4DD38AB4B200}.Release|Any CPU.Build.0 = Release|Any CPU - {88808EA3-F60A-4190-A3DF-0D2BA62DF69A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {88808EA3-F60A-4190-A3DF-0D2BA62DF69A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {88808EA3-F60A-4190-A3DF-0D2BA62DF69A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {88808EA3-F60A-4190-A3DF-0D2BA62DF69A}.Release|Any CPU.Build.0 = Release|Any CPU + {912FFF3C-7C09-4361-93C1-00B295035B39}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {912FFF3C-7C09-4361-93C1-00B295035B39}.Debug|Any CPU.Build.0 = Debug|Any CPU + {912FFF3C-7C09-4361-93C1-00B295035B39}.Release|Any CPU.ActiveCfg = Release|Any CPU + {912FFF3C-7C09-4361-93C1-00B295035B39}.Release|Any CPU.Build.0 = Release|Any CPU + {031A81AC-5AA3-4AB9-B8B5-159FF59C4706}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {031A81AC-5AA3-4AB9-B8B5-159FF59C4706}.Debug|Any CPU.Build.0 = Debug|Any CPU + {031A81AC-5AA3-4AB9-B8B5-159FF59C4706}.Release|Any CPU.ActiveCfg = Release|Any CPU + {031A81AC-5AA3-4AB9-B8B5-159FF59C4706}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection GlobalSection(NestedProjects) = preSolution - {F50E1378-5553-4042-BFCF-4DD38AB4B200} = {F3D09DE2-DC76-4250-9D3B-E54B591418DD} - {88808EA3-F60A-4190-A3DF-0D2BA62DF69A} = {121BD010-29A8-4E58-B462-EEF6CB0F84F3} + {912FFF3C-7C09-4361-93C1-00B295035B39} = {121BD010-29A8-4E58-B462-EEF6CB0F84F3} + {031A81AC-5AA3-4AB9-B8B5-159FF59C4706} = {F3D09DE2-DC76-4250-9D3B-E54B591418DD} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {E80A9564-D0A6-47AE-94E2-09F4BD3DB6F5} diff --git a/README.md b/README.md index daf3221..9ee596e 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ [![Lines of Code](https://sonarcloud.io/api/project_badges/measure?project=Pub-Dev_Lesson-DotNet-UnitTest&metric=ncloc)](https://sonarcloud.io/summary/new_code?id=Pub-Dev_Lesson-DotNet-UnitTest) [![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=Pub-Dev_Lesson-DotNet-UnitTest&metric=reliability_rating)](https://sonarcloud.io/summary/new_code?id=Pub-Dev_Lesson-DotNet-UnitTest) -## Pub Dev Unit Tests 📚🕹 +## Pub Dev Store 📚🕹 this read-me still under development, We had time to develop the whole solution but not to create a good read-me 😜 @@ -44,7 +44,6 @@ dotnet test /p:CollectCoverage=true /p:CoverletOutputFormat=opencover ## Roadmap -- Create git actions to build and test - Ran out of Ideas 🤣, feel free to add one See the [open issues](https://github.com/Pub-Dev/Lesson-DotNet-UnitTest/issues) for a full list of proposed features (and known issues). diff --git a/src/PubDev.UnitTests.API/Configuration/Migrations/20220308070017_Initial.Designer.cs b/src/API/Configuration/Migrations/20220308070017_Initial.Designer.cs similarity index 84% rename from src/PubDev.UnitTests.API/Configuration/Migrations/20220308070017_Initial.Designer.cs rename to src/API/Configuration/Migrations/20220308070017_Initial.Designer.cs index 92a5153..b7fd7ba 100644 --- a/src/PubDev.UnitTests.API/Configuration/Migrations/20220308070017_Initial.Designer.cs +++ b/src/API/Configuration/Migrations/20220308070017_Initial.Designer.cs @@ -5,11 +5,11 @@ using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using PubDev.UnitTests.API.Configuration; +using PubDev.Store.API.Configuration; #nullable disable -namespace PubDev.UnitTests.API.Configuration.Migrations +namespace PubDev.Store.API.Configuration.Migrations { [DbContext(typeof(PubDevDbContext))] [Migration("20220308070017_Initial")] @@ -24,7 +24,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder, 1L, 1); - modelBuilder.Entity("PubDev.UnitTests.API.Entities.Client", b => + modelBuilder.Entity("PubDev.Store.API.Entities.Client", b => { b.Property("ClientId") .ValueGeneratedOnAdd() @@ -48,7 +48,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.ToTable("Client", (string)null); }); - modelBuilder.Entity("PubDev.UnitTests.API.Entities.Order", b => + modelBuilder.Entity("PubDev.Store.API.Entities.Order", b => { b.Property("OrderId") .ValueGeneratedOnAdd() @@ -72,7 +72,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.ToTable("Order", (string)null); }); - modelBuilder.Entity("PubDev.UnitTests.API.Entities.OrderProduct", b => + modelBuilder.Entity("PubDev.Store.API.Entities.OrderProduct", b => { b.Property("OrderProductId") .ValueGeneratedOnAdd() @@ -105,7 +105,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.ToTable("OrderProduct", (string)null); }); - modelBuilder.Entity("PubDev.UnitTests.API.Entities.Product", b => + modelBuilder.Entity("PubDev.Store.API.Entities.Product", b => { b.Property("ProductId") .ValueGeneratedOnAdd() @@ -132,9 +132,9 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.ToTable("Product", (string)null); }); - modelBuilder.Entity("PubDev.UnitTests.API.Entities.Order", b => + modelBuilder.Entity("PubDev.Store.API.Entities.Order", b => { - b.HasOne("PubDev.UnitTests.API.Entities.Client", "Client") + b.HasOne("PubDev.Store.API.Entities.Client", "Client") .WithMany("Orders") .HasForeignKey("ClientId") .OnDelete(DeleteBehavior.Cascade) @@ -144,16 +144,16 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.Navigation("Client"); }); - modelBuilder.Entity("PubDev.UnitTests.API.Entities.OrderProduct", b => + modelBuilder.Entity("PubDev.Store.API.Entities.OrderProduct", b => { - b.HasOne("PubDev.UnitTests.API.Entities.Order", "Order") + b.HasOne("PubDev.Store.API.Entities.Order", "Order") .WithMany("OrderProducts") .HasForeignKey("OrderId") .OnDelete(DeleteBehavior.Cascade) .IsRequired() .HasConstraintName("FK_OrderProduct_Order_OrderId"); - b.HasOne("PubDev.UnitTests.API.Entities.Product", "Product") + b.HasOne("PubDev.Store.API.Entities.Product", "Product") .WithMany("OrderProducts") .HasForeignKey("ProductId") .OnDelete(DeleteBehavior.Cascade) @@ -165,17 +165,17 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.Navigation("Product"); }); - modelBuilder.Entity("PubDev.UnitTests.API.Entities.Client", b => + modelBuilder.Entity("PubDev.Store.API.Entities.Client", b => { b.Navigation("Orders"); }); - modelBuilder.Entity("PubDev.UnitTests.API.Entities.Order", b => + modelBuilder.Entity("PubDev.Store.API.Entities.Order", b => { b.Navigation("OrderProducts"); }); - modelBuilder.Entity("PubDev.UnitTests.API.Entities.Product", b => + modelBuilder.Entity("PubDev.Store.API.Entities.Product", b => { b.Navigation("OrderProducts"); }); diff --git a/src/PubDev.UnitTests.API/Configuration/Migrations/20220308070017_Initial.cs b/src/API/Configuration/Migrations/20220308070017_Initial.cs similarity index 98% rename from src/PubDev.UnitTests.API/Configuration/Migrations/20220308070017_Initial.cs rename to src/API/Configuration/Migrations/20220308070017_Initial.cs index 439c4dc..e9f9309 100644 --- a/src/PubDev.UnitTests.API/Configuration/Migrations/20220308070017_Initial.cs +++ b/src/API/Configuration/Migrations/20220308070017_Initial.cs @@ -3,7 +3,7 @@ #nullable disable -namespace PubDev.UnitTests.API.Configuration.Migrations +namespace PubDev.Store.API.Configuration.Migrations { public partial class Initial : Migration { diff --git a/src/PubDev.UnitTests.API/Configuration/Migrations/PubDevDbContextModelSnapshot.cs b/src/API/Configuration/Migrations/PubDevDbContextModelSnapshot.cs similarity index 84% rename from src/PubDev.UnitTests.API/Configuration/Migrations/PubDevDbContextModelSnapshot.cs rename to src/API/Configuration/Migrations/PubDevDbContextModelSnapshot.cs index 4540d05..066bd42 100644 --- a/src/PubDev.UnitTests.API/Configuration/Migrations/PubDevDbContextModelSnapshot.cs +++ b/src/API/Configuration/Migrations/PubDevDbContextModelSnapshot.cs @@ -4,11 +4,11 @@ using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using PubDev.UnitTests.API.Configuration; +using PubDev.Store.API.Configuration; #nullable disable -namespace PubDev.UnitTests.API.Configuration.Migrations +namespace PubDev.Store.API.Configuration.Migrations { [DbContext(typeof(PubDevDbContext))] partial class PubDevDbContextModelSnapshot : ModelSnapshot @@ -22,7 +22,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder, 1L, 1); - modelBuilder.Entity("PubDev.UnitTests.API.Entities.Client", b => + modelBuilder.Entity("PubDev.Store.API.Entities.Client", b => { b.Property("ClientId") .ValueGeneratedOnAdd() @@ -46,7 +46,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.ToTable("Client", (string)null); }); - modelBuilder.Entity("PubDev.UnitTests.API.Entities.Order", b => + modelBuilder.Entity("PubDev.Store.API.Entities.Order", b => { b.Property("OrderId") .ValueGeneratedOnAdd() @@ -70,7 +70,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.ToTable("Order", (string)null); }); - modelBuilder.Entity("PubDev.UnitTests.API.Entities.OrderProduct", b => + modelBuilder.Entity("PubDev.Store.API.Entities.OrderProduct", b => { b.Property("OrderProductId") .ValueGeneratedOnAdd() @@ -103,7 +103,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.ToTable("OrderProduct", (string)null); }); - modelBuilder.Entity("PubDev.UnitTests.API.Entities.Product", b => + modelBuilder.Entity("PubDev.Store.API.Entities.Product", b => { b.Property("ProductId") .ValueGeneratedOnAdd() @@ -130,9 +130,9 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.ToTable("Product", (string)null); }); - modelBuilder.Entity("PubDev.UnitTests.API.Entities.Order", b => + modelBuilder.Entity("PubDev.Store.API.Entities.Order", b => { - b.HasOne("PubDev.UnitTests.API.Entities.Client", "Client") + b.HasOne("PubDev.Store.API.Entities.Client", "Client") .WithMany("Orders") .HasForeignKey("ClientId") .OnDelete(DeleteBehavior.Cascade) @@ -142,16 +142,16 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Navigation("Client"); }); - modelBuilder.Entity("PubDev.UnitTests.API.Entities.OrderProduct", b => + modelBuilder.Entity("PubDev.Store.API.Entities.OrderProduct", b => { - b.HasOne("PubDev.UnitTests.API.Entities.Order", "Order") + b.HasOne("PubDev.Store.API.Entities.Order", "Order") .WithMany("OrderProducts") .HasForeignKey("OrderId") .OnDelete(DeleteBehavior.Cascade) .IsRequired() .HasConstraintName("FK_OrderProduct_Order_OrderId"); - b.HasOne("PubDev.UnitTests.API.Entities.Product", "Product") + b.HasOne("PubDev.Store.API.Entities.Product", "Product") .WithMany("OrderProducts") .HasForeignKey("ProductId") .OnDelete(DeleteBehavior.Cascade) @@ -163,17 +163,17 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Navigation("Product"); }); - modelBuilder.Entity("PubDev.UnitTests.API.Entities.Client", b => + modelBuilder.Entity("PubDev.Store.API.Entities.Client", b => { b.Navigation("Orders"); }); - modelBuilder.Entity("PubDev.UnitTests.API.Entities.Order", b => + modelBuilder.Entity("PubDev.Store.API.Entities.Order", b => { b.Navigation("OrderProducts"); }); - modelBuilder.Entity("PubDev.UnitTests.API.Entities.Product", b => + modelBuilder.Entity("PubDev.Store.API.Entities.Product", b => { b.Navigation("OrderProducts"); }); diff --git a/src/PubDev.UnitTests.API/Configuration/PubDevDbContext.cs b/src/API/Configuration/PubDevDbContext.cs similarity index 90% rename from src/PubDev.UnitTests.API/Configuration/PubDevDbContext.cs rename to src/API/Configuration/PubDevDbContext.cs index 1195bb3..bf1973e 100644 --- a/src/PubDev.UnitTests.API/Configuration/PubDevDbContext.cs +++ b/src/API/Configuration/PubDevDbContext.cs @@ -1,7 +1,7 @@ using Microsoft.EntityFrameworkCore; using System.Diagnostics.CodeAnalysis; -namespace PubDev.UnitTests.API.Configuration; +namespace PubDev.Store.API.Configuration; [ExcludeFromCodeCoverage] public class PubDevDbContext : DbContext diff --git a/src/PubDev.UnitTests.API/Configuration/Tables/ClientConfiguration.cs b/src/API/Configuration/Tables/ClientConfiguration.cs similarity index 88% rename from src/PubDev.UnitTests.API/Configuration/Tables/ClientConfiguration.cs rename to src/API/Configuration/Tables/ClientConfiguration.cs index b7c8260..70b3710 100644 --- a/src/PubDev.UnitTests.API/Configuration/Tables/ClientConfiguration.cs +++ b/src/API/Configuration/Tables/ClientConfiguration.cs @@ -1,8 +1,8 @@ using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Metadata.Builders; -using PubDev.UnitTests.API.Entities; +using PubDev.Store.API.Entities; -namespace PubDev.UnitTests.API.Configuration.Tables; +namespace PubDev.Store.API.Configuration.Tables; public class ClientConfiguration : IEntityTypeConfiguration { diff --git a/src/PubDev.UnitTests.API/Configuration/Tables/OrderConfiguration.cs b/src/API/Configuration/Tables/OrderConfiguration.cs similarity index 90% rename from src/PubDev.UnitTests.API/Configuration/Tables/OrderConfiguration.cs rename to src/API/Configuration/Tables/OrderConfiguration.cs index ecbbfff..84eb2ba 100644 --- a/src/PubDev.UnitTests.API/Configuration/Tables/OrderConfiguration.cs +++ b/src/API/Configuration/Tables/OrderConfiguration.cs @@ -1,8 +1,8 @@ using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Metadata.Builders; -using PubDev.UnitTests.API.Entities; +using PubDev.Store.API.Entities; -namespace PubDev.UnitTests.API.Configuration.Tables; +namespace PubDev.Store.API.Configuration.Tables; public class OrderConfiguration : IEntityTypeConfiguration { diff --git a/src/PubDev.UnitTests.API/Configuration/Tables/OrderProductConfiguration.cs b/src/API/Configuration/Tables/OrderProductConfiguration.cs similarity index 93% rename from src/PubDev.UnitTests.API/Configuration/Tables/OrderProductConfiguration.cs rename to src/API/Configuration/Tables/OrderProductConfiguration.cs index 08d61f0..0a0b8fc 100644 --- a/src/PubDev.UnitTests.API/Configuration/Tables/OrderProductConfiguration.cs +++ b/src/API/Configuration/Tables/OrderProductConfiguration.cs @@ -1,8 +1,8 @@ using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Metadata.Builders; -using PubDev.UnitTests.API.Entities; +using PubDev.Store.API.Entities; -namespace PubDev.UnitTests.API.Configuration.Tables; +namespace PubDev.Store.API.Configuration.Tables; public class OrderProductConfiguration : IEntityTypeConfiguration { diff --git a/src/PubDev.UnitTests.API/Configuration/Tables/ProductConfiguration.cs b/src/API/Configuration/Tables/ProductConfiguration.cs similarity index 90% rename from src/PubDev.UnitTests.API/Configuration/Tables/ProductConfiguration.cs rename to src/API/Configuration/Tables/ProductConfiguration.cs index 1b3ebfa..aa267fc 100644 --- a/src/PubDev.UnitTests.API/Configuration/Tables/ProductConfiguration.cs +++ b/src/API/Configuration/Tables/ProductConfiguration.cs @@ -1,8 +1,8 @@ using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Metadata.Builders; -using PubDev.UnitTests.API.Entities; +using PubDev.Store.API.Entities; -namespace PubDev.UnitTests.API.Configuration.Tables; +namespace PubDev.Store.API.Configuration.Tables; public class ProductConfiguration : IEntityTypeConfiguration { diff --git a/src/PubDev.UnitTests.API/Controllers/ClientController.cs b/src/API/Controllers/ClientController.cs similarity index 91% rename from src/PubDev.UnitTests.API/Controllers/ClientController.cs rename to src/API/Controllers/ClientController.cs index 089e7f2..2fa6420 100644 --- a/src/PubDev.UnitTests.API/Controllers/ClientController.cs +++ b/src/API/Controllers/ClientController.cs @@ -1,12 +1,12 @@ using Microsoft.AspNetCore.Mvc; -using PubDev.UnitTests.API.Entities; -using PubDev.UnitTests.API.Interfaces.Presenters; -using PubDev.UnitTests.API.Interfaces.Services; -using PubDev.UnitTests.API.Requests; -using PubDev.UnitTests.API.Responses; +using PubDev.Store.API.Entities; +using PubDev.Store.API.Interfaces.Presenters; +using PubDev.Store.API.Interfaces.Services; +using PubDev.Store.API.Requests; +using PubDev.Store.API.Responses; using System.Net; -namespace PubDev.UnitTests.API.Controllers; +namespace PubDev.Store.API.Controllers; [ApiController] [Route("clients")] diff --git a/src/PubDev.UnitTests.API/Controllers/OrderController.cs b/src/API/Controllers/OrderController.cs similarity index 87% rename from src/PubDev.UnitTests.API/Controllers/OrderController.cs rename to src/API/Controllers/OrderController.cs index 8c2909a..5f8f2c7 100644 --- a/src/PubDev.UnitTests.API/Controllers/OrderController.cs +++ b/src/API/Controllers/OrderController.cs @@ -1,12 +1,12 @@ using Microsoft.AspNetCore.Mvc; -using PubDev.UnitTests.API.Entities; -using PubDev.UnitTests.API.Interfaces.Presenters; -using PubDev.UnitTests.API.Interfaces.Services; -using PubDev.UnitTests.API.Requests; -using PubDev.UnitTests.API.Responses; +using PubDev.Store.API.Entities; +using PubDev.Store.API.Interfaces.Presenters; +using PubDev.Store.API.Interfaces.Services; +using PubDev.Store.API.Requests; +using PubDev.Store.API.Responses; using System.Net; -namespace PubDev.UnitTests.API.Controllers; +namespace PubDev.Store.API.Controllers; [ApiController] [Route("orders")] diff --git a/src/PubDev.UnitTests.API/Controllers/ProductController.cs b/src/API/Controllers/ProductController.cs similarity index 91% rename from src/PubDev.UnitTests.API/Controllers/ProductController.cs rename to src/API/Controllers/ProductController.cs index 7d1f8cd..e53fb9c 100644 --- a/src/PubDev.UnitTests.API/Controllers/ProductController.cs +++ b/src/API/Controllers/ProductController.cs @@ -1,12 +1,12 @@ using Microsoft.AspNetCore.Mvc; -using PubDev.UnitTests.API.Entities; -using PubDev.UnitTests.API.Interfaces.Presenters; -using PubDev.UnitTests.API.Interfaces.Services; -using PubDev.UnitTests.API.Requests; -using PubDev.UnitTests.API.Responses; +using PubDev.Store.API.Entities; +using PubDev.Store.API.Interfaces.Presenters; +using PubDev.Store.API.Interfaces.Services; +using PubDev.Store.API.Requests; +using PubDev.Store.API.Responses; using System.Net; -namespace PubDev.UnitTests.API.Controllers; +namespace PubDev.Store.API.Controllers; [ApiController] [Route("products")] diff --git a/src/PubDev.UnitTests.API/Entities/BaseEntity.cs b/src/API/Entities/BaseEntity.cs similarity index 62% rename from src/PubDev.UnitTests.API/Entities/BaseEntity.cs rename to src/API/Entities/BaseEntity.cs index 80b4af5..c840a0b 100644 --- a/src/PubDev.UnitTests.API/Entities/BaseEntity.cs +++ b/src/API/Entities/BaseEntity.cs @@ -1,4 +1,4 @@ -namespace PubDev.UnitTests.API.Entities; +namespace PubDev.Store.API.Entities; public class BaseEntity { diff --git a/src/PubDev.UnitTests.API/Entities/Client.cs b/src/API/Entities/Client.cs similarity index 79% rename from src/PubDev.UnitTests.API/Entities/Client.cs rename to src/API/Entities/Client.cs index 95d434f..f8820c5 100644 --- a/src/PubDev.UnitTests.API/Entities/Client.cs +++ b/src/API/Entities/Client.cs @@ -1,4 +1,4 @@ -namespace PubDev.UnitTests.API.Entities; +namespace PubDev.Store.API.Entities; public class Client : BaseEntity { diff --git a/src/PubDev.UnitTests.API/Entities/Order.cs b/src/API/Entities/Order.cs similarity index 84% rename from src/PubDev.UnitTests.API/Entities/Order.cs rename to src/API/Entities/Order.cs index eb1c280..3c22380 100644 --- a/src/PubDev.UnitTests.API/Entities/Order.cs +++ b/src/API/Entities/Order.cs @@ -1,4 +1,4 @@ -namespace PubDev.UnitTests.API.Entities; +namespace PubDev.Store.API.Entities; public class Order : BaseEntity { diff --git a/src/PubDev.UnitTests.API/Entities/OrderProduct.cs b/src/API/Entities/OrderProduct.cs similarity index 86% rename from src/PubDev.UnitTests.API/Entities/OrderProduct.cs rename to src/API/Entities/OrderProduct.cs index f20da0f..43f65fa 100644 --- a/src/PubDev.UnitTests.API/Entities/OrderProduct.cs +++ b/src/API/Entities/OrderProduct.cs @@ -1,4 +1,4 @@ -namespace PubDev.UnitTests.API.Entities; +namespace PubDev.Store.API.Entities; public class OrderProduct : BaseEntity { diff --git a/src/PubDev.UnitTests.API/Entities/Product.cs b/src/API/Entities/Product.cs similarity index 84% rename from src/PubDev.UnitTests.API/Entities/Product.cs rename to src/API/Entities/Product.cs index ec4873b..c3004d7 100644 --- a/src/PubDev.UnitTests.API/Entities/Product.cs +++ b/src/API/Entities/Product.cs @@ -1,4 +1,4 @@ -namespace PubDev.UnitTests.API.Entities; +namespace PubDev.Store.API.Entities; public class Product : BaseEntity { diff --git a/src/PubDev.UnitTests.API/Enums/ErrorType.cs b/src/API/Enums/ErrorType.cs similarity index 57% rename from src/PubDev.UnitTests.API/Enums/ErrorType.cs rename to src/API/Enums/ErrorType.cs index 247b9db..b371580 100644 --- a/src/PubDev.UnitTests.API/Enums/ErrorType.cs +++ b/src/API/Enums/ErrorType.cs @@ -1,4 +1,4 @@ -namespace PubDev.UnitTests.API.Enums; +namespace PubDev.Store.API.Enums; public enum ErrorType { diff --git a/src/PubDev.UnitTests.API/ErrorMessage.cs b/src/API/ErrorMessage.cs similarity index 83% rename from src/PubDev.UnitTests.API/ErrorMessage.cs rename to src/API/ErrorMessage.cs index a157e19..d66219d 100644 --- a/src/PubDev.UnitTests.API/ErrorMessage.cs +++ b/src/API/ErrorMessage.cs @@ -1,6 +1,6 @@ -using PubDev.UnitTests.API.Enums; +using PubDev.Store.API.Enums; -namespace PubDev.UnitTests.API; +namespace PubDev.Store.API; public struct ErrorMessage { diff --git a/src/PubDev.UnitTests.API/Interfaces/Presenters/IPresenter.cs b/src/API/Interfaces/Presenters/IPresenter.cs similarity index 93% rename from src/PubDev.UnitTests.API/Interfaces/Presenters/IPresenter.cs rename to src/API/Interfaces/Presenters/IPresenter.cs index c44d87a..4dab34b 100644 --- a/src/PubDev.UnitTests.API/Interfaces/Presenters/IPresenter.cs +++ b/src/API/Interfaces/Presenters/IPresenter.cs @@ -1,6 +1,6 @@ using Microsoft.AspNetCore.Mvc; -namespace PubDev.UnitTests.API.Interfaces.Presenters; +namespace PubDev.Store.API.Interfaces.Presenters; public interface IPresenter { diff --git a/src/PubDev.UnitTests.API/Interfaces/Repositories/IClientRepository.cs b/src/API/Interfaces/Repositories/IClientRepository.cs similarity index 70% rename from src/PubDev.UnitTests.API/Interfaces/Repositories/IClientRepository.cs rename to src/API/Interfaces/Repositories/IClientRepository.cs index c691ec4..3d0229d 100644 --- a/src/PubDev.UnitTests.API/Interfaces/Repositories/IClientRepository.cs +++ b/src/API/Interfaces/Repositories/IClientRepository.cs @@ -1,6 +1,6 @@ -using PubDev.UnitTests.API.Entities; +using PubDev.Store.API.Entities; -namespace PubDev.UnitTests.API.Interfaces.Repositories; +namespace PubDev.Store.API.Interfaces.Repositories; public interface IClientRepository { diff --git a/src/PubDev.UnitTests.API/Interfaces/Repositories/IOrderProductRepository.cs b/src/API/Interfaces/Repositories/IOrderProductRepository.cs similarity index 55% rename from src/PubDev.UnitTests.API/Interfaces/Repositories/IOrderProductRepository.cs rename to src/API/Interfaces/Repositories/IOrderProductRepository.cs index b00cd31..db93ec1 100644 --- a/src/PubDev.UnitTests.API/Interfaces/Repositories/IOrderProductRepository.cs +++ b/src/API/Interfaces/Repositories/IOrderProductRepository.cs @@ -1,6 +1,6 @@ -using PubDev.UnitTests.API.Entities; +using PubDev.Store.API.Entities; -namespace PubDev.UnitTests.API.Interfaces.Repositories; +namespace PubDev.Store.API.Interfaces.Repositories; public interface IOrderProductRepository { diff --git a/src/PubDev.UnitTests.API/Interfaces/Repositories/IOrderRepository.cs b/src/API/Interfaces/Repositories/IOrderRepository.cs similarity index 64% rename from src/PubDev.UnitTests.API/Interfaces/Repositories/IOrderRepository.cs rename to src/API/Interfaces/Repositories/IOrderRepository.cs index a075ffd..1780609 100644 --- a/src/PubDev.UnitTests.API/Interfaces/Repositories/IOrderRepository.cs +++ b/src/API/Interfaces/Repositories/IOrderRepository.cs @@ -1,6 +1,6 @@ -using PubDev.UnitTests.API.Entities; +using PubDev.Store.API.Entities; -namespace PubDev.UnitTests.API.Interfaces.Repositories; +namespace PubDev.Store.API.Interfaces.Repositories; public interface IOrderRepository { diff --git a/src/PubDev.UnitTests.API/Interfaces/Repositories/IProductRepository.cs b/src/API/Interfaces/Repositories/IProductRepository.cs similarity index 70% rename from src/PubDev.UnitTests.API/Interfaces/Repositories/IProductRepository.cs rename to src/API/Interfaces/Repositories/IProductRepository.cs index ac3509c..415dd2d 100644 --- a/src/PubDev.UnitTests.API/Interfaces/Repositories/IProductRepository.cs +++ b/src/API/Interfaces/Repositories/IProductRepository.cs @@ -1,6 +1,6 @@ -using PubDev.UnitTests.API.Entities; +using PubDev.Store.API.Entities; -namespace PubDev.UnitTests.API.Interfaces.Repositories; +namespace PubDev.Store.API.Interfaces.Repositories; public interface IProductRepository { diff --git a/src/PubDev.UnitTests.API/Interfaces/Services/IClientService.cs b/src/API/Interfaces/Services/IClientService.cs similarity index 70% rename from src/PubDev.UnitTests.API/Interfaces/Services/IClientService.cs rename to src/API/Interfaces/Services/IClientService.cs index d6a84b8..90e4070 100644 --- a/src/PubDev.UnitTests.API/Interfaces/Services/IClientService.cs +++ b/src/API/Interfaces/Services/IClientService.cs @@ -1,6 +1,6 @@ -using PubDev.UnitTests.API.Entities; +using PubDev.Store.API.Entities; -namespace PubDev.UnitTests.API.Interfaces.Services; +namespace PubDev.Store.API.Interfaces.Services; public interface IClientService { diff --git a/src/PubDev.UnitTests.API/Interfaces/Services/IOrderService.cs b/src/API/Interfaces/Services/IOrderService.cs similarity index 64% rename from src/PubDev.UnitTests.API/Interfaces/Services/IOrderService.cs rename to src/API/Interfaces/Services/IOrderService.cs index 93b4f6f..7102440 100644 --- a/src/PubDev.UnitTests.API/Interfaces/Services/IOrderService.cs +++ b/src/API/Interfaces/Services/IOrderService.cs @@ -1,6 +1,6 @@ -using PubDev.UnitTests.API.Entities; +using PubDev.Store.API.Entities; -namespace PubDev.UnitTests.API.Interfaces.Services; +namespace PubDev.Store.API.Interfaces.Services; public interface IOrderService { diff --git a/src/PubDev.UnitTests.API/Interfaces/Services/IProductService.cs b/src/API/Interfaces/Services/IProductService.cs similarity index 71% rename from src/PubDev.UnitTests.API/Interfaces/Services/IProductService.cs rename to src/API/Interfaces/Services/IProductService.cs index 776756a..8f4bce1 100644 --- a/src/PubDev.UnitTests.API/Interfaces/Services/IProductService.cs +++ b/src/API/Interfaces/Services/IProductService.cs @@ -1,6 +1,6 @@ -using PubDev.UnitTests.API.Entities; +using PubDev.Store.API.Entities; -namespace PubDev.UnitTests.API.Interfaces.Services; +namespace PubDev.Store.API.Interfaces.Services; public interface IProductService { diff --git a/src/PubDev.UnitTests.API/Messages/Error.cs b/src/API/Messages/Error.cs similarity index 94% rename from src/PubDev.UnitTests.API/Messages/Error.cs rename to src/API/Messages/Error.cs index 42d09c8..170bbae 100644 --- a/src/PubDev.UnitTests.API/Messages/Error.cs +++ b/src/API/Messages/Error.cs @@ -1,4 +1,4 @@ -namespace PubDev.UnitTests.API.Messages +namespace PubDev.Store.API.Messages { public static class Error { diff --git a/src/PubDev.UnitTests.API/Middlewares/ExceptionMiddleware.cs b/src/API/Middlewares/ExceptionMiddleware.cs similarity index 95% rename from src/PubDev.UnitTests.API/Middlewares/ExceptionMiddleware.cs rename to src/API/Middlewares/ExceptionMiddleware.cs index 6e88f94..900573f 100644 --- a/src/PubDev.UnitTests.API/Middlewares/ExceptionMiddleware.cs +++ b/src/API/Middlewares/ExceptionMiddleware.cs @@ -1,11 +1,11 @@ using Microsoft.AspNetCore.Diagnostics; -using PubDev.UnitTests.API.Responses; +using PubDev.Store.API.Responses; using System.Net; using System.Net.Mime; using System.Text.Json; using System.Text.Json.Serialization; -namespace PubDev.UnitTests.API.Middlewares; +namespace PubDev.Store.API.Middlewares; public static class ExceptionMiddleware { diff --git a/src/PubDev.UnitTests.API/NotificationContext.cs b/src/API/NotificationContext.cs similarity index 95% rename from src/PubDev.UnitTests.API/NotificationContext.cs rename to src/API/NotificationContext.cs index 3cea74b..dc4e80f 100644 --- a/src/PubDev.UnitTests.API/NotificationContext.cs +++ b/src/API/NotificationContext.cs @@ -1,7 +1,7 @@ -using PubDev.UnitTests.API.Enums; +using PubDev.Store.API.Enums; using System.Collections.ObjectModel; -namespace PubDev.UnitTests.API; +namespace PubDev.Store.API; public class NotificationContext { diff --git a/src/PubDev.UnitTests.API/Presenters/Presenter.cs b/src/API/Presenters/Presenter.cs similarity index 93% rename from src/PubDev.UnitTests.API/Presenters/Presenter.cs rename to src/API/Presenters/Presenter.cs index b8ef902..c1aac12 100644 --- a/src/PubDev.UnitTests.API/Presenters/Presenter.cs +++ b/src/API/Presenters/Presenter.cs @@ -1,10 +1,10 @@ using Microsoft.AspNetCore.Mvc; -using PubDev.UnitTests.API.Enums; -using PubDev.UnitTests.API.Interfaces.Presenters; -using PubDev.UnitTests.API.Responses; +using PubDev.Store.API.Enums; +using PubDev.Store.API.Interfaces.Presenters; +using PubDev.Store.API.Responses; using System.Diagnostics; -namespace PubDev.UnitTests.API.Presenters; +namespace PubDev.Store.API.Presenters; public class Presenter : IPresenter { diff --git a/src/PubDev.UnitTests.API/Program.cs b/src/API/Program.cs similarity index 88% rename from src/PubDev.UnitTests.API/Program.cs rename to src/API/Program.cs index d4f3acb..6be0979 100644 --- a/src/PubDev.UnitTests.API/Program.cs +++ b/src/API/Program.cs @@ -1,10 +1,10 @@ using Microsoft.AspNetCore.Mvc.Controllers; using Microsoft.OpenApi.Models; -using PubDev.UnitTests.API; -using PubDev.UnitTests.API.Interfaces.Presenters; -using PubDev.UnitTests.API.Middlewares; -using PubDev.UnitTests.API.Presenters; -using PubDev.UnitTests.API.Providers; +using PubDev.Store.API; +using PubDev.Store.API.Interfaces.Presenters; +using PubDev.Store.API.Middlewares; +using PubDev.Store.API.Presenters; +using PubDev.Store.API.Providers; using System.Text.Json; using System.Text.Json.Serialization; diff --git a/src/PubDev.UnitTests.API/Properties/launchSettings.json b/src/API/Properties/launchSettings.json similarity index 100% rename from src/PubDev.UnitTests.API/Properties/launchSettings.json rename to src/API/Properties/launchSettings.json diff --git a/src/PubDev.UnitTests.API/Providers/PersistenceConfiguration.cs b/src/API/Providers/PersistenceConfiguration.cs similarity index 89% rename from src/PubDev.UnitTests.API/Providers/PersistenceConfiguration.cs rename to src/API/Providers/PersistenceConfiguration.cs index 6aae43b..e6b5db2 100644 --- a/src/PubDev.UnitTests.API/Providers/PersistenceConfiguration.cs +++ b/src/API/Providers/PersistenceConfiguration.cs @@ -1,9 +1,9 @@ using Microsoft.Data.SqlClient; using Microsoft.EntityFrameworkCore; -using PubDev.UnitTests.API.Configuration; +using PubDev.Store.API.Configuration; using System.Data; -namespace PubDev.UnitTests.API.Providers; +namespace PubDev.Store.API.Providers; public static class PersistenceConfiguration { diff --git a/src/PubDev.UnitTests.API/Providers/RepositoriesConfiguration.cs b/src/API/Providers/RepositoriesConfiguration.cs similarity index 76% rename from src/PubDev.UnitTests.API/Providers/RepositoriesConfiguration.cs rename to src/API/Providers/RepositoriesConfiguration.cs index 1c4b67f..6787761 100644 --- a/src/PubDev.UnitTests.API/Providers/RepositoriesConfiguration.cs +++ b/src/API/Providers/RepositoriesConfiguration.cs @@ -1,7 +1,7 @@ -using PubDev.UnitTests.API.Interfaces.Repositories; -using PubDev.UnitTests.API.Repositories; +using PubDev.Store.API.Interfaces.Repositories; +using PubDev.Store.API.Repositories; -namespace PubDev.UnitTests.API.Providers; +namespace PubDev.Store.API.Providers; public static class RepositoriesConfiguration { diff --git a/src/PubDev.UnitTests.API/Providers/ServicesConfiguration.cs b/src/API/Providers/ServicesConfiguration.cs similarity index 73% rename from src/PubDev.UnitTests.API/Providers/ServicesConfiguration.cs rename to src/API/Providers/ServicesConfiguration.cs index 9c85b35..50d627d 100644 --- a/src/PubDev.UnitTests.API/Providers/ServicesConfiguration.cs +++ b/src/API/Providers/ServicesConfiguration.cs @@ -1,7 +1,7 @@ -using PubDev.UnitTests.API.Interfaces.Services; -using PubDev.UnitTests.API.Services; +using PubDev.Store.API.Interfaces.Services; +using PubDev.Store.API.Services; -namespace PubDev.UnitTests.API.Providers; +namespace PubDev.Store.API.Providers; public static class ServicesConfiguration { diff --git a/src/PubDev.UnitTests.API/PubDev.UnitTests.API.csproj b/src/API/PubDev.Store.API.csproj similarity index 100% rename from src/PubDev.UnitTests.API/PubDev.UnitTests.API.csproj rename to src/API/PubDev.Store.API.csproj diff --git a/src/PubDev.UnitTests.API/Repositories/ClientRepository.cs b/src/API/Repositories/ClientRepository.cs similarity index 92% rename from src/PubDev.UnitTests.API/Repositories/ClientRepository.cs rename to src/API/Repositories/ClientRepository.cs index 629b294..bc68987 100644 --- a/src/PubDev.UnitTests.API/Repositories/ClientRepository.cs +++ b/src/API/Repositories/ClientRepository.cs @@ -1,9 +1,9 @@ using Dapper; -using PubDev.UnitTests.API.Entities; -using PubDev.UnitTests.API.Interfaces.Repositories; +using PubDev.Store.API.Entities; +using PubDev.Store.API.Interfaces.Repositories; using System.Data; -namespace PubDev.UnitTests.API.Repositories; +namespace PubDev.Store.API.Repositories; public class ClientRepository : IClientRepository { diff --git a/src/PubDev.UnitTests.API/Repositories/OrderProductRepository.cs b/src/API/Repositories/OrderProductRepository.cs similarity index 83% rename from src/PubDev.UnitTests.API/Repositories/OrderProductRepository.cs rename to src/API/Repositories/OrderProductRepository.cs index 6edf4a2..dc22be9 100644 --- a/src/PubDev.UnitTests.API/Repositories/OrderProductRepository.cs +++ b/src/API/Repositories/OrderProductRepository.cs @@ -1,9 +1,9 @@ using Dapper; -using PubDev.UnitTests.API.Entities; -using PubDev.UnitTests.API.Interfaces.Repositories; +using PubDev.Store.API.Entities; +using PubDev.Store.API.Interfaces.Repositories; using System.Data; -namespace PubDev.UnitTests.API.Repositories; +namespace PubDev.Store.API.Repositories; public class OrderProductRepository : IOrderProductRepository { diff --git a/src/PubDev.UnitTests.API/Repositories/OrderRepository.cs b/src/API/Repositories/OrderRepository.cs similarity index 96% rename from src/PubDev.UnitTests.API/Repositories/OrderRepository.cs rename to src/API/Repositories/OrderRepository.cs index bb567ef..7f899f8 100644 --- a/src/PubDev.UnitTests.API/Repositories/OrderRepository.cs +++ b/src/API/Repositories/OrderRepository.cs @@ -1,9 +1,9 @@ using Dapper; -using PubDev.UnitTests.API.Entities; -using PubDev.UnitTests.API.Interfaces.Repositories; +using PubDev.Store.API.Entities; +using PubDev.Store.API.Interfaces.Repositories; using System.Data; -namespace PubDev.UnitTests.API.Repositories; +namespace PubDev.Store.API.Repositories; public class OrderRepository : IOrderRepository { diff --git a/src/PubDev.UnitTests.API/Repositories/ProductRepository.cs b/src/API/Repositories/ProductRepository.cs similarity index 93% rename from src/PubDev.UnitTests.API/Repositories/ProductRepository.cs rename to src/API/Repositories/ProductRepository.cs index 2ae9fe0..4d33a3d 100644 --- a/src/PubDev.UnitTests.API/Repositories/ProductRepository.cs +++ b/src/API/Repositories/ProductRepository.cs @@ -1,9 +1,9 @@ using Dapper; -using PubDev.UnitTests.API.Entities; -using PubDev.UnitTests.API.Interfaces.Repositories; +using PubDev.Store.API.Entities; +using PubDev.Store.API.Interfaces.Repositories; using System.Data; -namespace PubDev.UnitTests.API.Repositories; +namespace PubDev.Store.API.Repositories; public class ProductRepository : IProductRepository { diff --git a/src/PubDev.UnitTests.API/Requests/ClientCreateRequest.cs b/src/API/Requests/ClientCreateRequest.cs similarity index 78% rename from src/PubDev.UnitTests.API/Requests/ClientCreateRequest.cs rename to src/API/Requests/ClientCreateRequest.cs index 7688a93..4b2db77 100644 --- a/src/PubDev.UnitTests.API/Requests/ClientCreateRequest.cs +++ b/src/API/Requests/ClientCreateRequest.cs @@ -1,6 +1,6 @@ -using PubDev.UnitTests.API.Entities; +using PubDev.Store.API.Entities; -namespace PubDev.UnitTests.API.Requests; +namespace PubDev.Store.API.Requests; public class ClientCreateRequest { diff --git a/src/PubDev.UnitTests.API/Requests/ClientPatchRequest.cs b/src/API/Requests/ClientPatchRequest.cs similarity index 75% rename from src/PubDev.UnitTests.API/Requests/ClientPatchRequest.cs rename to src/API/Requests/ClientPatchRequest.cs index 471f65e..92fb309 100644 --- a/src/PubDev.UnitTests.API/Requests/ClientPatchRequest.cs +++ b/src/API/Requests/ClientPatchRequest.cs @@ -1,6 +1,6 @@ -using PubDev.UnitTests.API.Entities; +using PubDev.Store.API.Entities; -namespace PubDev.UnitTests.API.Requests; +namespace PubDev.Store.API.Requests; public class ClientPatchRequest { diff --git a/src/PubDev.UnitTests.API/Requests/OrderCreateRequest.cs b/src/API/Requests/OrderCreateRequest.cs similarity index 83% rename from src/PubDev.UnitTests.API/Requests/OrderCreateRequest.cs rename to src/API/Requests/OrderCreateRequest.cs index 235a5a3..7a7c1f0 100644 --- a/src/PubDev.UnitTests.API/Requests/OrderCreateRequest.cs +++ b/src/API/Requests/OrderCreateRequest.cs @@ -1,6 +1,6 @@ -using PubDev.UnitTests.API.Entities; +using PubDev.Store.API.Entities; -namespace PubDev.UnitTests.API.Requests; +namespace PubDev.Store.API.Requests; public class OrderCreateRequest { diff --git a/src/PubDev.UnitTests.API/Requests/OrderProductRequest.cs b/src/API/Requests/OrderProductRequest.cs similarity index 81% rename from src/PubDev.UnitTests.API/Requests/OrderProductRequest.cs rename to src/API/Requests/OrderProductRequest.cs index 1384062..39b87af 100644 --- a/src/PubDev.UnitTests.API/Requests/OrderProductRequest.cs +++ b/src/API/Requests/OrderProductRequest.cs @@ -1,6 +1,6 @@ -using PubDev.UnitTests.API.Entities; +using PubDev.Store.API.Entities; -namespace PubDev.UnitTests.API.Requests; +namespace PubDev.Store.API.Requests; public class OrderProductRequest { diff --git a/src/PubDev.UnitTests.API/Requests/ProductCreateRequest.cs b/src/API/Requests/ProductCreateRequest.cs similarity index 81% rename from src/PubDev.UnitTests.API/Requests/ProductCreateRequest.cs rename to src/API/Requests/ProductCreateRequest.cs index abab508..31e6b6c 100644 --- a/src/PubDev.UnitTests.API/Requests/ProductCreateRequest.cs +++ b/src/API/Requests/ProductCreateRequest.cs @@ -1,6 +1,6 @@ -using PubDev.UnitTests.API.Entities; +using PubDev.Store.API.Entities; -namespace PubDev.UnitTests.API.Requests; +namespace PubDev.Store.API.Requests; public class ProductCreateRequest { diff --git a/src/PubDev.UnitTests.API/Requests/ProductPatchRequest.cs b/src/API/Requests/ProductPatchRequest.cs similarity index 81% rename from src/PubDev.UnitTests.API/Requests/ProductPatchRequest.cs rename to src/API/Requests/ProductPatchRequest.cs index 5f54f39..35cfa43 100644 --- a/src/PubDev.UnitTests.API/Requests/ProductPatchRequest.cs +++ b/src/API/Requests/ProductPatchRequest.cs @@ -1,6 +1,6 @@ -using PubDev.UnitTests.API.Entities; +using PubDev.Store.API.Entities; -namespace PubDev.UnitTests.API.Requests; +namespace PubDev.Store.API.Requests; public class ProductPatchRequest { diff --git a/src/PubDev.UnitTests.API/Responses/ClientGetAllResponse.cs b/src/API/Responses/ClientGetAllResponse.cs similarity index 83% rename from src/PubDev.UnitTests.API/Responses/ClientGetAllResponse.cs rename to src/API/Responses/ClientGetAllResponse.cs index 91dafd4..96375e9 100644 --- a/src/PubDev.UnitTests.API/Responses/ClientGetAllResponse.cs +++ b/src/API/Responses/ClientGetAllResponse.cs @@ -1,6 +1,6 @@ -using PubDev.UnitTests.API.Entities; +using PubDev.Store.API.Entities; -namespace PubDev.UnitTests.API.Responses; +namespace PubDev.Store.API.Responses; public class ClientGetAllResponse { diff --git a/src/PubDev.UnitTests.API/Responses/ClientGetByIdResponse.cs b/src/API/Responses/ClientGetByIdResponse.cs similarity index 83% rename from src/PubDev.UnitTests.API/Responses/ClientGetByIdResponse.cs rename to src/API/Responses/ClientGetByIdResponse.cs index 400124c..abfe643 100644 --- a/src/PubDev.UnitTests.API/Responses/ClientGetByIdResponse.cs +++ b/src/API/Responses/ClientGetByIdResponse.cs @@ -1,6 +1,6 @@ -using PubDev.UnitTests.API.Entities; +using PubDev.Store.API.Entities; -namespace PubDev.UnitTests.API.Responses; +namespace PubDev.Store.API.Responses; public class ClientGetByIdResponse { diff --git a/src/PubDev.UnitTests.API/Responses/ClientPatchResponse.cs b/src/API/Responses/ClientPatchResponse.cs similarity index 83% rename from src/PubDev.UnitTests.API/Responses/ClientPatchResponse.cs rename to src/API/Responses/ClientPatchResponse.cs index 06dc56c..5814f79 100644 --- a/src/PubDev.UnitTests.API/Responses/ClientPatchResponse.cs +++ b/src/API/Responses/ClientPatchResponse.cs @@ -1,6 +1,6 @@ -using PubDev.UnitTests.API.Entities; +using PubDev.Store.API.Entities; -namespace PubDev.UnitTests.API.Responses; +namespace PubDev.Store.API.Responses; public class ClientPatchResponse { diff --git a/src/PubDev.UnitTests.API/Responses/ClientResponse.cs b/src/API/Responses/ClientResponse.cs similarity index 78% rename from src/PubDev.UnitTests.API/Responses/ClientResponse.cs rename to src/API/Responses/ClientResponse.cs index 1a9a06f..2723efd 100644 --- a/src/PubDev.UnitTests.API/Responses/ClientResponse.cs +++ b/src/API/Responses/ClientResponse.cs @@ -1,6 +1,6 @@ -using PubDev.UnitTests.API.Entities; +using PubDev.Store.API.Entities; -namespace PubDev.UnitTests.API.Responses; +namespace PubDev.Store.API.Responses; public class ClientResponse { diff --git a/src/PubDev.UnitTests.API/Responses/CreateClientResponse.cs b/src/API/Responses/CreateClientResponse.cs similarity index 83% rename from src/PubDev.UnitTests.API/Responses/CreateClientResponse.cs rename to src/API/Responses/CreateClientResponse.cs index 3a28a58..48e8f52 100644 --- a/src/PubDev.UnitTests.API/Responses/CreateClientResponse.cs +++ b/src/API/Responses/CreateClientResponse.cs @@ -1,6 +1,6 @@ -using PubDev.UnitTests.API.Entities; +using PubDev.Store.API.Entities; -namespace PubDev.UnitTests.API.Responses; +namespace PubDev.Store.API.Responses; public class ClientCreateResponse { diff --git a/src/PubDev.UnitTests.API/Responses/ErrorMessageResponse.cs b/src/API/Responses/ErrorMessageResponse.cs similarity index 88% rename from src/PubDev.UnitTests.API/Responses/ErrorMessageResponse.cs rename to src/API/Responses/ErrorMessageResponse.cs index 1ff8095..4033717 100644 --- a/src/PubDev.UnitTests.API/Responses/ErrorMessageResponse.cs +++ b/src/API/Responses/ErrorMessageResponse.cs @@ -1,4 +1,4 @@ -namespace PubDev.UnitTests.API.Responses; +namespace PubDev.Store.API.Responses; public class ErrorMessageResponse { diff --git a/src/PubDev.UnitTests.API/Responses/ErrorResponse.cs b/src/API/Responses/ErrorResponse.cs similarity index 89% rename from src/PubDev.UnitTests.API/Responses/ErrorResponse.cs rename to src/API/Responses/ErrorResponse.cs index c25f495..211fe42 100644 --- a/src/PubDev.UnitTests.API/Responses/ErrorResponse.cs +++ b/src/API/Responses/ErrorResponse.cs @@ -1,4 +1,4 @@ -namespace PubDev.UnitTests.API.Responses; +namespace PubDev.Store.API.Responses; public class ErrorResponse { diff --git a/src/PubDev.UnitTests.API/Responses/OrderCreateResponse.cs b/src/API/Responses/OrderCreateResponse.cs similarity index 88% rename from src/PubDev.UnitTests.API/Responses/OrderCreateResponse.cs rename to src/API/Responses/OrderCreateResponse.cs index 8b58e92..a9f55f5 100644 --- a/src/PubDev.UnitTests.API/Responses/OrderCreateResponse.cs +++ b/src/API/Responses/OrderCreateResponse.cs @@ -1,6 +1,6 @@ -using PubDev.UnitTests.API.Entities; +using PubDev.Store.API.Entities; -namespace PubDev.UnitTests.API.Responses; +namespace PubDev.Store.API.Responses; public class OrderCreateResponse { diff --git a/src/PubDev.UnitTests.API/Responses/OrderGetByIdResponse.cs b/src/API/Responses/OrderGetByIdResponse.cs similarity index 88% rename from src/PubDev.UnitTests.API/Responses/OrderGetByIdResponse.cs rename to src/API/Responses/OrderGetByIdResponse.cs index 4e01fd4..2f3bc1a 100644 --- a/src/PubDev.UnitTests.API/Responses/OrderGetByIdResponse.cs +++ b/src/API/Responses/OrderGetByIdResponse.cs @@ -1,6 +1,6 @@ -using PubDev.UnitTests.API.Entities; +using PubDev.Store.API.Entities; -namespace PubDev.UnitTests.API.Responses; +namespace PubDev.Store.API.Responses; public class OrderGetByIdResponse { diff --git a/src/PubDev.UnitTests.API/Responses/OrderProductResponse.cs b/src/API/Responses/OrderProductResponse.cs similarity index 83% rename from src/PubDev.UnitTests.API/Responses/OrderProductResponse.cs rename to src/API/Responses/OrderProductResponse.cs index f932fc8..a53ade8 100644 --- a/src/PubDev.UnitTests.API/Responses/OrderProductResponse.cs +++ b/src/API/Responses/OrderProductResponse.cs @@ -1,6 +1,6 @@ -using PubDev.UnitTests.API.Entities; +using PubDev.Store.API.Entities; -namespace PubDev.UnitTests.API.Responses; +namespace PubDev.Store.API.Responses; public class OrderProductResponse { diff --git a/src/PubDev.UnitTests.API/Responses/ProductCreateResponse.cs b/src/API/Responses/ProductCreateResponse.cs similarity index 85% rename from src/PubDev.UnitTests.API/Responses/ProductCreateResponse.cs rename to src/API/Responses/ProductCreateResponse.cs index 9cf0e01..5413605 100644 --- a/src/PubDev.UnitTests.API/Responses/ProductCreateResponse.cs +++ b/src/API/Responses/ProductCreateResponse.cs @@ -1,6 +1,6 @@ -using PubDev.UnitTests.API.Entities; +using PubDev.Store.API.Entities; -namespace PubDev.UnitTests.API.Responses; +namespace PubDev.Store.API.Responses; public class ProductCreateResponse { diff --git a/src/PubDev.UnitTests.API/Responses/ProductGetAllResponse.cs b/src/API/Responses/ProductGetAllResponse.cs similarity index 85% rename from src/PubDev.UnitTests.API/Responses/ProductGetAllResponse.cs rename to src/API/Responses/ProductGetAllResponse.cs index 50deec4..b81a6e9 100644 --- a/src/PubDev.UnitTests.API/Responses/ProductGetAllResponse.cs +++ b/src/API/Responses/ProductGetAllResponse.cs @@ -1,6 +1,6 @@ -using PubDev.UnitTests.API.Entities; +using PubDev.Store.API.Entities; -namespace PubDev.UnitTests.API.Responses; +namespace PubDev.Store.API.Responses; public class ProductGetAllResponse { diff --git a/src/PubDev.UnitTests.API/Responses/ProductGetByIdResponse.cs b/src/API/Responses/ProductGetByIdResponse.cs similarity index 85% rename from src/PubDev.UnitTests.API/Responses/ProductGetByIdResponse.cs rename to src/API/Responses/ProductGetByIdResponse.cs index 52d4d79..1a86783 100644 --- a/src/PubDev.UnitTests.API/Responses/ProductGetByIdResponse.cs +++ b/src/API/Responses/ProductGetByIdResponse.cs @@ -1,6 +1,6 @@ -using PubDev.UnitTests.API.Entities; +using PubDev.Store.API.Entities; -namespace PubDev.UnitTests.API.Responses; +namespace PubDev.Store.API.Responses; public class ProductGetByIdResponse { diff --git a/src/PubDev.UnitTests.API/Responses/ProductPatchResponse.cs b/src/API/Responses/ProductPatchResponse.cs similarity index 85% rename from src/PubDev.UnitTests.API/Responses/ProductPatchResponse.cs rename to src/API/Responses/ProductPatchResponse.cs index 59cacb0..bde491b 100644 --- a/src/PubDev.UnitTests.API/Responses/ProductPatchResponse.cs +++ b/src/API/Responses/ProductPatchResponse.cs @@ -1,6 +1,6 @@ -using PubDev.UnitTests.API.Entities; +using PubDev.Store.API.Entities; -namespace PubDev.UnitTests.API.Responses; +namespace PubDev.Store.API.Responses; public class ProductPatchResponse { diff --git a/src/PubDev.UnitTests.API/Responses/ProductResponse.cs b/src/API/Responses/ProductResponse.cs similarity index 82% rename from src/PubDev.UnitTests.API/Responses/ProductResponse.cs rename to src/API/Responses/ProductResponse.cs index 5401c03..a03720d 100644 --- a/src/PubDev.UnitTests.API/Responses/ProductResponse.cs +++ b/src/API/Responses/ProductResponse.cs @@ -1,6 +1,6 @@ -using PubDev.UnitTests.API.Entities; +using PubDev.Store.API.Entities; -namespace PubDev.UnitTests.API.Responses; +namespace PubDev.Store.API.Responses; public class ProductResponse { diff --git a/src/PubDev.UnitTests.API/Services/ClientService.cs b/src/API/Services/ClientService.cs similarity index 86% rename from src/PubDev.UnitTests.API/Services/ClientService.cs rename to src/API/Services/ClientService.cs index 78b06d0..0838013 100644 --- a/src/PubDev.UnitTests.API/Services/ClientService.cs +++ b/src/API/Services/ClientService.cs @@ -1,9 +1,9 @@ -using PubDev.UnitTests.API.Entities; -using PubDev.UnitTests.API.Interfaces.Repositories; -using PubDev.UnitTests.API.Interfaces.Services; -using PubDev.UnitTests.API.Messages; +using PubDev.Store.API.Entities; +using PubDev.Store.API.Interfaces.Repositories; +using PubDev.Store.API.Interfaces.Services; +using PubDev.Store.API.Messages; -namespace PubDev.UnitTests.API.Services; +namespace PubDev.Store.API.Services; public class ClientService : IClientService { diff --git a/src/PubDev.UnitTests.API/Services/OrderService.cs b/src/API/Services/OrderService.cs similarity index 93% rename from src/PubDev.UnitTests.API/Services/OrderService.cs rename to src/API/Services/OrderService.cs index 8d0fa32..bba0f02 100644 --- a/src/PubDev.UnitTests.API/Services/OrderService.cs +++ b/src/API/Services/OrderService.cs @@ -1,9 +1,9 @@ -using PubDev.UnitTests.API.Entities; -using PubDev.UnitTests.API.Interfaces.Repositories; -using PubDev.UnitTests.API.Interfaces.Services; -using PubDev.UnitTests.API.Messages; +using PubDev.Store.API.Entities; +using PubDev.Store.API.Interfaces.Repositories; +using PubDev.Store.API.Interfaces.Services; +using PubDev.Store.API.Messages; -namespace PubDev.UnitTests.API.Services; +namespace PubDev.Store.API.Services; public class OrderService : IOrderService { diff --git a/src/PubDev.UnitTests.API/Services/ProductService.cs b/src/API/Services/ProductService.cs similarity index 83% rename from src/PubDev.UnitTests.API/Services/ProductService.cs rename to src/API/Services/ProductService.cs index 0af71c3..dcfe204 100644 --- a/src/PubDev.UnitTests.API/Services/ProductService.cs +++ b/src/API/Services/ProductService.cs @@ -1,9 +1,9 @@ -using PubDev.UnitTests.API.Entities; -using PubDev.UnitTests.API.Interfaces.Repositories; -using PubDev.UnitTests.API.Interfaces.Services; -using PubDev.UnitTests.API.Messages; +using PubDev.Store.API.Entities; +using PubDev.Store.API.Interfaces.Repositories; +using PubDev.Store.API.Interfaces.Services; +using PubDev.Store.API.Messages; -namespace PubDev.UnitTests.API.Services; +namespace PubDev.Store.API.Services; public class ProductService : IProductService { @@ -65,7 +65,7 @@ public async Task UpdateAsync(Product product) return await _productRepository.UpdateAsync(product); } - _notificationContext.AddValidationError(Error.Product.NOT_FOUND, $"Product {product.ProductId} not found"); + _notificationContext.AddNotFound(Error.Product.NOT_FOUND, $"Product {product.ProductId} not found"); return null; } diff --git a/src/PubDev.UnitTests.API/appsettings.Development.json b/src/API/appsettings.Development.json similarity index 100% rename from src/PubDev.UnitTests.API/appsettings.Development.json rename to src/API/appsettings.Development.json diff --git a/src/PubDev.UnitTests.API/appsettings.json b/src/API/appsettings.json similarity index 100% rename from src/PubDev.UnitTests.API/appsettings.json rename to src/API/appsettings.json diff --git a/tests/API.Tests/GlobalUsings.cs b/tests/API.Tests/GlobalUsings.cs new file mode 100644 index 0000000..4050969 --- /dev/null +++ b/tests/API.Tests/GlobalUsings.cs @@ -0,0 +1,9 @@ +global using Moq; +global using PubDev.Store.API.Entities; +global using PubDev.Store.API.Enums; +global using PubDev.Store.API.Interfaces.Repositories; +global using PubDev.Store.API.Messages; +global using PubDev.Store.API.Services; +global using System.Collections.Generic; +global using System.Threading.Tasks; +global using Xunit; \ No newline at end of file diff --git a/tests/PubDev.UnitTests.API.Tests/PubDev.UnitTests.API.Tests.csproj b/tests/API.Tests/PubDev.Store.API.Tests.csproj similarity index 74% rename from tests/PubDev.UnitTests.API.Tests/PubDev.UnitTests.API.Tests.csproj rename to tests/API.Tests/PubDev.Store.API.Tests.csproj index f23cb1c..b461e5f 100644 --- a/tests/PubDev.UnitTests.API.Tests/PubDev.UnitTests.API.Tests.csproj +++ b/tests/API.Tests/PubDev.Store.API.Tests.csproj @@ -15,10 +15,6 @@ runtime; build; native; contentfiles; analyzers; buildtransitive all - all runtime; build; native; contentfiles; analyzers; buildtransitive @@ -26,7 +22,7 @@ - + diff --git a/tests/PubDev.UnitTests.API.Tests/Services/ClientServiceTest.cs b/tests/API.Tests/Services/ClientServiceTest.cs similarity index 98% rename from tests/PubDev.UnitTests.API.Tests/Services/ClientServiceTest.cs rename to tests/API.Tests/Services/ClientServiceTest.cs index a361e59..f315fbd 100644 --- a/tests/PubDev.UnitTests.API.Tests/Services/ClientServiceTest.cs +++ b/tests/API.Tests/Services/ClientServiceTest.cs @@ -1,4 +1,4 @@ -namespace PubDev.UnitTests.API.Tests.Services; +namespace PubDev.Store.API.Tests.Services; public class ClientServiceTest { diff --git a/tests/PubDev.UnitTests.API.Tests/Services/OrderServiceTest.cs b/tests/API.Tests/Services/OrderServiceTest.cs similarity index 99% rename from tests/PubDev.UnitTests.API.Tests/Services/OrderServiceTest.cs rename to tests/API.Tests/Services/OrderServiceTest.cs index e5d7b0c..9e05ed9 100644 --- a/tests/PubDev.UnitTests.API.Tests/Services/OrderServiceTest.cs +++ b/tests/API.Tests/Services/OrderServiceTest.cs @@ -1,4 +1,4 @@ -namespace PubDev.UnitTests.API.Tests.Services; +namespace PubDev.Store.API.Tests.Services; public class OrderServiceTest { diff --git a/tests/PubDev.UnitTests.API.Tests/Services/ProductServiceTest.cs b/tests/API.Tests/Services/ProductServiceTest.cs similarity index 84% rename from tests/PubDev.UnitTests.API.Tests/Services/ProductServiceTest.cs rename to tests/API.Tests/Services/ProductServiceTest.cs index fed39d4..48bce22 100644 --- a/tests/PubDev.UnitTests.API.Tests/Services/ProductServiceTest.cs +++ b/tests/API.Tests/Services/ProductServiceTest.cs @@ -1,4 +1,4 @@ -namespace PubDev.UnitTests.API.Tests.Services; +namespace PubDev.Store.API.Tests.Services; public class ProductServiceTest { @@ -15,7 +15,7 @@ private ProductService GetProductService() [Fact] public async Task CreateAsync_WithValidData_ReturnsProduct() { - // prepare + // arrange _mockProductRepository .Setup(x => x.CreateAsync(It.IsAny())) .ReturnsAsync(new Product()); @@ -35,10 +35,12 @@ public async Task CreateAsync_WithValidData_ReturnsProduct() _mockProductRepository.Verify(x => x.CreateAsync(It.IsAny()), Times.Once); } - [Fact] - public async Task CreateAsync_WithInvalidValue_ReturnsError() + [Theory] + [InlineData(-10)] + [InlineData(0)] + public async Task CreateAsync_WithInvalidValue_ReturnsError(decimal value) { - // prepare + // arrange _mockProductRepository .Setup(x => x.CreateAsync(It.IsAny())) .ReturnsAsync(new Product()); @@ -46,7 +48,7 @@ public async Task CreateAsync_WithInvalidValue_ReturnsError() var product = new Product() { Name = "Product", - Value = -10 + Value = value }; var service = GetProductService(); @@ -67,7 +69,7 @@ public async Task CreateAsync_WithInvalidValue_ReturnsError() [Fact] public async Task GetAllAsync_WithValidData_ReturnsProduct() { - // prepare + // arrange _mockProductRepository .Setup(x => x.GetAllAsync()) .ReturnsAsync(new List()); @@ -84,7 +86,7 @@ public async Task GetAllAsync_WithValidData_ReturnsProduct() [Fact] public async Task GetByIdAsync_WithProductThatDoesNotExist_ReturnsNull() { - // prepare + // arrange _mockProductRepository .Setup(x => x.GetByIdAsync(It.IsAny())) .ReturnsAsync(default(Product)); @@ -99,7 +101,7 @@ public async Task GetByIdAsync_WithProductThatDoesNotExist_ReturnsNull() _mockProductRepository.Verify(x => x.GetByIdAsync(It.IsAny()), Times.Once); Assert.False(_notificationContext.IsValid); Assert.Contains(_notificationContext.ErrorMessages, - x => x.ErrorCode == "PRODUCT_NOT_FOUND" && + x => x.ErrorCode == Error.Product.NOT_FOUND && x.Message == $"Product 1 not found" && x.ErrorType == ErrorType.NotFound); } @@ -107,7 +109,7 @@ public async Task GetByIdAsync_WithProductThatDoesNotExist_ReturnsNull() [Fact] public async Task GetByIdAsync_WithProductThatExists_ReturnsProduct() { - // prepare + // arrange _mockProductRepository .Setup(x => x.GetByIdAsync(It.IsAny())) .ReturnsAsync(new Product()); @@ -126,7 +128,7 @@ public async Task GetByIdAsync_WithProductThatExists_ReturnsProduct() [Fact] public async Task UpdateAsync_WithProductThatDoesNotExist_ReturnsNull() { - // prepare + // arrange _mockProductRepository .Setup(x => x.GetByIdAsync(It.IsAny())) .ReturnsAsync(default(Product)); @@ -144,49 +146,70 @@ public async Task UpdateAsync_WithProductThatDoesNotExist_ReturnsNull() // assert Assert.Null(data); - _mockProductRepository.Verify(x => x.GetByIdAsync(It.IsAny()), Times.Once); - _mockProductRepository.Verify(x => x.UpdateAsync(It.IsAny()), Times.Never); - Assert.False(_notificationContext.IsValid); Assert.Contains(_notificationContext.ErrorMessages, - x => x.ErrorCode == "PRODUCT_NOT_FOUND" && + x => x.ErrorCode == Error.Product.NOT_FOUND && x.Message == $"Product 1 not found" && - x.ErrorType == ErrorType.Validation); + x.ErrorType == ErrorType.NotFound); + _mockProductRepository.Verify(x => x.GetByIdAsync(It.IsAny()), Times.Once); + _mockProductRepository.Verify(x => x.UpdateAsync(It.IsAny()), Times.Never); } - [Fact] - public async Task UpdateAsync_WithInvalidValueForProduct_ReturnsNull() + public static IEnumerable InvalidScenarioUpdateProduct = new[] + { + new object[] + { + new Product() + { + ProductId = 1, + Value = -1 + } + }, + new object[] + { + new Product() + { + ProductId = 2, + Value = -10 + } + }, + new object[] + { + new Product() + { + ProductId = 3, + Value = 0 + } + } + }; + + [Theory] + [MemberData(nameof(InvalidScenarioUpdateProduct))] + public async Task UpdateAsync_WithInvalidValueForProduct_ReturnsNull(Product product) { - // prepare + // arrange _mockProductRepository .Setup(x => x.GetByIdAsync(It.IsAny())) .ReturnsAsync(default(Product)); var service = GetProductService(); - var product = new Product() - { - ProductId = 1, - Value = 0 - }; - // act var data = await service.UpdateAsync(product); // assert Assert.Null(data); - _mockProductRepository.Verify(x => x.GetByIdAsync(It.IsAny()), Times.Never); - _mockProductRepository.Verify(x => x.UpdateAsync(It.IsAny()), Times.Never); - Assert.False(_notificationContext.IsValid); Assert.Contains(_notificationContext.ErrorMessages, x => x.ErrorCode == Error.Product.INVALID_VALUE && x.Message == $"Product value should be greater than 0" && x.ErrorType == ErrorType.Validation); + _mockProductRepository.Verify(x => x.GetByIdAsync(It.IsAny()), Times.Never); + _mockProductRepository.Verify(x => x.UpdateAsync(It.IsAny()), Times.Never); } [Fact] public async Task UpdateAsync_WithProductThatExists_ReturnsProduct() { - // prepare + // arrange _mockProductRepository .Setup(x => x.GetByIdAsync(It.IsAny())) .ReturnsAsync(new Product()); @@ -209,8 +232,8 @@ public async Task UpdateAsync_WithProductThatExists_ReturnsProduct() // assert Assert.NotNull(data); + Assert.True(_notificationContext.IsValid); _mockProductRepository.Verify(x => x.GetByIdAsync(It.IsAny()), Times.Once); _mockProductRepository.Verify(x => x.UpdateAsync(It.IsAny()), Times.Once); - Assert.True(_notificationContext.IsValid); } } diff --git a/tests/PubDev.UnitTests.API.Tests/GlobalUsings.cs b/tests/PubDev.UnitTests.API.Tests/GlobalUsings.cs deleted file mode 100644 index 5576421..0000000 --- a/tests/PubDev.UnitTests.API.Tests/GlobalUsings.cs +++ /dev/null @@ -1,9 +0,0 @@ -global using Moq; -global using PubDev.UnitTests.API.Entities; -global using PubDev.UnitTests.API.Enums; -global using PubDev.UnitTests.API.Interfaces.Repositories; -global using PubDev.UnitTests.API.Messages; -global using PubDev.UnitTests.API.Services; -global using System.Collections.Generic; -global using System.Threading.Tasks; -global using Xunit; \ No newline at end of file