public async Task PushblishTest() { var services = TestSetup.ConfigService(serviceCollection => { serviceCollection .AddLightweightEventBusModule() .ConfigureModule(); }); var eventBus = services.GetRequiredService <IEventBus>(); eventBus.Subscribe <TestEvent>( new TestApplicationEventHandler[] { new TestApplicationEventHandler() { Id = 0 }, new TestApplicationEventHandler() { Id = 1 } } ); for (var i = 0; i < 10; i++) { await eventBus.PublishAsync(new TestEvent { Id = i }); await Task.Delay(200); } await Task.Delay(20000); eventBus.Dispose(); Assert.True(true); }
public RyeLoggerTests() { TestSetup.ConfigService(serviceCollection => serviceCollection.AddRye().ConfigureModule()); }