public void TestRenderNormal() { // Make sure the renderer draws at least the label's text Expect.Once.On(MockedGraphics).Method("DrawString").With( Is.Anything, Is.Anything, Is.EqualTo("Test") ); // Let the renderer draw the label into the mocked graphics interface renderer.Render(this.label, MockedGraphics); // And verify the expected drawing commands were issues Mockery.VerifyAllExpectationsHaveBeenMet(); }
public void TestRenderNormal() { // Make sure the renderer draws at least a frame and the window's title Expect.Once.On(MockedGraphics).Method("DrawElement").WithAnyArguments(); Expect.Once.On(MockedGraphics).Method("DrawString").With( Is.Anything, Is.Anything, Is.EqualTo("Title") ); // Let the renderer draw the window into the mocked graphics interface renderer.Render(this.window, MockedGraphics); // And verify the expected drawing commands were issues Mockery.VerifyAllExpectationsHaveBeenMet(); }
/// <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(); }