Beispiel #1
0
        /// <summary>
        ///   Lets the renderer draw the option control and verifies that the option used
        ///   the skin elements from the expected state
        /// </summary>
        /// <param name="expectedState">
        ///   Expected state the skin elements should be using
        /// </param>
        private void drawAndExpectState(string expectedState)
        {
            // Make sure the renderer draws at least a frame and the option's text
            Expect.Once.On(MockedGraphics).Method("DrawElement").With(
                Is.StringContaining(expectedState), Is.Anything
                );
            Expect.Once.On(MockedGraphics).Method("DrawString").With(
                Is.StringContaining(expectedState), Is.Anything, Is.EqualTo("Option")
                );

            // Let the renderer draw the option into the mocked graphics interface
            renderer.Render(this.option, MockedGraphics);

            // And verify the expected drawing commands were issues
            Mockery.VerifyAllExpectationsHaveBeenMet();
        }