public void PluginLoadEvent_Constructor() { var plugin = new Mock<Plugin>(); var pluginLoadEvent = new PluginLoadEvent(plugin.Object); TestUtils.AssertArgumentException(() => new PluginLoadEvent(null)); Assert.AreEqual(plugin.Object, pluginLoadEvent.Plugin); }
public sealed override async Task LoadAsync() { var @event = new PluginLoadEvent(this); await EventBus.EmitAsync(this, this, @event); if (@event.IsCancelled) { return; } await base.LoadAsync(); await OnLoadAsync(); await EventBus.EmitAsync(this, this, new PluginLoadedEvent(this)); }