Ejemplo n.º 1
0
        public void _0_ifStateChangeEventCalled()
        {
            // arrange
            var test      = new GroundDetectionControl();
            var eventCall = 0;

            test.OnStateChanges += (b) => { eventCall++; };
            // act
            test.OnGround = true;
            // assert
            Assert.IsTrue(eventCall == 1);
        }
Ejemplo n.º 2
0
 private void ArrangeTestEnvironment(short airJump, float jumpForce, bool onGround)
 {
     _testModel = new JumpModel()
     {
         AirJumpLimit = airJump, JumpForce = jumpForce
     };
     _testObj         = new JumpControl(_testModel.Value);
     _testGroundCheck = new GroundDetectionControl {
         OnGround = onGround
     };
     _testObj.GroundDetection = _testGroundCheck;
 }
Ejemplo n.º 3
0
 public void TearDown()
 {
     _testModel       = null;
     _testObj         = null;
     _testGroundCheck = null;
 }