public void UndefinedCommandsDoNotExist()
        {
            StandardCommandMap cm = new StandardCommandMap();

            cm.Load(@"Commands\commandmap.Simple.xml");

            Assert.False(cm.CommandExists("MiscellaneousCommand"));
        }
        public void DefaultFriendlyNamesIfUnspecified()
        {
            StandardCommandMap cm = new StandardCommandMap();

            cm.Load(@"Commands\commandmap.Simple.xml");

            Assert.Equal("CommandWithMissingFriendly", cm.GetFriendlyName("CommandWithMissingFriendly"));
        }
        public void AllExcludedCommandsDoNotExist()
        {
            StandardCommandMap cm = new StandardCommandMap();

            cm.Load(@"Commands\commandmap.Simple.xml");

            Assert.False(cm.CommandExists("ExcludedCommand"));
        }
        public void WhitespacesInFriendlyNameAreTrimmed()
        {
            StandardCommandMap cm = new StandardCommandMap();

            cm.Load(@"Commands\commandmap.Simple.xml");

            Assert.Equal("FriendlyNameWithWhitespaces", cm.GetFriendlyName("CommandWithNonstandardFriendly"));
        }
        public void DefinedFriendlyNamesAreAvailable()
        {
            StandardCommandMap cm = new StandardCommandMap();

            cm.Load(@"Commands\commandmap.Simple.xml");

            Assert.Equal("FriendlyIncludedCommand", cm.GetFriendlyName("IncludedCommand"));
            Assert.Equal("FriendlyCommandWithMissingInclude", cm.GetFriendlyName("CommandWithMissingInclude"));
        }
        public void AllIncludedCommandsExist()
        {
            StandardCommandMap cm = new StandardCommandMap();

            cm.Load(@"Commands\commandmap.Simple.xml");

            Assert.True(cm.CommandExists("IncludedCommand"));
            Assert.True(cm.CommandExists("CommandWithMissingFriendly"));
            Assert.True(cm.CommandExists("CommandWithMissingInclude"));
            Assert.True(cm.CommandExists("CommandWithNonstandardFriendly"));
        }
        public void SkipsCommandIfMissingSourceName()
        {
            StandardCommandMap cm = new StandardCommandMap();

            cm.Load(@"Commands\commandmap.Broken.xml");
        }
        public void LoadCommandMapSuccessfullyIfContentsAreCompliant()
        {
            StandardCommandMap cm = new StandardCommandMap();

            cm.Load(@"Commands\commandmap.Simple.xml");
        }