/Source/Bifrost.Specs/Commands/for_CommandHandlerInvoker/when_handling_with_manually_registered_command_handlers.cs
C# | 29 lines | 24 code | 5 blank | 0 comment | 0 complexity | 1f1aa0710a446dfec34262d1614b08dc MD5 | raw file
Possible License(s): CC-BY-SA-3.0
- using Bifrost.Commands;
- using Machine.Specifications;
-
- namespace Bifrost.Specs.Commands.for_CommandHandlerInvoker
- {
- [Subject(Subjects.handling_commands)]
- public class when_handling_with_manually_registered_command_handlers : given.a_command_handler_invoker_with_no_command_handlers
- {
- static CommandHandler handler;
- static bool result;
-
- Establish context = () =>
- {
- handler = new CommandHandler();
- service_locator_mock.Setup(s => s.GetInstance(typeof (CommandHandler))).Returns(
- handler);
-
- invoker.Register(typeof (CommandHandler));
- };
-
- Because of = () =>
- {
- var command = new Command();
- result = invoker.TryHandle(command);
- };
-
- It should_return_true_when_trying_to_handle = () => result.ShouldBeTrue();
- }
- }