SnakeGameTests Init Method Delta Engine Documentation

Namespace: Snake.Tests
Assembly: Snake.Tests (in Snake.Tests.dll) Version: 1.1.1.0 (1.1.1)
Syntax

public void Init()
Examples

[Test, CloseAfterFirstFrame]
public void RestartGameInitializesAnew()
{
    var game = new Game(Resolve<Window>());
    game.StartGame();
    AdvanceTimeAndUpdateEntities();
    game.Reset();
    var keyboard = Resolve<Keyboard>();
    if (keyboard.GetType() != typeof(MockKeyboard))
        return; //ncrunch: no coverage (This is for NOT ncrunch...) 
    var mockKeyboard = (MockKeyboard)keyboard;
    mockKeyboard.SetKeyboardState(Key.Y, State.Pressing);
    Assert.DoesNotThrow(() => AdvanceTimeAndUpdateEntities());
}
See Also