public void NoCommandUsageErrorTest() { var commandTestClass = new CommandTestClass(); var dictionary = new Dictionary <string, string>(); var argumentMapper = new ArgumentMapper <CommandTestClass>(); argumentMapper.Invoking(x => x.Map(commandTestClass, dictionary)).ShouldThrow <CommandLineArgumentException>().WithMessage( "The command 'Backup|Init|Restore' must be used."); }
public void SingleCommandUsageTest() { var commandTestClass = new CommandTestClass(); var dictionary = new Dictionary <string, string> { { "Backup", "true" } }; var argumentMapper = new ArgumentMapper <CommandTestClass>(); var result = argumentMapper.Map(commandTestClass, dictionary); Assert.AreEqual(result.TheCommand, TestCommandType.Backup); }
public void MultipleSameCommandUsageErrorTest() { var commandTestClass = new CommandTestClass(); var dictionary = new Dictionary <string, string> { { "Backup", "true" }, { "B", "true" } }; var argumentMapper = new ArgumentMapper <CommandTestClass>(); argumentMapper.Invoking(x => x.Map(commandTestClass, dictionary)).ShouldThrow <CommandLineArgumentException>().WithMessage( "Multiple aruments for 'Backup'-command is not allowed."); }