Open Source Web Application Framework for ASP.NET Core
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
777 B

using System.Threading.Tasks;
using Xunit;
namespace Volo.Abp.EventBus.Local
{
public class TransientDisposableEventHandlerTest : EventBusTestBase
{
[Fact]
public async Task Should_Call_Handler_AndDispose()
{
LocalEventBus.Subscribe<MySimpleEventData, MySimpleTransientEventHandler>();
await LocalEventBus.PublishAsync(new MySimpleEventData(1)).ConfigureAwait(false);
await LocalEventBus.PublishAsync(new MySimpleEventData(2)).ConfigureAwait(false);
await LocalEventBus.PublishAsync(new MySimpleEventData(3)).ConfigureAwait(false);
Assert.Equal(3, MySimpleTransientEventHandler.HandleCount);
Assert.Equal(3, MySimpleTransientEventHandler.DisposeCount);
}
}
}