public void ColonizeWhilePossible_QueueCountIsGreaterThanZero() { int planetsToColonize = 10; List <IHabitablePlanet> planetList = new List <IHabitablePlanet>(); for (int i = 0; i < planetsToColonize; i++) { var mock = new Mock <IHabitablePlanet>(); mock.Setup(x => x.Colonize(It.IsNotNull <Colonizer>())) .Returns(ColonizationState.Colonized); planetList.Add(mock.Object); } ColoniztionQueue coloniztionQueue = new ColoniztionQueue(planetList); var shipsMock = new Mock <IShipsFactory>(); shipsMock.Setup(x => x.GetColonizer()) .Returns(Colonizer.GetColonizer()); var resourcesMock = new Mock <IMutableResources>(); coloniztionQueue.ColonizeWhilePossible(shipsMock.Object); Assert.AreEqual(0, coloniztionQueue.PlanetsInQueue); }
public void ColonizeWhilePossible_QueueCountIsZero_ImmediateReturn() { ColoniztionQueue coloniztionQueue = new ColoniztionQueue(); Assert.DoesNotThrow(() => { coloniztionQueue.ColonizeWhilePossible(new Mock <IShipsFactory>().Object); }); }