Ejemplo n.º 1
0
        public void GoalAndEndShouldHaveCorrectTiles()
        {
            SetUpSuccessfulSequence();
            var adder = new GoalAndStartAdder();

            adder.ImproveMap(mapMock.Object, randomMock.Object);
            mapMock.Verify(foo => foo.SetTile(It.IsAny <Vector2Int>(), It.IsAny <GoalTile>()));
            mapMock.Verify(foo => foo.SetTile(It.IsAny <Vector2Int>(), It.IsAny <StartTile>()));
        }
Ejemplo n.º 2
0
        public void GoalAndEndShouldBeSet()
        {
            SetUpSuccessfulSequence();
            var adder = new GoalAndStartAdder();

            adder.ImproveMap(mapMock.Object, randomMock.Object);
            mapMock.VerifySet(foo => foo.Goal  = It.IsAny <Vector2Int>());
            mapMock.VerifySet(foo => foo.Start = It.IsAny <Vector2Int>());
        }
Ejemplo n.º 3
0
        public void GoalAndEndShouldNotBeInSameLocation()
        {
            SetUpSuccessfulSequence();
            var startLocation = new Vector2Int(int.MaxValue, int.MaxValue);
            var goalLocation  = new Vector2Int(int.MaxValue, int.MaxValue);

            mapMock.SetupSet(h => h.Start = It.IsAny <Vector2Int>()).Callback <Vector2Int>(r => startLocation = r);
            mapMock.SetupSet(h => h.Goal  = It.IsAny <Vector2Int>()).Callback <Vector2Int>(r => goalLocation = r);
            var adder = new GoalAndStartAdder();

            adder.ImproveMap(mapMock.Object, randomMock.Object);

            Assert.AreNotEqual(startLocation, goalLocation);
        }