public void TestPlayerSlots() { FakeSlotContentObserver observer = new FakeSlotContentObserver(); SlotContentHistory history = new SlotContentHistory(observer); PlayerSlots sut = new PlayerSlots(history); List <SlotContent> blueSlots = new List <SlotContent>() { SlotContent.Empty, SlotContent.Empty, SlotContent.Bot, SlotContent.Player, SlotContent.Empty, SlotContent.Empty }; List <SlotContent> redSlots = new List <SlotContent>() { SlotContent.Bot, SlotContent.Bot, SlotContent.Bot, SlotContent.Player, SlotContent.Player, SlotContent.Empty }; observer.SetObserve(blueSlots, redSlots); history.Update(); List <int> blueResult = sut.Slots(Team.Blue); List <int> redResult = sut.Slots(Team.Red); List <int> blueExpectation = new List <int>() { 3 }; List <int> redExpectation = new List <int>() { 9, 10 }; Assert.IsTrue(blueResult.SequenceEqual(blueExpectation)); Assert.IsTrue(redResult.SequenceEqual((redExpectation))); }
public void TestWhenRedHasMoreBotsThenRedHasFewerBotsIsFalse() { FakeSlotContentObserver observer = new FakeSlotContentObserver(); SlotContentHistory history = new SlotContentHistory(observer); BotSlots sut = new BotSlots(history); List <SlotContent> blueSlots = new List <SlotContent>() { SlotContent.Empty, SlotContent.Empty, SlotContent.Bot, SlotContent.Player, SlotContent.Empty, SlotContent.Empty }; List <SlotContent> redSlots = new List <SlotContent>() { SlotContent.Bot, SlotContent.Bot, SlotContent.Bot, SlotContent.Player, SlotContent.Player, SlotContent.Empty }; observer.SetObserve(blueSlots, redSlots); history.Update(); Assert.IsFalse(sut.TeamHasFewer(Team.Red)); }
public void TestWhenPlayerCountSameThenTeamsHaveEqualCountIsTrue() { FakeSlotContentObserver observer = new FakeSlotContentObserver(); SlotContentHistory history = new SlotContentHistory(observer); PlayerSlots sut = new PlayerSlots(history); List <SlotContent> blueSlots = new List <SlotContent>() { SlotContent.Empty, SlotContent.Empty, SlotContent.Bot, SlotContent.Player, SlotContent.Empty, SlotContent.Empty }; List <SlotContent> redSlots = new List <SlotContent>() { SlotContent.Bot, SlotContent.Bot, SlotContent.Bot, SlotContent.Player, SlotContent.Bot, SlotContent.Empty }; observer.SetObserve(blueSlots, redSlots); history.Update(); Assert.IsTrue(sut.TeamsHaveEqualCount); }