You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
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<MySimpleEventDataHandler>().TotalData.ShouldBe(10);
|
|
|
|
|
GetRequiredService<MySimpleAsyncEventDataHandler>().TotalData.ShouldBe(10);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|