public IsCommandCreated ( string commandName ) : bool | ||
commandName | string | Name of the command. |
return | bool |
public void ReturnsTrueForCreatedCommand() { var commandManager = new CommandManager(); commandManager.CreateCommand("MyCommand"); Assert.IsTrue(commandManager.IsCommandCreated("MyCommand")); }
public void CorrectlyCreatesTheCommand() { var commandManager = new CommandManager(); commandManager.CreateCommand("MyCommand"); Assert.IsTrue(commandManager.IsCommandCreated("MyCommand")); }
public void ReturnsFalseForNotCreatedCommand() { var commandManager = new CommandManager(); Assert.IsFalse(commandManager.IsCommandCreated("MyCommand")); }
public void ThrowsArgumentNullExceptionForWhitespaceCommandName() { var commandManager = new CommandManager(); ExceptionTester.CallMethodAndExpectException<ArgumentException>(() => commandManager.IsCommandCreated(" ")); }
public void DoesNotExecuteUnregisteredCommands() { var vm = new CompositeCommandViewModel(); var commandManager = new CommandManager(); commandManager.CreateCommand("MyCommand"); commandManager.RegisterCommand("MyCommand", vm.TestCommand1); Assert.IsTrue(commandManager.IsCommandCreated("MyCommand")); commandManager.UnregisterCommand("MyCommand", vm.TestCommand1); commandManager.ExecuteCommand("MyCommand"); Assert.IsFalse(vm.IsTestCommand1Executed); }