mirror of https://github.com/abpframework/abp
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.
21 lines
684 B
21 lines
684 B
using System.Threading.Tasks;
|
|
using Xunit;
|
|
|
|
namespace Volo.Abp.EventBus
|
|
{
|
|
public class TransientDisposableEventHandlerTest : EventBusTestBase
|
|
{
|
|
[Fact]
|
|
public async Task Should_Call_Handler_AndDispose()
|
|
{
|
|
EventBus.Register<MySimpleEventData, MySimpleTransientEventHandler>();
|
|
|
|
await EventBus.TriggerAsync(new MySimpleEventData(1));
|
|
await EventBus.TriggerAsync(new MySimpleEventData(2));
|
|
await EventBus.TriggerAsync(new MySimpleEventData(3));
|
|
|
|
Assert.Equal(3, MySimpleTransientEventHandler.HandleCount);
|
|
Assert.Equal(3, MySimpleTransientEventHandler.DisposeCount);
|
|
}
|
|
}
|
|
} |