public void GetPosition_SendValidRequest()
        {
            //Arrange
            string       commandName       = "position";
            IRestRequest sentRequest       = null;
            var          commandSenderMock = new Mock <ICommandSender>();

            commandSenderMock
            .Setup(x => x.ExecuteRequest <DoubleResponse>(It.IsAny <string>(), It.IsAny <RestRequest>()))
            .Callback((string baseUrl, IRestRequest request) => sentRequest = request)
            .Returns(new DoubleResponse(1.0));
            var rotator = new Rotator(_deviceConfiguration, commandSenderMock.Object);

            //Act
            rotator.GetPosition();

            //Assert
            Assert.Equal(Method.GET, sentRequest.Method);
            AssertCommonParameters(sentRequest.Parameters, _deviceConfiguration, commandName);
        }
예제 #2
0
 void Move(float t, Vector3 from, Vector3 to)
 {
     ghost = Vector3.Lerp(from, to, t);
     mover = rotator.GetPosition(ghost, pathPosition);
 }