public async Task NoMessageWhenNonPromptedPlayerWithdraws()
        {
            this.CreateHandler(
                out MessageHandler handler,
                out GameState state,
                out IGuildUser firstPlayerUser,
                out _,
                out IGuildTextChannel channel,
                out MessageStore messageStore);
            IGuildUser secondPlayerUser = CommandMocks.CreateGuildUser(DefaultSecondPlayerId);

            await handler.HandlePlayerMessage(state, firstPlayerUser, channel, "buzz");

            await handler.HandlePlayerMessage(state, secondPlayerUser, channel, "buzz");

            messageStore.VerifyChannelMessages(firstPlayerUser.Mention);
            messageStore.Clear();

            await handler.HandlePlayerMessage(state, secondPlayerUser, channel, "wd");

            messageStore.VerifyChannelMessages();

            Assert.IsTrue(state.TryGetNextPlayer(out ulong nextPlayerId), "Couldn't get another player");
            Assert.AreEqual(DefaultPlayerId, nextPlayerId, "Unexpected user prompted");

            state.ScorePlayer(0);
            Assert.IsFalse(state.TryGetNextPlayer(out _), "Second player should've been withdrawn");
        }
        private void CreateHandler(
            out MessageHandler handler,
            out GameState state,
            out IGuildUser playerUser,
            out IGuildUser readerUser,
            out IGuildTextChannel channel,
            out MessageStore messageStore)
        {
            messageStore = new MessageStore();
            IDatabaseActionFactory dbActionFactory = CommandMocks.CreateDatabaseActionFactory(
                this.botConfigurationfactory);
            IOptionsMonitor <BotConfiguration> options = CommandMocks.CreateConfigurationOptionsMonitor();

            handler = new MessageHandler(
                options, dbActionFactory, CommandMocks.CreateHubContext(), new Mock <ILogger>().Object);

            playerUser = CommandMocks.CreateGuildUser(DefaultPlayerId);
            readerUser = CommandMocks.CreateGuildUser(DefaultReaderId);
            CommandMocks.CreateGuild(
                messageStore,
                DefaultIds,
                DefaultGuildId,
                DefaultChannelId,
                (mockGuild, textChannel) =>
            {
                Mock <IVoiceChannel> mockVoiceChannel = new Mock <IVoiceChannel>();
                mockVoiceChannel.Setup(voiceChannel => voiceChannel.Id).Returns(DefaultVoiceChannelId);
                mockVoiceChannel.Setup(voiceChannel => voiceChannel.Name).Returns("Voice");
                mockGuild
                .Setup(guild => guild.GetVoiceChannelAsync(It.IsAny <ulong>(), It.IsAny <CacheMode>(), It.IsAny <RequestOptions>()))
                .Returns(Task.FromResult(mockVoiceChannel.Object));

                List <IVoiceChannel> voiceChannels = new List <IVoiceChannel>()
                {
                    mockVoiceChannel.Object
                };
                mockGuild
                .Setup(guild => guild.GetVoiceChannelsAsync(It.IsAny <CacheMode>(), It.IsAny <RequestOptions>()))
                .Returns(Task.FromResult <IReadOnlyCollection <IVoiceChannel> >(voiceChannels));
            },
                null,
                out channel);
            state = new GameState()
            {
                ReaderId    = DefaultReaderId,
                TeamManager = new ByCommandTeamManager()
            };
        }