Esempio n. 1
0
        public void MoveToPosition_ShouldRiseMoveToPositionCompleteCorrect(IntVector2 attackPosition, IntVector2 returnedFreePoint, bool expectedCall)
        {
            // Aggange
            bool moveToPositionCompleteCalled = false;

            _wayHostileController.MoveToPositionComplete += () => moveToPositionCompleteCalled = true;
            Mock.Arrange(() => _wayHostileControllerParameters.AttackPosition).Returns(attackPosition);
            Mock.Arrange(() => _freePointToGoResolver.GetFreePoint(Arg.IsAny <IntVector2>())).Returns(returnedFreePoint);

            Mock.Arrange(() => _baseActionController.MoveToPosition(Arg.IsAny <IntVector2>())).DoNothing();

            // Act
            _wayHostileController.MoveToPosition(attackPosition);
            Mock.Raise(() => _baseActionController.MovePathComplete += null);

            // Assert
            Assert.True(expectedCall == moveToPositionCompleteCalled);
        }
Esempio n. 2
0
 private void MoveToPosition(IntVector2 position)
 {
     _wayHostileController.MoveToPositionComplete += WayHostileControllerOnMoveToPositionComplete;
     _wayHostileController.MoveToPosition(position);
 }