Beispiel #1
0
        public void GetShellCommandTest()
        {
            Type command = ShellCommand.GetShellCommand(Assembly.GetExecutingAssembly(), "test");

            Assert.AreEqual(typeof(TestCommand), command);

            command = ShellCommand.GetShellCommand(Assembly.GetExecutingAssembly(), "wrong");
            Assert.IsNull(command);

            command = ShellCommand.GetShellCommand(Assembly.GetExecutingAssembly(), "Test"); // default is case-insensitive
            Assert.AreEqual(typeof(TestCommand), command);

            command = ShellCommand.GetShellCommand(Assembly.GetExecutingAssembly(), "Test", StringComparer.Ordinal);
            Assert.IsNull(command);

            command = ShellCommand.GetShellCommand(Assembly.GetExecutingAssembly(), "AnotherCommand");
            Assert.AreEqual(typeof(AnotherCommand), command);
        }