Skip to content

Commit

Permalink
Simplified unit testing framework, moved EF Core abstractions, .NET 7…
Browse files Browse the repository at this point in the history
… release
  • Loading branch information
jhartmann123 committed Jan 24, 2023
1 parent 7d73af2 commit 9e85f69
Show file tree
Hide file tree
Showing 145 changed files with 915 additions and 3,130 deletions.
4 changes: 2 additions & 2 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,8 @@ dotnet_remove_unnecessary_suppression_exclusions = none:warning

# C# Unnecessary code rules
[*.{cs,csx,cake}]
csharp_style_unused_value_expression_statement_preference = discard_variable:suggestion
dotnet_diagnostic.IDE0058.severity = suggestion
csharp_style_unused_value_expression_statement_preference = discard_variable:silent
dotnet_diagnostic.IDE0058.severity = silent
csharp_style_unused_value_assignment_preference = discard_variable:suggestion
dotnet_diagnostic.IDE0059.severity = suggestion

Expand Down
7 changes: 2 additions & 5 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,10 @@ test:
POSTGRES_PASSWORD: postgres
BACKEND_SRC_DIR: src/**
SLN_PATH: Extensions.sln
ConnectionString: Host=postgres;Database=test;Username=postgres;Password=postgres
environment:
name: review/$CI_COMMIT_REF_SLUG
url: https://fusonic.gitlab.io/-/devops/dotnet/extensions/-/jobs/${CI_JOB_ID}/artifacts/reports/dotnetcoverage/index.html
script:
- export TemplateConnectionString="Host=postgres;Database=test;Username=postgres;Password=postgres"
- dotnet run --project "src/UnitTests.EntityFrameworkCore.Npgsql/template/UnitTests.EntityFrameworkCore.Npgsql.TestDbTemplateCreator.csproj" "${TemplateConnectionString}"
- !reference [.dotnet-test, script]

publish:
image: mcr.microsoft.com/dotnet/sdk:7.0
Expand All @@ -54,4 +51,4 @@ publish:
when: manual
only:
- /^release\/.*$/
- main
- main
34 changes: 10 additions & 24 deletions Extensions.sln
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Hosting", "src\Hosting\src\
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Hosting.Tests", "src\Hosting\test\Hosting.Tests.csproj", "{32C689D9-1CC6-4FBD-9EF4-91BCF39B0FC1}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "XUnit.Tests", "src\XUnit\test\XUnit.Tests.csproj", "{2721A46C-6ED7-4427-BBE2-AB766D9D1FF1}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "XUnit", "src\XUnit\src\XUnit.csproj", "{E2B7EB8C-267D-426C-BB97-D4FBC5B151E9}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EntityFrameworkCore.Tests", "src\EntityFrameworkCore\test\EntityFrameworkCore.Tests.csproj", "{68F735B4-D3E5-477F-8071-F65D1C2137E2}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UnitTests.EntityFrameworkCore.Tests", "src\UnitTests.EntityFrameworkCore\test\UnitTests.EntityFrameworkCore.Tests.csproj", "{94896282-9BBC-4373-B543-7FAC9F268695}"
Expand All @@ -53,9 +49,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UnitTests.EntityFrameworkCo
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UnitTests.EntityFrameworkCore.Npgsql", "src\UnitTests.EntityFrameworkCore.Npgsql\src\UnitTests.EntityFrameworkCore.Npgsql.csproj", "{4989F141-4A89-4CE0-80E2-3EA4170552D3}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UnitTests.EntityFrameworkCore.Npgsql.TestDbTemplateCreator", "src\UnitTests.EntityFrameworkCore.Npgsql\template\UnitTests.EntityFrameworkCore.Npgsql.TestDbTemplateCreator.csproj", "{1359BBC2-7C58-42F1-8E92-BF073CE44208}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UnitTests.SimpleInjector", "src\UnitTests.SimpleInjector\src\UnitTests.SimpleInjector.csproj", "{0FA88398-9B9F-4C41-92B8-08CBF99F249A}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EntityFrameworkCore.Abstractions", "src\EntityFrameworkCore.Abstractions\src\EntityFrameworkCore.Abstractions.csproj", "{E292E274-10B4-4ACE-B822-C526CCF01568}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UnitTests.ServiceProvider", "src\UnitTests.ServiceProvider\src\UnitTests.ServiceProvider.csproj", "{3624084E-62DA-40BD-8A5B-C933FA3151BB}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down Expand Up @@ -115,14 +111,6 @@ Global
{32C689D9-1CC6-4FBD-9EF4-91BCF39B0FC1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{32C689D9-1CC6-4FBD-9EF4-91BCF39B0FC1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{32C689D9-1CC6-4FBD-9EF4-91BCF39B0FC1}.Release|Any CPU.Build.0 = Release|Any CPU
{2721A46C-6ED7-4427-BBE2-AB766D9D1FF1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2721A46C-6ED7-4427-BBE2-AB766D9D1FF1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2721A46C-6ED7-4427-BBE2-AB766D9D1FF1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2721A46C-6ED7-4427-BBE2-AB766D9D1FF1}.Release|Any CPU.Build.0 = Release|Any CPU
{E2B7EB8C-267D-426C-BB97-D4FBC5B151E9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E2B7EB8C-267D-426C-BB97-D4FBC5B151E9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E2B7EB8C-267D-426C-BB97-D4FBC5B151E9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E2B7EB8C-267D-426C-BB97-D4FBC5B151E9}.Release|Any CPU.Build.0 = Release|Any CPU
{68F735B4-D3E5-477F-8071-F65D1C2137E2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{68F735B4-D3E5-477F-8071-F65D1C2137E2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{68F735B4-D3E5-477F-8071-F65D1C2137E2}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand All @@ -143,14 +131,14 @@ Global
{4989F141-4A89-4CE0-80E2-3EA4170552D3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4989F141-4A89-4CE0-80E2-3EA4170552D3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4989F141-4A89-4CE0-80E2-3EA4170552D3}.Release|Any CPU.Build.0 = Release|Any CPU
{1359BBC2-7C58-42F1-8E92-BF073CE44208}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1359BBC2-7C58-42F1-8E92-BF073CE44208}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1359BBC2-7C58-42F1-8E92-BF073CE44208}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1359BBC2-7C58-42F1-8E92-BF073CE44208}.Release|Any CPU.Build.0 = Release|Any CPU
{E292E274-10B4-4ACE-B822-C526CCF01568}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E292E274-10B4-4ACE-B822-C526CCF01568}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E292E274-10B4-4ACE-B822-C526CCF01568}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E292E274-10B4-4ACE-B822-C526CCF01568}.Release|Any CPU.Build.0 = Release|Any CPU
{0FA88398-9B9F-4C41-92B8-08CBF99F249A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0FA88398-9B9F-4C41-92B8-08CBF99F249A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0FA88398-9B9F-4C41-92B8-08CBF99F249A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0FA88398-9B9F-4C41-92B8-08CBF99F249A}.Release|Any CPU.Build.0 = Release|Any CPU
{3624084E-62DA-40BD-8A5B-C933FA3151BB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3624084E-62DA-40BD-8A5B-C933FA3151BB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3624084E-62DA-40BD-8A5B-C933FA3151BB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3624084E-62DA-40BD-8A5B-C933FA3151BB}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -161,11 +149,9 @@ Global
{4443416D-35A0-48B0-AA92-785FECFDE582} = {95D2383B-80C5-46AA-9190-826A0377A156}
{C0FDFA5A-5421-40A1-8653-823FB9C94E5C} = {95D2383B-80C5-46AA-9190-826A0377A156}
{32C689D9-1CC6-4FBD-9EF4-91BCF39B0FC1} = {95D2383B-80C5-46AA-9190-826A0377A156}
{2721A46C-6ED7-4427-BBE2-AB766D9D1FF1} = {95D2383B-80C5-46AA-9190-826A0377A156}
{68F735B4-D3E5-477F-8071-F65D1C2137E2} = {95D2383B-80C5-46AA-9190-826A0377A156}
{94896282-9BBC-4373-B543-7FAC9F268695} = {95D2383B-80C5-46AA-9190-826A0377A156}
{86B0E8DD-25F8-46DF-95D5-781ECC1BCB13} = {95D2383B-80C5-46AA-9190-826A0377A156}
{1359BBC2-7C58-42F1-8E92-BF073CE44208} = {95D2383B-80C5-46AA-9190-826A0377A156}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {DCAD7035-5EC8-4B6E-82B5-769C5A4892EA}
Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@ Adds support for sending emails. See the [documentation](docs/Email/README.md) f
[![NuGet](https://img.shields.io/nuget/v/Fusonic.Extensions.EntityFrameworkCore.svg?label=Fusonic.Extensions.EntityFrameworkCore&style=plastic)](https://www.nuget.org/packages/Fusonic.Extensions.EntityFrameworkCore/)
Extensions for EF Core.

[![NuGet](https://img.shields.io/nuget/v/Fusonic.Extensions.EntityFrameworkCore.Abstractions.svg?label=Fusonic.Extensions.EntityFrameworkCore.Abstractions&style=plastic)](https://www.nuget.org/packages/Fusonic.Extensions.EntityFrameworkCore.Abstractions/)
Abstractions to the EF Core extensions without referencing EF Core.

[![NuGet](https://img.shields.io/nuget/v/Fusonic.Extensions.Hangfire.svg?label=Fusonic.Extensions.Hangfire&style=plastic)](https://www.nuget.org/packages/Fusonic.Extensions.Hangfire/)
Provides Hangfire extensions, especially suited for CQRS developement. (Out of band processing). See the [documentation](docs/Hangfire/README.md) for more details.

Expand All @@ -43,17 +40,20 @@ Provides services and extensions for hosting. See the [documentation](docs/Hosti
Provides abstractions for MediatR. See the [documentation](docs/MediatR/README.md) for more details.

[![NuGet](https://img.shields.io/nuget/v/Fusonic.Extensions.UnitTests.svg?label=Fusonic.Extensions.UnitTests&style=plastic)](https://www.nuget.org/packages/Fusonic.Extensions.UnitTests/)
Xunit-based testing base classes. Supports DI with SimpleInjector, MediatR-event-recordings, Lifetime-Scoped calls, a test context and so on. See the [unit test documentation](docs/UnitTests/README.md) for more details.
Xunit-based testing base classes with support for dependency injection. Libraries supporting specific DI containers (SimpleInjector, ServiceProvider) are in separate packages. See the [unit test documentation](docs/UnitTests/README.md) for more details.

[![NuGet](https://img.shields.io/nuget/v/Fusonic.Extensions.UnitTests.ServiceProvider.svg?label=Fusonic.Extensions.UnitTests.ServiceProvider&style=plastic)](https://www.nuget.org/packages/Fusonic.Extensions.UnitTests.ServiceProvider/)
Xunit-based testing base classes. Supports dependency injection with Microsofts Dependency Injection framework (ServiceProvider).. See the [unit test documentation](docs/UnitTests/README.md) for more details.

[![NuGet](https://img.shields.io/nuget/v/Fusonic.Extensions.UnitTests.SimpleInjector.svg?label=Fusonic.Extensions.UnitTests.SimpleInjector&style=plastic)](https://www.nuget.org/packages/Fusonic.Extensions.UnitTests.SimpleInjector/)
Xunit-based testing base classes. Supports dependency injection with SimpleInjector.. See the [unit test documentation](docs/UnitTests/README.md) for more details.

[![NuGet](https://img.shields.io/nuget/v/Fusonic.Extensions.UnitTests.EntityFrameworkCore.svg?label=Fusonic.Extensions.UnitTests.EntityFrameworkCore&style=plastic)](https://www.nuget.org/packages/Fusonic.Extensions.UnitTests.EntityFrameworkCore/)
Adds database support using EF Core to the unit tests. See the [unit test documentation](docs/UnitTests/README.md) for more details.

[![NuGet](https://img.shields.io/nuget/v/Fusonic.Extensions.UnitTests.EntityFrameworkCore.Npgsql.svg?label=Fusonic.Extensions.UnitTests.EntityFrameworkCore.Npgsql&style=plastic)](https://www.nuget.org/packages/Fusonic.Extensions.UnitTests.EntityFrameworkCore.Npgsql/)
Adds support for database tests using EF Core with PostgreSQL. See the [unit test documentation](docs/UnitTests/README.md) for more details.

[![NuGet](https://img.shields.io/nuget/v/Fusonic.Extensions.XUnit.svg?label=Fusonic.Extensions.XUnit&style=plastic)](https://www.nuget.org/packages/Fusonic.Extensions.XUnit/)
Extensions to XUnit. Provides an own framework adding capabilities like a test context and attributes running before a test class gets instantiated.


Important information
===============
Expand Down
Loading

0 comments on commit 9e85f69

Please sign in to comment.