/// <summary> /// Register one or more events with a sender. /// </summary> /// <param name="sender"></param> /// <param name="config"></param> /// <returns></returns> public IEventBusConfiguration RegisterEvents(IMessageSender sender, Action <IFluentMessageRegistration <IEvent> > config) { // Start the fluent configuration. var registration = new FluentMessageRegistration <IEvent>(); config(registration); // Register. return(RegisterEvents(sender, registration)); }
public void GetTypesShouldReturnCorrectTypes() { // Arrange. var source = new FluentMessageRegistration <ICommand>() .With <SubmitOrderCommand>() .With <DeleteOrderCommand>(); // Act. var types = source.GetTypes(); // Assert. Assert.Equal(2, types.Length); Assert.Equal(typeof(DeleteOrderCommand), types[0]); Assert.Equal(typeof(SubmitOrderCommand), types[1]); }
public void GetTypesShouldReturnCorrectTypes() { // Arrange. var source = new FluentMessageRegistration<ICommand>() .With<SubmitOrderCommand>() .With<DeleteOrderCommand>(); // Act. var types = source.GetTypes(); // Assert. Assert.Equal(2, types.Length); Assert.Equal(typeof(DeleteOrderCommand), types[0]); Assert.Equal(typeof(SubmitOrderCommand), types[1]); }