public void testNoMovement() { TestableInput scene = kernel.Get <TestableInput>(); Mock <IRigidBody> mockBody = Mock.Get(scene.sphere.body); step(); mockBody.Verify(mock => mock.AddForce(It.IsAny <Vector3>()), Times.Never()); }
public void testMovementToRight() { TestableInput scene = kernel.Get <TestableInput>(); mockInput.Setup(mock => mock.GetAxis("Horizontal")).Returns(1); Mock <IRigidBody> mockBody = Mock.Get(scene.sphere.body); step(); mockBody.Verify(mock => mock.AddForce(It.Is <Vector3>(v => v.x > 0)), Times.Exactly(1)); }