public void TestConstructor() { requireAttachedJoystick(); using (var gamePad = new DirectInputGamePad(this.joystick, isAttachedMock)) { this.joystick = null; // ownership transfer } }
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); } }
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); } }
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); } }