public void GetCommand_CallsGetCommandWithCorrectArgument_WhenPassedCommandName(string commandName) { var serviceLocatorMock = new Mock <IServiceLocator>(); var commandFactory = new CommandsFactory(serviceLocatorMock.Object); commandFactory.GetCommand(commandName); serviceLocatorMock.Verify(s => s.GetCommand(commandName), Times.Once); }
public void GetCommand_ReturnsNull_WhenPassedNullArgument() { var serviceLocatorMock = new Mock <IServiceLocator>(); var commandFactory = new CommandsFactory(serviceLocatorMock.Object); var result = commandFactory.GetCommand(null); Assert.AreEqual(null, result); }