Ejemplo n.º 1
0
        public void AddCommandTest()
        {
            var chatboxManager = new ChatCommandManager(_game);
            var command        = new TestCommand(_game, chatboxManager, "ChatboxManagerTestsTestCommand", "");
            var result         = chatboxManager.AddCommand(command);

            Assert.AreEqual(true, result);
            result = chatboxManager.AddCommand(command);
            Assert.AreEqual(false, result);
        }
Ejemplo n.º 2
0
        public void AddCommandTest()
        {
            var chatboxManager = new ChatCommandManager();

            var command = new HelpCommand("ChatboxManagerTestsTestCommand", "", chatboxManager);
            var result  = chatboxManager.AddCommand(command);

            Assert.AreEqual(true, result);
            result = chatboxManager.AddCommand(command);
            Assert.AreEqual(false, result);
        }
Ejemplo n.º 3
0
        public void RemoveCommandTest()
        {
            var chatboxManager = new ChatCommandManager(_game);
            var command        = new TestCommand(_game, chatboxManager, "ChatboxManagerTestsTestCommand", "");
            var result         = chatboxManager.AddCommand(command);

            Assert.AreEqual(true, result);

            var result2  = chatboxManager.RemoveCommand("ChatboxManagerTestsTestCommand");
            var commands = chatboxManager.GetCommandsStrings();

            Assert.AreEqual(true, result2);
            if (commands.Contains("ChatboxManagerTestsTestCommand"))
            {
                Assert.Fail();
            }
        }