public void SendLocalPositionChange_ShouldSendEvent(bool hasSocketInstance)
        {
            // Given
            var fakePlayer          = new GameObject();
            var fakeDistanceChange  = 0.41F;
            var fakeDirectionChange = -0.22F;

            if (hasSocketInstance)
            {
                controller.SetSocket(socketMock.Object);
            }

            // When
            controller.SendLocalPosition(fakePlayer);

            // Then
            var times = hasSocketInstance ? Times.Once() : Times.Never();

            gameEventBuilderMock.Verify(x => x.BuildPlayerLocalMove(fakePlayer), times);
            socketMock.Verify(x => x.Emit(fakeEvent.Name, fakeEvent.Payload), times);
        }
Exemplo n.º 2
0
 private void Awake()
 {
     controller.SetSocket(GetComponent <ISocketIOComponent>());
 }