public void Pop_TwoCommandsWithIdleUpdate_AllCommandsExtracted() { // ARRANGE var command1 = new Mock <ICommand>().Object; var command2 = new Mock <ICommand>().Object; var commandManager = new QueueCommandManager(); // ACT commandManager.Push(command1); var factCommand1 = commandManager.Pop(); // Холостой Update. var idleCommand = commandManager.Pop(); // Вторая команда должна быть извлечена. commandManager.Push(command2); var factCommand2 = commandManager.Pop(); // ASSERT factCommand1.Should().Be(command1); idleCommand.Should().BeNull(); factCommand2.Should().Be(command2); }
private static void AssertPopCommands(ICommand[] commands, QueueCommandManager commandManager) { foreach (var expectedCommand in commands) { var factCommand = commandManager.Pop(); // ASSERT factCommand.Should().Be(expectedCommand); } }