示例#1
0
        public void CanExitGame()
        {
            MessageBoxScreen mbs = new MessageBoxScreen("Exit Frenetic?", false, null, null, new Viewport(), null, null);
            stubScreenFactory.Stub(x => x.MakeMessageBoxScreen(Arg<string>.Is.Anything)).Return(mbs);

            mainMenuScreen.OnCancel();

            stubScreenFactory.AssertWasCalled(x => x.MakeMessageBoxScreen(Arg<string>.Is.Equal("Exit Frenetic?")));
            // TODO: How can i check that MainMenuScreen correctly registers event handlers?
        }
示例#2
0
 public MessageBoxScreen MakeMessageBoxScreen(string message)
 {
     SpriteFont smallFont = _screenManager.Content.Load<SpriteFont>("Fonts/MessageBox");
     Texture2D blankTexture = _screenManager.Content.Load<Texture2D>("Textures/blank");
     MessageBoxScreen messageBoxScreen = new MessageBoxScreen(message, false, smallFont, _screenManager.Font,
                                                 _screenManager.GraphicsDevice.Viewport, _screenManager.SpriteBatch,
                                                 blankTexture);
     _screenManager.AddScreen(messageBoxScreen);
     return messageBoxScreen;
 }