Ejemplo n.º 1
0
 public void CustomCommandCollectionCanAddSubCommandDirectly()
 {
     collection.AddSubCommand("test", "sub", "data");
     Assert.That(collection.ContainsCommand("test"), Is.True);
     Assert.That(collection.ContainsSubCommand("test", "sub"), Is.True);
     Assert.That(collection.Commands["test"].Subcommands["sub"], Is.EqualTo("data"));
 }
Ejemplo n.º 2
0
        public async Task CustomChatCommandCanRemoveSubCommands()
        {
            collection.AddSubCommand("test", "sub", "test_message");
            Assert.That(collection.ContainsSubCommand("test", "sub"), Is.True);
            var data = new ChatCommandData("command", new[] { "remove", "test", "sub" });
            await command.Process(chat, data);

            Assert.That(collection.ContainsSubCommand("test", "sub"), Is.False);
        }