Skip to content
This repository was archived by the owner on Jul 2, 2022. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/Commands/Merq.Commands.Tests/CommandBusSpec.cs
Original file line number Diff line number Diff line change
Expand Up @@ -278,5 +278,13 @@ IEnumerable<Result> ICommandHandler<CommandWithResults, IEnumerable<Result>>.Exe
yield return result;
}
}

// Ensure all test to be run using a derived command bus class
class CommandBus : Merq.CommandBus
{
public CommandBus (IEnumerable<ICommandHandler> handlers) : base (handlers) { }

public CommandBus (params ICommandHandler[] handlers) : base (handlers) { }
}
}
}
4 changes: 2 additions & 2 deletions src/Commands/Merq.Commands/CommandBus.cs
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,9 @@ object ExecuteImpl (string methodName, Type[] typeArguments, params object[] par
//
// commandBus.Execute (new MyCommand ()) // void command
// var result = commandBus.execute (new MyCommandWithResult ()) // command with result

try {
return this.GetType ()
return typeof (CommandBus)
.GetTypeInfo ()
.GetDeclaredMethod (methodName)
.MakeGenericMethod (typeArguments)
Expand Down