public void TestConstructor() {
      requireAttachedJoystick();

      using (var gamePad = new DirectInputGamePad(this.joystick, isAttachedMock)) {
        this.joystick = null; // ownership transfer
      }
    }
예제 #2
0
        public void TestConstructor()
        {
            requireAttachedJoystick();

            using (var gamePad = new DirectInputGamePad(this.joystick, isAttachedMock)) {
                this.joystick = null; // ownership transfer
            }
        }
    public void TestName() {
      requireAttachedJoystick();
      
      string expected = this.joystick.Information.InstanceName;

      using (var gamePad = new DirectInputGamePad(this.joystick, isAttachedMock)) {
        this.joystick = null; // ownership transfer

        StringAssert.Contains(expected, gamePad.Name);
      }
    }
예제 #4
0
        public void TestName()
        {
            requireAttachedJoystick();

            string expected = this.joystick.Information.InstanceName;

            using (var gamePad = new DirectInputGamePad(this.joystick, isAttachedMock)) {
                this.joystick = null; // ownership transfer

                StringAssert.Contains(expected, gamePad.Name);
            }
        }
예제 #5
0
        public void TestAttached(bool expected)
        {
            requireAttachedJoystick();

            CheckAttachedDelegate attachedCheck;

            if (expected)
            {
                attachedCheck = isAttachedMock;
            }
            else
            {
                attachedCheck = isNotAttachedMock;
            }

            using (var gamePad = new DirectInputGamePad(this.joystick, attachedCheck)) {
                this.joystick = null; // ownership transfer

                Assert.AreEqual(expected, gamePad.IsAttached);
            }
        }
    public void TestAttached(bool expected) {
      requireAttachedJoystick();
      
      CheckAttachedDelegate attachedCheck;
      if(expected) {
        attachedCheck = isAttachedMock;
      } else {
        attachedCheck = isNotAttachedMock;
      }

      using (var gamePad = new DirectInputGamePad(this.joystick, attachedCheck)) {
        this.joystick = null; // ownership transfer

        Assert.AreEqual(expected, gamePad.IsAttached);
      }
    }