From 243c9c196a78c3df96dc94e134789bbc782f9275 Mon Sep 17 00:00:00 2001 From: Stephen Walsh <868017+stphnwlsh@users.noreply.github.com> Date: Sat, 2 Jul 2022 09:41:02 +1000 Subject: [PATCH] Cleanup and Alignment --- src/Application/Application.csproj | 4 ++++ src/Application/Authors/Entities/Author.cs | 4 ++-- src/Application/Movies/Entities/Movie.cs | 4 ++-- src/Application/Reviews/Entities/Review.cs | 6 +++--- .../Databases/MoviesReviews/Mapping/ReviewMappingProfile.cs | 2 +- .../Queries/GetAuthorById/GetAuthorByIdHandlerTests.cs | 6 +++--- .../Queries/GetAuthorById/GetAuthorByIdValidatorTests.cs | 2 +- .../Authors/Queries/GetAuthors/ReadAllHandlerTests.cs | 6 +++--- .../Common/Behaviours/ValidationBehaviourTests.cs | 6 +++--- .../Queries/GetMovieById/GetReviewByIdHandlerTests.cs | 6 +++--- .../Queries/GetMovieById/GetReviewByIdValidatorTests.cs | 2 +- .../Movies/Queries/GetMovies/GetMoviesHandlerTests.cs | 6 +++--- .../Commands/CreateReview/CreateReviewHandlerTests.cs | 2 +- .../Commands/DeleteReview/DeleteReviewHandlerTests.cs | 4 ++-- .../Commands/DeleteReview/DeleteReviewValidatorTests.cs | 2 +- .../Commands/UpdateReview/UpdateReviewHandlerTests.cs | 4 ++-- .../Commands/UpdateReview/UpdateReviewValidatorTests.cs | 2 +- .../Queries/GetReviewById/GetReviewByIdHandlerTests.cs | 6 +++--- .../Queries/GetReviewById/GetReviewByIdValidatorTests.cs | 2 +- .../Reviews/Queries/GetReviews/GetReviewsHandlerTests.cs | 4 ++-- .../Version/Queries/GetVersion/GetVersionHandlerTests.cs | 2 +- .../MovieReviews/Extensions/MovieReviewsCollectionData.cs | 2 +- .../Databases/MovieReviews/MovieReviewsCollectionFixture.cs | 2 +- 23 files changed, 45 insertions(+), 41 deletions(-) diff --git a/src/Application/Application.csproj b/src/Application/Application.csproj index 7435058..41f0f3e 100644 --- a/src/Application/Application.csproj +++ b/src/Application/Application.csproj @@ -24,4 +24,8 @@ + + + + diff --git a/src/Application/Authors/Entities/Author.cs b/src/Application/Authors/Entities/Author.cs index bc48d6d..a75abdc 100644 --- a/src/Application/Authors/Entities/Author.cs +++ b/src/Application/Authors/Entities/Author.cs @@ -1,7 +1,7 @@ namespace CleanMinimalApi.Application.Authors.Entities; -using CleanMinimalApi.Application.Common.Entities; -using CleanMinimalApi.Application.Reviews.Entities; +using Application.Common.Entities; +using Application.Reviews.Entities; public record Author : Entity { diff --git a/src/Application/Movies/Entities/Movie.cs b/src/Application/Movies/Entities/Movie.cs index d2ab5db..db9ea18 100644 --- a/src/Application/Movies/Entities/Movie.cs +++ b/src/Application/Movies/Entities/Movie.cs @@ -1,7 +1,7 @@ namespace CleanMinimalApi.Application.Movies.Entities; -using CleanMinimalApi.Application.Common.Entities; -using CleanMinimalApi.Application.Reviews.Entities; +using Application.Common.Entities; +using Application.Reviews.Entities; public record Movie : Entity { diff --git a/src/Application/Reviews/Entities/Review.cs b/src/Application/Reviews/Entities/Review.cs index 42c4ec3..46d5019 100644 --- a/src/Application/Reviews/Entities/Review.cs +++ b/src/Application/Reviews/Entities/Review.cs @@ -1,8 +1,8 @@ namespace CleanMinimalApi.Application.Reviews.Entities; -using CleanMinimalApi.Application.Authors.Entities; -using CleanMinimalApi.Application.Common.Entities; -using CleanMinimalApi.Application.Movies.Entities; +using Application.Authors.Entities; +using Application.Common.Entities; +using Application.Movies.Entities; public record Review : Entity { diff --git a/src/Infrastructure/Databases/MoviesReviews/Mapping/ReviewMappingProfile.cs b/src/Infrastructure/Databases/MoviesReviews/Mapping/ReviewMappingProfile.cs index 95b0c79..d08931f 100644 --- a/src/Infrastructure/Databases/MoviesReviews/Mapping/ReviewMappingProfile.cs +++ b/src/Infrastructure/Databases/MoviesReviews/Mapping/ReviewMappingProfile.cs @@ -4,7 +4,7 @@ namespace CleanMinimalApi.Infrastructure.Databases.MoviesReviews.Mapping; using Application = Application.Reviews.Entities; using Infrastructure = Models; -public class ReviewMappingProfile : Profile +internal class ReviewMappingProfile : Profile { public ReviewMappingProfile() { diff --git a/tests/Application.Tests.Unit/Authors/Queries/GetAuthorById/GetAuthorByIdHandlerTests.cs b/tests/Application.Tests.Unit/Authors/Queries/GetAuthorById/GetAuthorByIdHandlerTests.cs index 500c7c2..94c7a7a 100644 --- a/tests/Application.Tests.Unit/Authors/Queries/GetAuthorById/GetAuthorByIdHandlerTests.cs +++ b/tests/Application.Tests.Unit/Authors/Queries/GetAuthorById/GetAuthorByIdHandlerTests.cs @@ -2,10 +2,10 @@ namespace CleanMinimalApi.Application.Tests.Unit.Authors.Queries.GetAuthorById; using System.Threading; using System.Threading.Tasks; +using Application.Authors; using Application.Authors.Entities; -using CleanMinimalApi.Application.Authors; -using CleanMinimalApi.Application.Authors.Queries.GetAuthorById; -using CleanMinimalApi.Application.Common.Exceptions; +using Application.Authors.Queries.GetAuthorById; +using Application.Common.Exceptions; using NSubstitute; using Shouldly; using Xunit; diff --git a/tests/Application.Tests.Unit/Authors/Queries/GetAuthorById/GetAuthorByIdValidatorTests.cs b/tests/Application.Tests.Unit/Authors/Queries/GetAuthorById/GetAuthorByIdValidatorTests.cs index c03dcbc..7716a46 100644 --- a/tests/Application.Tests.Unit/Authors/Queries/GetAuthorById/GetAuthorByIdValidatorTests.cs +++ b/tests/Application.Tests.Unit/Authors/Queries/GetAuthorById/GetAuthorByIdValidatorTests.cs @@ -1,6 +1,6 @@ namespace CleanMinimalApi.Application.Tests.Unit.Authors.Queries.GetAuthorById; -using CleanMinimalApi.Application.Authors.Queries.GetAuthorById; +using Application.Authors.Queries.GetAuthorById; using FluentValidation.TestHelper; using Xunit; diff --git a/tests/Application.Tests.Unit/Authors/Queries/GetAuthors/ReadAllHandlerTests.cs b/tests/Application.Tests.Unit/Authors/Queries/GetAuthors/ReadAllHandlerTests.cs index d15fc41..8c3f273 100644 --- a/tests/Application.Tests.Unit/Authors/Queries/GetAuthors/ReadAllHandlerTests.cs +++ b/tests/Application.Tests.Unit/Authors/Queries/GetAuthors/ReadAllHandlerTests.cs @@ -2,9 +2,9 @@ namespace CleanMinimalApi.Application.Tests.Unit.Authors.Queries.GetAuthors; using System.Threading; using System.Threading.Tasks; -using CleanMinimalApi.Application.Authors; -using CleanMinimalApi.Application.Authors.Entities; -using CleanMinimalApi.Application.Authors.Queries.GetAuthors; +using Application.Authors; +using Application.Authors.Entities; +using Application.Authors.Queries.GetAuthors; using NSubstitute; using Shouldly; using Xunit; diff --git a/tests/Application.Tests.Unit/Common/Behaviours/ValidationBehaviourTests.cs b/tests/Application.Tests.Unit/Common/Behaviours/ValidationBehaviourTests.cs index f721707..b5679bd 100644 --- a/tests/Application.Tests.Unit/Common/Behaviours/ValidationBehaviourTests.cs +++ b/tests/Application.Tests.Unit/Common/Behaviours/ValidationBehaviourTests.cs @@ -3,9 +3,9 @@ namespace CleanMinimalApi.Application.Tests.Unit.Common.Behaviours; using System.Collections.Generic; using System.Linq; using System.Threading; -using CleanMinimalApi.Application.Authors.Entities; -using CleanMinimalApi.Application.Authors.Queries.GetAuthorById; -using CleanMinimalApi.Application.Common.Behaviours; +using Application.Authors.Entities; +using Application.Authors.Queries.GetAuthorById; +using Application.Common.Behaviours; using FluentValidation; using MediatR; using NSubstitute; diff --git a/tests/Application.Tests.Unit/Movies/Queries/GetMovieById/GetReviewByIdHandlerTests.cs b/tests/Application.Tests.Unit/Movies/Queries/GetMovieById/GetReviewByIdHandlerTests.cs index 3ec7a04..9d030a4 100644 --- a/tests/Application.Tests.Unit/Movies/Queries/GetMovieById/GetReviewByIdHandlerTests.cs +++ b/tests/Application.Tests.Unit/Movies/Queries/GetMovieById/GetReviewByIdHandlerTests.cs @@ -2,10 +2,10 @@ namespace CleanMinimalApi.Application.Tests.Unit.Movies.Queries.GetMovieById; using System.Threading; using System.Threading.Tasks; +using Application.Common.Exceptions; +using Application.Movies; using Application.Movies.Entities; -using CleanMinimalApi.Application.Common.Exceptions; -using CleanMinimalApi.Application.Movies; -using CleanMinimalApi.Application.Movies.Queries.GetMovieById; +using Application.Movies.Queries.GetMovieById; using NSubstitute; using Shouldly; using Xunit; diff --git a/tests/Application.Tests.Unit/Movies/Queries/GetMovieById/GetReviewByIdValidatorTests.cs b/tests/Application.Tests.Unit/Movies/Queries/GetMovieById/GetReviewByIdValidatorTests.cs index 8d6be70..5e3e507 100644 --- a/tests/Application.Tests.Unit/Movies/Queries/GetMovieById/GetReviewByIdValidatorTests.cs +++ b/tests/Application.Tests.Unit/Movies/Queries/GetMovieById/GetReviewByIdValidatorTests.cs @@ -1,6 +1,6 @@ namespace CleanMinimalApi.Application.Tests.Unit.Movies.Queries.GetMovieById; -using CleanMinimalApi.Application.Reviews.Queries.GetReviewById; +using Application.Reviews.Queries.GetReviewById; using FluentValidation.TestHelper; using Xunit; diff --git a/tests/Application.Tests.Unit/Movies/Queries/GetMovies/GetMoviesHandlerTests.cs b/tests/Application.Tests.Unit/Movies/Queries/GetMovies/GetMoviesHandlerTests.cs index a3f4f4f..7b977f2 100644 --- a/tests/Application.Tests.Unit/Movies/Queries/GetMovies/GetMoviesHandlerTests.cs +++ b/tests/Application.Tests.Unit/Movies/Queries/GetMovies/GetMoviesHandlerTests.cs @@ -2,9 +2,9 @@ namespace CleanMinimalApi.Application.Tests.Unit.Movies.Queries.GetMovies; using System.Threading; using System.Threading.Tasks; -using CleanMinimalApi.Application.Movies; -using CleanMinimalApi.Application.Movies.Entities; -using CleanMinimalApi.Application.Movies.Queries.GetMovies; +using Application.Movies; +using Application.Movies.Entities; +using Application.Movies.Queries.GetMovies; using NSubstitute; using Shouldly; using Xunit; diff --git a/tests/Application.Tests.Unit/Reviews/Commands/CreateReview/CreateReviewHandlerTests.cs b/tests/Application.Tests.Unit/Reviews/Commands/CreateReview/CreateReviewHandlerTests.cs index 6750844..d18edf3 100644 --- a/tests/Application.Tests.Unit/Reviews/Commands/CreateReview/CreateReviewHandlerTests.cs +++ b/tests/Application.Tests.Unit/Reviews/Commands/CreateReview/CreateReviewHandlerTests.cs @@ -3,10 +3,10 @@ namespace CleanMinimalApi.Application.Tests.Unit.Reviews.Commands.CreateReview; using System.Threading; using System.Threading.Tasks; using Application.Authors; +using Application.Common.Exceptions; using Application.Movies; using Application.Reviews; using Application.Reviews.Commands.CreateReview; -using CleanMinimalApi.Application.Common.Exceptions; using NSubstitute; using Shouldly; using Xunit; diff --git a/tests/Application.Tests.Unit/Reviews/Commands/DeleteReview/DeleteReviewHandlerTests.cs b/tests/Application.Tests.Unit/Reviews/Commands/DeleteReview/DeleteReviewHandlerTests.cs index 8b54434..7c7934e 100644 --- a/tests/Application.Tests.Unit/Reviews/Commands/DeleteReview/DeleteReviewHandlerTests.cs +++ b/tests/Application.Tests.Unit/Reviews/Commands/DeleteReview/DeleteReviewHandlerTests.cs @@ -2,9 +2,9 @@ namespace CleanMinimalApi.Application.Tests.Unit.Reviews.Commands.DeleteReview; using System.Threading; using System.Threading.Tasks; +using Application.Common.Exceptions; using Application.Reviews; -using CleanMinimalApi.Application.Common.Exceptions; -using CleanMinimalApi.Application.Reviews.Commands.DeleteReview; +using Application.Reviews.Commands.DeleteReview; using NSubstitute; using Shouldly; using Xunit; diff --git a/tests/Application.Tests.Unit/Reviews/Commands/DeleteReview/DeleteReviewValidatorTests.cs b/tests/Application.Tests.Unit/Reviews/Commands/DeleteReview/DeleteReviewValidatorTests.cs index 10609ae..dcf30fd 100644 --- a/tests/Application.Tests.Unit/Reviews/Commands/DeleteReview/DeleteReviewValidatorTests.cs +++ b/tests/Application.Tests.Unit/Reviews/Commands/DeleteReview/DeleteReviewValidatorTests.cs @@ -1,6 +1,6 @@ namespace CleanMinimalApi.Application.Tests.Unit.Reviews.Commands.DeleteReview; -using CleanMinimalApi.Application.Reviews.Commands.DeleteReview; +using Application.Reviews.Commands.DeleteReview; using FluentValidation.TestHelper; using Xunit; diff --git a/tests/Application.Tests.Unit/Reviews/Commands/UpdateReview/UpdateReviewHandlerTests.cs b/tests/Application.Tests.Unit/Reviews/Commands/UpdateReview/UpdateReviewHandlerTests.cs index a866494..7be998f 100644 --- a/tests/Application.Tests.Unit/Reviews/Commands/UpdateReview/UpdateReviewHandlerTests.cs +++ b/tests/Application.Tests.Unit/Reviews/Commands/UpdateReview/UpdateReviewHandlerTests.cs @@ -2,9 +2,9 @@ namespace CleanMinimalApi.Application.Tests.Unit.Reviews.Commands.UpdateReview; using System.Threading; using System.Threading.Tasks; +using Application.Common.Exceptions; using Application.Reviews; -using CleanMinimalApi.Application.Common.Exceptions; -using CleanMinimalApi.Application.Reviews.Commands.UpdateReview; +using Application.Reviews.Commands.UpdateReview; using NSubstitute; using Shouldly; using Xunit; diff --git a/tests/Application.Tests.Unit/Reviews/Commands/UpdateReview/UpdateReviewValidatorTests.cs b/tests/Application.Tests.Unit/Reviews/Commands/UpdateReview/UpdateReviewValidatorTests.cs index 5371847..11aca06 100644 --- a/tests/Application.Tests.Unit/Reviews/Commands/UpdateReview/UpdateReviewValidatorTests.cs +++ b/tests/Application.Tests.Unit/Reviews/Commands/UpdateReview/UpdateReviewValidatorTests.cs @@ -1,6 +1,6 @@ namespace CleanMinimalApi.Application.Tests.Unit.Reviews.Commands.UpdateReview; -using CleanMinimalApi.Application.Reviews.Commands.UpdateReview; +using Application.Reviews.Commands.UpdateReview; using FluentValidation.TestHelper; using Xunit; diff --git a/tests/Application.Tests.Unit/Reviews/Queries/GetReviewById/GetReviewByIdHandlerTests.cs b/tests/Application.Tests.Unit/Reviews/Queries/GetReviewById/GetReviewByIdHandlerTests.cs index 88e274b..9e718db 100644 --- a/tests/Application.Tests.Unit/Reviews/Queries/GetReviewById/GetReviewByIdHandlerTests.cs +++ b/tests/Application.Tests.Unit/Reviews/Queries/GetReviewById/GetReviewByIdHandlerTests.cs @@ -2,10 +2,10 @@ namespace CleanMinimalApi.Application.Tests.Unit.Reviews.Queries.GetReviewById; using System.Threading; using System.Threading.Tasks; +using Application.Common.Exceptions; +using Application.Reviews; using Application.Reviews.Entities; -using CleanMinimalApi.Application.Common.Exceptions; -using CleanMinimalApi.Application.Reviews; -using CleanMinimalApi.Application.Reviews.Queries.GetReviewById; +using Application.Reviews.Queries.GetReviewById; using NSubstitute; using Shouldly; using Xunit; diff --git a/tests/Application.Tests.Unit/Reviews/Queries/GetReviewById/GetReviewByIdValidatorTests.cs b/tests/Application.Tests.Unit/Reviews/Queries/GetReviewById/GetReviewByIdValidatorTests.cs index c307832..1ec5770 100644 --- a/tests/Application.Tests.Unit/Reviews/Queries/GetReviewById/GetReviewByIdValidatorTests.cs +++ b/tests/Application.Tests.Unit/Reviews/Queries/GetReviewById/GetReviewByIdValidatorTests.cs @@ -1,6 +1,6 @@ namespace CleanMinimalApi.Application.Tests.Unit.Reviews.Queries.GetReviewById; -using CleanMinimalApi.Application.Reviews.Queries.GetReviewById; +using Application.Reviews.Queries.GetReviewById; using FluentValidation.TestHelper; using Xunit; diff --git a/tests/Application.Tests.Unit/Reviews/Queries/GetReviews/GetReviewsHandlerTests.cs b/tests/Application.Tests.Unit/Reviews/Queries/GetReviews/GetReviewsHandlerTests.cs index ca5370c..212e11b 100644 --- a/tests/Application.Tests.Unit/Reviews/Queries/GetReviews/GetReviewsHandlerTests.cs +++ b/tests/Application.Tests.Unit/Reviews/Queries/GetReviews/GetReviewsHandlerTests.cs @@ -3,8 +3,8 @@ namespace CleanMinimalApi.Application.Tests.Unit.Reviews.Queries.GetReviews; using System.Threading; using System.Threading.Tasks; using Application.Reviews; -using CleanMinimalApi.Application.Reviews.Entities; -using CleanMinimalApi.Application.Reviews.Queries.GetReviews; +using Application.Reviews.Entities; +using Application.Reviews.Queries.GetReviews; using NSubstitute; using Shouldly; using Xunit; diff --git a/tests/Application.Tests.Unit/Version/Queries/GetVersion/GetVersionHandlerTests.cs b/tests/Application.Tests.Unit/Version/Queries/GetVersion/GetVersionHandlerTests.cs index 23c0882..da8d1e6 100644 --- a/tests/Application.Tests.Unit/Version/Queries/GetVersion/GetVersionHandlerTests.cs +++ b/tests/Application.Tests.Unit/Version/Queries/GetVersion/GetVersionHandlerTests.cs @@ -2,7 +2,7 @@ namespace CleanMinimalApi.Application.Tests.Unit.Version.Queries.GetVersion; using System.Threading; using System.Threading.Tasks; -using CleanMinimalApi.Application.Versions.Queries.GetVersion; +using Application.Versions.Queries.GetVersion; using Shouldly; using Xunit; diff --git a/tests/Infrastructure.Tests.Integration/Databases/MovieReviews/Extensions/MovieReviewsCollectionData.cs b/tests/Infrastructure.Tests.Integration/Databases/MovieReviews/Extensions/MovieReviewsCollectionData.cs index 2a1e6cc..4ea2791 100644 --- a/tests/Infrastructure.Tests.Integration/Databases/MovieReviews/Extensions/MovieReviewsCollectionData.cs +++ b/tests/Infrastructure.Tests.Integration/Databases/MovieReviews/Extensions/MovieReviewsCollectionData.cs @@ -1,8 +1,8 @@ namespace CleanMinimalApi.Infrastructure.Tests.Integration.Databases.MovieReviews.Extensions; using System; -using CleanMinimalApi.Infrastructure.Databases.MoviesReviews.Models; using Infrastructure.Databases.MoviesReviews; +using Infrastructure.Databases.MoviesReviews.Models; internal static class MovieReviewsDbContextExtensions { diff --git a/tests/Infrastructure.Tests.Integration/Databases/MovieReviews/MovieReviewsCollectionFixture.cs b/tests/Infrastructure.Tests.Integration/Databases/MovieReviews/MovieReviewsCollectionFixture.cs index 33c827a..2509cff 100644 --- a/tests/Infrastructure.Tests.Integration/Databases/MovieReviews/MovieReviewsCollectionFixture.cs +++ b/tests/Infrastructure.Tests.Integration/Databases/MovieReviews/MovieReviewsCollectionFixture.cs @@ -2,9 +2,9 @@ namespace CleanMinimalApi.Infrastructure.Tests.Integration.Databases.MovieReview using System; using AutoMapper; -using CleanMinimalApi.Infrastructure.Databases.MoviesReviews.Mapping; using Extensions; using Infrastructure.Databases.MoviesReviews; +using Infrastructure.Databases.MoviesReviews.Mapping; using Microsoft.EntityFrameworkCore; using SimpleDateTimeProvider; using Xunit;