public void Initialize() { _commandsSet.Initialize(_dataStore.GetEntities <CustomCommand>()); _menuItemsSet.MenuItems.Add(new CommandsViewModel(_commandsSet)); // TODO: Move to Enable() _commandsSet.CustomCommands.ListChanged += CustomCommandsOnListChanged; // TODO: Move to Enable() }
public GetCommandsToRun_Should() { var services = new ServiceCollection(); services.AddSimpleCommandsPlugin(); _commandsSet = services.BuildServiceProvider().GetService <ICommandsSet>(); _customCommand = new CustomCommand { CommandWord = "!ping", Response = "PONG", Enabled = true, Access = Access.Everyone, }; _commandsSet.Initialize(new List <CustomCommand> { _customCommand }); }