Skip to content

Releases: fusonic/dotnet-extensions

10.1.0

18 Mar 12:21

Choose a tag to compare

Features ⭐

  • Allow specific domains to be ignored for sending emails

Full Changelog: 10.0.1...10.1.0

10.0.1

17 Mar 12:24

Choose a tag to compare

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

25 Nov 12:39

Choose a tag to compare

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.ServiceProvider
  • Fusonic.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 xunit with xunit.v3.mtp-v2 info
    • Alternative: Transient dependency via extensions (without xunit.v3.assert)
    • Alternative: Reference xunit.v3.core.mtp-v2 and xunit.analyzers for xunit without assertions
  • Add <OutputType>Exe</OutputType> in test projects
  • Replace coverlet.collector with Microsoft.Testing.Extensions.CodeCoverage -> MTP coverage
  • Add Microsoft.Testing.Extensions.TrxReport for test results in MR
  • When using FluentAssertions, consider migrating to AwesomeAssertions, 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 suggestion in .editorconfig
      • dotnet_diagnostic.xUnit1051.severity = suggestion # xUnit1051: Calls to methods which accept CancellationToken should use TestContext.Current.CancellationToken
  • Test database handling was simplified. Test database template creation is now intended to be done in the TestStartup of a test assembly.
    • Example
    • Documentation
    • TestStorageSettings don't exist anymore. Only connection strings are passed directly to the stores.
    • Call CreateTemplate in TestStartup

Pipeline

  • Remove include to fusonic/devops/images/gitlab-ci-tools/dotnet_test.yml
  • Remove dotnet:check-warnings and 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.slnx

When 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 FluentAssertions with AwesomeAssertions

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

12 Sep 10:17

Choose a tag to compare

10.0.0-rc.1 Pre-release
Pre-release

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

21 Aug 09:15

Choose a tag to compare

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

28 Mar 12:33

Choose a tag to compare

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

16 Jan 09:37

Choose a tag to compare

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

26 Sep 13:29

Choose a tag to compare

#89: Allow emails to be dynamically post processed ([5de65ad])

9.3.0

11 Sep 08:39

Choose a tag to compare

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

9.1.0

29 Jul 13:40

Choose a tag to compare

Features ⭐

  • RegisterMediator helper to easily register mediator ([934fec9])

Bug Fixes 🐛

  • Change Send parameter to use type parameter instead ([1fc5ac2])
  • Change Send/Publish overloads to properly get selected by the overload selection ([d03087e])

Documentation 📒