public void ItShouldAddThePassedInCommandAsAnAction(ICommandChannel commandChannel, Command command, State sut) { // Arrange // Act sut.AddAction(command); sut.ExecuteActions(commandChannel); // Assert A.CallTo(() => commandChannel.Send(command.Code)).MustHaveHappened(Repeated.Exactly.Once); }
public void ExecuteActions(ICommandChannel commandChannel) { if (commandChannel == null) throw new ArgumentNullException("commandChannel"); foreach (var action in _actions) { commandChannel.Send(action.Code); } }