Releases: fusonic/dotnet-extensions
10.1.0
10.0.1
Improvements 💡
- Make Microsoft.Extensions.DependencyInjection a private asset
Documentation 📒
- Readded Extensions.UnitTests to readme
Continuous Integration/Deployment 🚢
- Fixed GitHub tests
Routine work 🪛
- Removed unused packages from Directory.Packages.props
- Updated packages; changed TestStartup from ITestPipelineStartup to assembly fixture to avoid running the code during discovery
10.0.0
Relase notes
Framework
This release of Fusonic.Extensions only supports .NET 10. Do not upgrade if you don't intend to use .NET 10.
Dropped libraries
The libraries
Fusonic.Extensions.UnitTests.ServiceProviderFusonic.Extensions.UnitTests.SimpleInjector
got dropped. Their extensions got moved to the parent project Fusonic.Extensions.UnitTests.
When using SimpleInjector, no transient build dependency is delivered with Fusonic.Extensions.UnitTests, so you must reference it yourselves.
Testing
Libraries related to testing received the biggest changes:
- As FluentAssertions is not free anymore, we switched to its fork AwesomeAssertions
- All XUnit extensions got migrated to XUnit v3. XUnit v2 is no longer supported.
- As XUnit v3 now supports an single assembly-wide startup class, we moved to TestContainers for providing external services for testing, like a PostgreSQL database
XUnit migration
To migrate from XUnit v2 to XUnit v3, follow those steps:
Change the following NuGet references
- Replace
xunitwithxunit.v3.mtp-v2info- Alternative: Transient dependency via extensions (without xunit.v3.assert)
- Alternative: Reference
xunit.v3.core.mtp-v2andxunit.analyzersfor xunit without assertions
- Add
<OutputType>Exe</OutputType>in test projects - Replace
coverlet.collectorwithMicrosoft.Testing.Extensions.CodeCoverage-> MTP coverage - Add
Microsoft.Testing.Extensions.TrxReportfor test results in MR - When using
FluentAssertions, consider migrating toAwesomeAssertions, as outlined below
Code changes
- Add to TestBase.cs:
public CancellationToken CancellationToken => TestContext.Current.CancellationToken;because of xUnit1051- Alternative: Supress warning by setting it to
suggestionin.editorconfigdotnet_diagnostic.xUnit1051.severity = suggestion # xUnit1051: Calls to methods which accept CancellationToken should use TestContext.Current.CancellationToken
- Alternative: Supress warning by setting it to
- Test database handling was simplified. Test database template creation is now intended to be done in the TestStartup of a test assembly.
- Example
- Documentation
TestStorageSettingsdon't exist anymore. Only connection strings are passed directly to the stores.- Call
CreateTemplateinTestStartup
Pipeline
- Remove include to
fusonic/devops/images/gitlab-ci-tools/dotnet_test.yml - Remove
dotnet:check-warningsand extends on.dotnet-test - Add test components:
include:
- component: $CI_SERVER_FQDN/fusonic/devops/components/dotnet-test/dotnet-test@2.0.0
inputs:
sln-path: Extensions.slnx
- component: $CI_SERVER_FQDN/fusonic/devops/components/dotnet-test/dotnet-check-warnings@2.0.0
inputs:
sln-path: Extensions.slnxWhen you start to use TestContainers, ensure that docker:dind gets started with the tests:
dotnet:test:
services:
- docker:${DOCKER_VERSION}-dind-rootless
See .gitlab-ci.yml for an example.
AwesomeAssertions migration
The migration from FluentAssertions to AwesomeAssertions is pretty simple:
- Remove packages
FluentAssertions.* - Add
AwesomeAssertions - Optionally add
AwesomeAssertions.Analyzers - Globally search and replace
FluentAssertionswithAwesomeAssertions
The only breaking changes we experienced were renames like
- GreaterOrEqualTo -> GreaterThanOrEqualTo
- LowerOrEqualTo -> LowerThanOrEqualTo
TestContainers
For unit tests that require external services like databases we now utilize the test startup of XUnit v3, instead of relying on services running on local dev or the CI pipeline.
This simplifies the setup a bit, especially for local developers that now just can start the tests without having to start any other services beforehand.
Examples are documentend in the readme for the unit tests.
List of changes
Features ⭐
- cop#97: XUnit v3 support
Improvements 💡
- Added ServiceProvider support for Mediator
- #60: Document DbContextFactory, added TestContainers
- Moved DB template creation to TestStartup; Simplified test store
Routine work 🪛
- Updated to .NET10
- Migrate Solution to new slnx
- Replaced FluentAssertions with AwesomeAssertions
- Updated packages
Miscellaneous ❓
- Updated .editorconfig with some new settings
- Updated .editorconfig to include .csproj
10.0.0-rc.1
Breaking changes
- XUnit v3 Support
- Updated to .NET 10 RC.1
Fixes
- SendEmail: fixed issue where standard MimeMessage-Headers were duplicated instead of overwritten when set in the request
9.5.4
Bug Fixes 🐛
- SendEmail - fixed issue where standard MimeMessage-Headers were duplicated instead of overwritten when set in the request
Full Changelog: 9.5.3...9.5.4
9.5.3
Improvements 💡
- Out of band jobs with generic message types now also output the names of the generic arguments
Miscellaneous ❓
- Configure autocrlf so that windows always checks in \lf, regardless of local core.autocrlf setting
9.5.2
Features ⭐
- #86: Add an EF Core no action delete convention
Improvements 💡
- Hangfire jobs triggered by the OutOfBand-Decorators now have a better job title which includes the request type name
9.4.0
9.3.0
Features ⭐
- Added TempFileStream
- Added SuppressTransaction to TransactionScopeHandler
- Improved SQL Server testing to also support creating test data templates instead of recreating a fresh test database for each test
- Added mediator tracing capabilities
- Added decorator to allow global BCC address in all emails
Documentation 📒
- Removed some references to MediatR
Miscellaneous ❓
- Added missing file headers
- Fix namespaces
- Version bump