Exemple #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);
        }
Exemple #2
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);
        }
Exemple #3
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);
        }
Exemple #4
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);
        }
Exemple #5
0
        public IBotManager BotBuilder(Deltin.CustomGameAutomation.AI ai, ISlotManager slots, BotsModifiedFlag modifiedFlag)
        {
            BotRequests   requests  = new BotRequests();
            IBotRequester requester = new BotRequester(requests);

            IBotExpectations      expectations      = new BotExpectations(requests, slots);
            IBotDeltinManipulator deltinManipulator = new BotDeltinManipulator(ai);

            IBotManipulation manipulation = new BotManipulation(slots, deltinManipulator, modifiedFlag);

            IBotCorruption corruption = new BotCorruption(slots.Bots, expectations);
            IBotRequestFulfillmentManager botRequestFulfillmentManager = new BotRequestFulfillmentManager(expectations, manipulation, corruption);

            IBotManager bots = new BotManager(requester, botRequestFulfillmentManager);

            return(bots);
        }
Exemple #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);
        }
Exemple #7
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);
        }