Beispiel #1
0
        public void TestListCommands()
        {
            CRegistery.Clear();

            CCommand a11 = new cmd_a11();
            CCommand a12 = new cmd_a12();
            CCommand b11 = new cmd_b11();
            CCommand b12 = new cmd_b12();

            CRegistery.Register(a11);
            CRegistery.Register(a12);
            CRegistery.Register(b11);
            CRegistery.Register(b12);

            IList <CCommand> commands = CRegistery.ListCommands();

            AssertTypes(commands, typeof(cmd_a11), typeof(cmd_a12), typeof(cmd_b11), typeof(cmd_b12));

            commands = CRegistery.ListCommands("a");
            AssertTypes(commands, typeof(cmd_a11), typeof(cmd_a12));

            commands = CRegistery.ListCommands("a1");
            AssertTypes(commands, typeof(cmd_a11), typeof(cmd_a12));

            commands = CRegistery.ListCommands("a11");
            AssertTypes(commands, typeof(cmd_a11));

            commands = CRegistery.ListCommands("a13");
            AssertTypes(commands);
        }
        public void TestListCommands()
        {
            CRegistery.Clear();

            CCommand a11 = new cmd_a11();
            CCommand a12 = new cmd_a12();
            CCommand b11 = new cmd_b11();
            CCommand b12 = new cmd_b12();

            CRegistery.Register(a11);
            CRegistery.Register(a12);
            CRegistery.Register(b11);
            CRegistery.Register(b12);

            IList<CCommand> commands = CRegistery.ListCommands();
            AssertTypes(commands, typeof(cmd_a11), typeof(cmd_a12), typeof(cmd_b11), typeof(cmd_b12));

            commands = CRegistery.ListCommands("a");
            AssertTypes(commands, typeof(cmd_a11), typeof(cmd_a12));

            commands = CRegistery.ListCommands("a1");
            AssertTypes(commands, typeof(cmd_a11), typeof(cmd_a12));

            commands = CRegistery.ListCommands("a11");
            AssertTypes(commands, typeof(cmd_a11));

            commands = CRegistery.ListCommands("a13");
            AssertTypes(commands);
        }