public void ExtendedGamePadStateCanBeConstructedFromGamePadState(Buttons button)
        {
            var state = new GamePadState(
                new Vector2(0.12f, 0.34f),
                new Vector2(0.56f, 0.78f),
                0.1234f, 0.5678f,
                button
                );
            var extendedState = new ExtendedGamePadState(ref state);

            Assert.AreEqual(0.12f, extendedState.GetAxis(ExtendedAxes.X));
            Assert.AreEqual(0.34f, extendedState.GetAxis(ExtendedAxes.Y));
            Assert.AreEqual(0.56f, extendedState.GetAxis(ExtendedAxes.RotationX));
            Assert.AreEqual(0.78f, extendedState.GetAxis(ExtendedAxes.RotationY));
            Assert.AreEqual(0.1234f, extendedState.GetSlider(ExtendedSliders.Slider1));
            Assert.AreEqual(0.5678f, extendedState.GetSlider(ExtendedSliders.Slider2));

            switch (button)
            {
            case Buttons.DPadUp: {
                Assert.AreEqual(0, extendedState.GetPov(0));
                break;
            }

            case Buttons.DPadRight: {
                Assert.AreEqual(9000, extendedState.GetPov(0));
                break;
            }

            case Buttons.DPadDown: {
                Assert.AreEqual(18000, extendedState.GetPov(0));
                break;
            }

            case Buttons.DPadLeft: {
                Assert.AreEqual(27000, extendedState.GetPov(0));
                break;
            }

            default: {
                Assert.IsTrue(
                    extendedState.IsButtonDown(
                        Array.IndexOf(ExtendedGamePadState.ButtonOrder, button)
                        )
                    );
                break;
            }
            }
        }
        public void InvalidPovIndexCausesException(int povIndex)
        {
            var state = new ExtendedGamePadState();

            Assert.Throws <ArgumentOutOfRangeException>(
                delegate() { state.GetPov(povIndex); }
                );
        }
        public void ConstructorTakesOverPovControllerStates()
        {
            var axes    = new float[24];
            var sliders = new float[8];
            var buttons = new bool[128];
            var povs    = new int[4];

            for (int povIndex = 0; povIndex < 4; ++povIndex)
            {
                Array.Clear(povs, 0, 4);
                povs[povIndex] = 12345;

                var state = new ExtendedGamePadState(
                    0, axes,
                    0, sliders,
                    0, buttons,
                    povIndex + 1, povs
                    );

                // The specified number of PoV controllers should be available
                Assert.AreEqual(state.PovCount, povIndex + 1);

                // Ensure only the provided pov has the value assigned
                for (int povIndex2 = 0; povIndex2 < 4; ++povIndex2)
                {
                    if (povIndex2 == povIndex)
                    {
                        Assert.AreEqual(12345, state.GetPov(povIndex2));
                    }
                    else
                    {
                        Assert.AreEqual(0, state.GetPov(povIndex2));
                    }
                } // for
            }     // for
        }