public void should_return_handler_by_name()
 {
     var handler = new FakeMsgHandler("message");
     var registry = new HandlersRegistry();
     registry.Register(handler);
     var result = registry.First("message");
     Assert.Equal(handler, result);
 }
 public void first_should_return_handler_by_first_part()
 {
     var handler = new FakeMsgHandler("message");
     var registry = new HandlersRegistry();
     registry.Register(handler);
     var result = registry.First("message.secondpart");
     Assert.Equal(handler, result);
 }
 public void should_throw_error_if_handler_does_not_exist()
 {
     var registry = new HandlersRegistry();
     Assert.Throws<MicroservicesCoreException>(() => registry.First("message"));
 }
 public void should_throw_error_for_duplicated_handlers()
 {
     var registry = new HandlersRegistry();
     registry.Register(new FakeMsgHandler("message"));
     Assert.Throws<MicroservicesCoreException>(() => registry.Register(new FakeMsgHandler("message")));
 }
 public void should_successfuly_register_handler()
 {
     var registry = new HandlersRegistry();
     registry.Register(new FakeMsgHandler("message"));
 }