using System.Threading.Tasks; using Shouldly; using Xunit; namespace Volo.Abp.EventBus { public class EventBus_DI_Services_Test : EventBusTestBase { [Fact] public async Task Should_Automatically_Register_EventHandlers_From_Services() { EventBus.Trigger(new MySimpleEventData(1)); await EventBus.TriggerAsync(new MySimpleEventData(2)); EventBus.Trigger(new MySimpleEventData(3)); await EventBus.TriggerAsync(new MySimpleEventData(4)); GetRequiredService().TotalData.ShouldBe(10); GetRequiredService().TotalData.ShouldBe(10); } } }