Closed martinothamar closed 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.
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:
Todo