Exemple #1
0
        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);
        }
Exemple #2
0
        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);
        }