martinothamar / Mediator

A high performance implementation of Mediator pattern in .NET using source generators.
MIT License
2.16k stars 71 forks source link

Upgrade to .NET 8, upgrade csharpier and lots of pkgs, fix tests and remove Roslyn 3.8/4.0 support, enable central package management #140

Closed martinothamar closed 8 months ago

martinothamar commented 8 months ago

Todo

TimothyMakkison commented 8 months ago

Consolidate test projects? There's a lot of projects

The current test system is a little clunky, creating a whole new solution for a test case is annoying.

I'd considered changing tests to use a helper class with a variety of default programs where you can add or set a certain part. Currently Mediator uses something like:

var source = await Fixture.SourceFromResourceFile("DuplicateHandlersProgram.cs");

Instead:

var source = await TestHelper.PingRequest.With(
"""
public sealed class DuplicatePingHandler : IRequestHandler<Ping, Pong>
{
    public ValueTask<Pong> Handle(Ping request, CancellationToken cancellationToken)
    {
        return new ValueTask<Pong>(new Pong(request.Id));
    }
}
""");

This system could be used for certain tests, I'm not sure about all of them.

martinothamar commented 8 months ago

I managed to remove a couple of projects both for test and src due to getting rid of everything but roslyn 4.1 stuff The latest .NET 6 SDK has is 4.3.1 so hopefully this is fine :smile: image