public void IsGameRunningMethodWithoutFullScanWontCheckForNewProcesses()
        {
            var nmMock = new NativeMethodsProcessMock
            {
                Processes =
                {
                    [0]    = "System",
                    [1000] = "Process 1000",
                    [2000] = _mainExePath,
                },
            };

            var gpt = new GameProcessTracker(_mainExePath, nmMock);

            Assert.False(gpt.IsGameRunning(false));

            gpt.IsGameProcess(2000);
            Assert.True(gpt.IsGameRunning(false));

            nmMock.Processes.Remove(2000);
            Assert.False(gpt.IsGameRunning(false));

            nmMock.Processes.Remove(1000);
            nmMock.Processes.Add(2000, _mainExePath);
            Assert.False(gpt.IsGameRunning(false));
        }
        public void TryGetProcessFileNameMethodHandlesPInvokeFailures()
        {
            var nmMock = new NativeMethodsProcessMock
            {
                Processes =
                {
                    [0]    = "System",
                    [1000] = "Process 1000",
                    [2000] = _mainExePath,
                },
            };

            var gpt = new GameProcessTracker(_mainExePath, nmMock);

            Assert.True(gpt.IsGameProcess(2000));

            nmMock.OpenProcessFailure = true;
            Assert.False(gpt.IsGameRunning(false));
            Assert.False(gpt.IsGameProcess(2000));
            nmMock.OpenProcessFailure = false;

            Assert.True(gpt.IsGameProcess(2000));

            nmMock.EnumProcessModulesFailure = true;
            Assert.False(gpt.IsGameRunning(false));
            Assert.False(gpt.IsGameProcess(2000));
            nmMock.EnumProcessModulesFailure = false;

            Assert.True(gpt.IsGameProcess(2000));

            nmMock.GetModuleFileNameExFailure = true;
            Assert.False(gpt.IsGameRunning(false));
            Assert.False(gpt.IsGameProcess(2000));
            nmMock.GetModuleFileNameExFailure = false;

            Assert.True(gpt.IsGameProcess(2000));
        }