public async Task Should_Not_Call_Action_After_Unregister_2() { var totalData = 0; var action = new Func <MySimpleEventData, Task>( eventData => { totalData += eventData.Value; return(Task.CompletedTask); }); LocalEventBus.Subscribe(action); await LocalEventBus.PublishAsync(new MySimpleEventData(1)); await LocalEventBus.PublishAsync(new MySimpleEventData(2)); await LocalEventBus.PublishAsync(new MySimpleEventData(3)); LocalEventBus.Unsubscribe(action); await LocalEventBus.PublishAsync(new MySimpleEventData(4)); Assert.Equal(6, totalData); }