Пример #1
0
        public void TestWhenNoTeamSpecifiedThenRequestAddedForDifferentTeams()
        {
            BotRequests  requests   = new BotRequests();
            BotRequester sut        = new BotRequester(requests);
            AiHero       hero       = AiHero.Reaper;
            Difficulty   difficulty = Difficulty.Hard;
            IBotRule     rule       = new BotRuleBothTeams();

            sut.RequestBot(hero, difficulty, rule);

            Assert.AreNotEqual(requests.Requests[0].BotTeam, requests.Requests[1].BotTeam);
        }
Пример #2
0
        public void TestClearBotRequestsLeavesNoBotRequests()
        {
            BotRequests  requests = new BotRequests();
            BotRequester sut      = new BotRequester(requests);


            AiHero     hero       = AiHero.Sombra;
            Difficulty difficulty = Difficulty.Hard;
            IBotRule   rule       = new BotRuleSmallerTeam();

            sut.RequestBot(hero, difficulty, rule);

            AiHero     hero2       = AiHero.Bastion;
            Difficulty difficulty2 = Difficulty.Easy;
            IBotRule   rule2       = new BotRuleLargerTeam();

            sut.RequestBot(hero2, difficulty2, rule2);

            sut.ClearBotRequests();

            Assert.AreEqual(requests.Requests.Count, 0);
        }
Пример #3
0
        public void TestCorrectRuleInRequest()
        {
            BotRequests  requests   = new BotRequests();
            BotRequester sut        = new BotRequester(requests);
            AiHero       hero       = AiHero.Reaper;
            Difficulty   difficulty = Difficulty.Hard;
            IBotRule     rule       = new BotRuleBothTeams();

            sut.RequestBot(hero, difficulty, rule);

            Assert.AreEqual(requests.Requests[0].Rule, rule);
            Assert.AreEqual(requests.Requests[1].Rule, rule);
        }
Пример #4
0
        public void TestWhenNoTeamSpecifiedThenRequestAddedToBothTeams()
        {
            BotRequests  requests   = new BotRequests();
            BotRequester sut        = new BotRequester(requests);
            AiHero       hero       = AiHero.Reaper;
            Difficulty   difficulty = Difficulty.Hard;
            IBotRule     rule       = new BotRuleBothTeams();

            sut.RequestBot(hero, difficulty, rule);


            Assert.AreEqual(requests.Requests.Count, 2);
        }
Пример #5
0
        public void TestRequestHasCorrectTeam()
        {
            BotRequests  requests = new BotRequests();
            BotRequester sut      = new BotRequester(requests);


            AiHero     hero       = AiHero.Sombra;
            Difficulty difficulty = Difficulty.Hard;
            IBotRule   rule       = new BotRuleSmallerTeam();
            Team       team       = Team.Blue;

            sut.RequestBot(team, hero, difficulty, rule);

            Assert.AreEqual(requests.Requests[0].BotTeam, Team.Blue);
        }
Пример #6
0
        public void TestMinAndMaxPlayersForRequest()
        {
            BotRequests  requests = new BotRequests();
            BotRequester sut      = new BotRequester(requests);

            AiHero     hero       = AiHero.Sombra;
            Difficulty difficulty = Difficulty.Hard;
            IBotRule   rule       = new BotRuleSmallerTeam();
            int        minPlayers = 1;
            int        maxPlayers = 4;

            sut.RequestBot(hero, difficulty, rule, minPlayers, maxPlayers);


            Assert.AreEqual(requests.Requests[0].MinPlayersOnTeam, minPlayers);
            Assert.AreEqual(requests.Requests[0].MaxPlayersOnTeam, maxPlayers);
        }