public void DeleteContenderTestWithFind()
        {
            var contenderList = new List <Contender>
            {
                new Contender {
                    Epitaph = "", Killer = "999", Name = "TestC1", Score = 0
                },
                new Contender {
                    Epitaph = "", Killer = "998", Name = "TestC2", Score = 0
                }
            };

            TestDb = DataBaseMock(contenderList);
            TestDb.Setup(m => m.RemoveContender("TestC2", "1234")).Verifiable();

            var knockoutTest     = new KnockOutHandler(1234, TestDb.Object);
            var contenderDeleted = knockoutTest.DeleteContender("TestC2");

            Assert.DoesNotThrow(() => TestDb.Verify());
            Assert.IsTrue(contenderDeleted);
        }
        public void DeleteContenderTestWithNoFind()
        {
            var contenderList = new List <Contender>
            {
                new Contender {
                    Epitaph = "", Killer = "999", Name = "TestC1", Score = 0
                },
                new Contender {
                    Epitaph = "", Killer = "998", Name = "TestC2", Score = 0
                }
            };

            TestDb = DataBaseMock(contenderList);
            TestDb.Setup(m => m.RemoveContender(It.IsAny <string>(), It.IsAny <string>())).Verifiable();

            var knockoutTest     = new KnockOutHandler(1234, TestDb.Object);
            var contenderDeleted = knockoutTest.DeleteContender("TestC3");

            Assert.Throws <MockException>(() => TestDb.Verify());
            Assert.IsFalse(contenderDeleted);
        }
        public async Task RemoveContenderAsync([Remainder] string input = "")
        {
            if (!StateChecker.IsPrivateMessage(Context))
            {
                return;
            }

            if (input == "")
            {
                await Context.Channel.SendMessageAsync(":x: No Value Entered!");

                return;
            }

            var channelId = KnockOutHandler.ChannelForUser(Context.User.Id, Factory.GetDatabase());

            if (channelId == 0)
            {
                await Context.Channel.SendMessageAsync(":x: You are not making a knockout at the moment!");

                return;
            }

            var knockouts = new KnockOutHandler(channelId, Factory.GetDatabase());

            if (knockouts.KnockoutCreatorUlong != Context.User.Id)
            {
                await Context.Channel.SendMessageAsync(":x: You are not making a knockout at the moment!");

                return;
            }

            switch (knockouts.KnockoutStatus)
            {
            case 1:
                await Context.Channel.SendMessageAsync(":x: No Knockout is being created at the moment!");

                return;

            case 2:
                await Context.Channel.SendMessageAsync(":x: This knockout has already started! No more changes!");

                return;

            case 3:
                await Context.Channel.SendMessageAsync(":x: This knockout is finished, please feel free to create a new one!");

                return;

            case 4:
                break;

            default:
                await Context.Channel.SendMessageAsync(":x: Right. This shouldn't have happened. Someone call RedFlint.");

                return;
            }

            if (!knockouts.DeleteContender(input))
            {
                await Context.Channel.SendMessageAsync($":x: No Exact Match Found for **{input}**. Please Try Again");

                return;
            }

            await Context.Channel.SendMessageAsync($"You have removed the contender **{input}**");
        }