public void EnUSOverrideIsAppliedInTheGameState() { using var watcher = new GameStateWatcher(_gameRootFolder, _gameOptionsFolder, _journalFolder); Assert.False(watcher.ForceEnUSKeyboardLayout); Assert.False(watcher.GetPrivateField <GameState>("_gameState").ForceEnUSKeyboardLayout); Assert.False(watcher.GetGameStateSnapshot().ForceEnUSKeyboardLayout); watcher.ForceEnUSKeyboardLayout = true; Assert.True(watcher.ForceEnUSKeyboardLayout); Assert.True(watcher.GetPrivateField <GameState>("_gameState").ForceEnUSKeyboardLayout); Assert.True(watcher.GetGameStateSnapshot().ForceEnUSKeyboardLayout); }
public void StartAndStopAreNotReentrant() { using var watcher = new GameStateWatcher(_gameRootFolder, _gameOptionsFolder, _journalFolder); bool IsRunning() => watcher.GetPrivateField <bool>("_running"); Assert.False(IsRunning()); watcher.Start(); Assert.True(IsRunning()); watcher.Start(); Assert.True(IsRunning()); watcher.Stop(); Assert.False(IsRunning()); watcher.Stop(); Assert.False(IsRunning()); }