Skip to content

Commit

Permalink
Fixed failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
oskardudycz committed May 8, 2021
1 parent 1464e1c commit 796430c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions CQRS.Tests/TestsInfrasructure/ServiceLocator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public void RegisterCommandHandler<TCommand, TCommandHandler>(TCommandHandler co
where TCommand : IRequest
where TCommandHandler : IRequestHandler<TCommand>
{
Register(typeof(IRequestHandler<TCommand, Unit>), commandHandler, commandHandler);
Register(typeof(IRequestHandler<TCommand, Unit>), commandHandler);
//Registration needed internally by MediatR
Register(typeof(IEnumerable<IPipelineBehavior<TCommand, Unit>>), new List<IPipelineBehavior<TCommand, Unit>>());
}
Expand All @@ -36,7 +36,7 @@ public void RegisterQueryHandler<TQuery, TResponse>(IRequestHandler<TQuery, TRes

public IMediator GetMediator()
{
return new Mediator(type => Get(type).Single());
return new Mediator(type => Get(type).First());
}
}
}
4 changes: 2 additions & 2 deletions MediatR.Tests/Sending/MoreThanOneHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class MoreThanOneHandler
{
public class ServiceLocator
{
private readonly Dictionary<Type, List<object>> services = new Dictionary<Type, List<object>>();
private readonly Dictionary<Type, List<object>> services = new();

public void Register(Type type, params object[] implementations)
=> services.Add(type, implementations.ToList());
Expand Down Expand Up @@ -71,7 +71,7 @@ public MoreThanOneHandler()
//Registration needed internally by MediatR
serviceLocator.Register(typeof(IEnumerable<IPipelineBehavior<CreateIssueCommand, Unit>>), new List<IPipelineBehavior<CreateIssueCommand, Unit>>());

mediator = new Mediator(type => serviceLocator.Get(type).Single());
mediator = new Mediator(type => serviceLocator.Get(type).First());
}

[Fact]
Expand Down

0 comments on commit 796430c

Please sign in to comment.