コード例 #1
0
 public void MyTestInitialize()
 {
     global  = new GlobalCommand("app", "App Command", Access.Administrator);
     command = new TestCommand();
     global.AddCommand(command);
     global.AddCommand(new TestCommand2());
 }
コード例 #2
0
        public void Dispose_RemovesAllCommands_When_Called()
        {
            var c1 = new TestCommand();

            var gc = new GlobalCommand("temp", "help", Access.Administrator);

            gc.AddToConsole();
            gc.AddCommand(c1);

            Assert.IsTrue(gc.IsCommandRegistered(c1));

            gc.Dispose();

            Assert.IsFalse(gc.IsCommandRegistered(c1));
        }
コード例 #3
0
        public void AddCommand_Returns_Success()
        {
            var expected = RegisterResult.Success;
            var c1       = new TestCommand();
            var actual   = underTest.AddCommand(c1);

            Assert.IsTrue(expected == actual);
        }