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.
abp/test/Volo.Abp.EventBus.Tests/Volo/Abp/EventBus/TransientDisposableEventHan...

24 lines
859 B

using Xunit;
namespace Volo.Abp.EventBus
{
public class TransientDisposableEventHandlerTest : EventBusTestBase
{
[Fact]
public void Should_Call_Handler_AndDispose()
{
EventBus.Register<MySimpleEventData, MySimpleTransientEventHandler>();
EventBus.Register<MySimpleEventData, MySimpleTransientAsyncEventHandler>();
EventBus.Trigger(new MySimpleEventData(1));
EventBus.Trigger(new MySimpleEventData(2));
EventBus.Trigger(new MySimpleEventData(3));
Assert.Equal(3, MySimpleTransientEventHandler.HandleCount);
Assert.Equal(3, MySimpleTransientEventHandler.DisposeCount);
Assert.Equal(3, MySimpleTransientAsyncEventHandler.HandleCount);
Assert.Equal(3, MySimpleTransientAsyncEventHandler.DisposeCount);
}
}
}