public void TestDisconnectGamepad() { bool invoked = false; var stubGamepad = new StubIVirtualGamepad(); stubGamepad.Disconnect = () => { invoked = true; }; this.fakeXboxXdk.CreateGamepadFunc = (i) => { return(stubGamepad); }; this.adapter.ConnectXboxGamepad("ip"); this.adapter.DisconnectXboxGamepad(SystemIpAddress, 0); Assert.IsTrue(invoked); }
public void TestSendGamepadReport() { bool invoked = false; var stubGamepad = new StubIVirtualGamepad(); stubGamepad.SetGamepadStateXboxGamepadState = (state) => { invoked = true; }; this.fakeXboxXdk.CreateGamepadFunc = (i) => { return(stubGamepad); }; this.adapter.ConnectXboxGamepad(SystemIpAddress); this.adapter.SendGamepadReport(SystemIpAddress, 0, new XboxGamepadState()); Assert.IsTrue(invoked); }