public void Run ()
		{
			try {
				testServer = new DotNetCoreTestServer (OnMessageReceived);
				testServer.Open ();

				RunDotNetCoreTest ();
			} catch (Exception ex) {
				TestResult = UnitTestResult.CreateFailure (ex);
				IsCompleted = true;
			}
		}
        public void Start(string projectDirectory)
        {
            try {
                discoveryCompleted = false;
                testFound          = false;

                tests.Clear();
                testServer = new DotNetCoreTestServer(OnMessageReceived);
                testServer.Open();

                StartShutdownTimer();

                RunDotNetCoreTest(projectDirectory);
                IsRunning = true;
            } catch (Exception ex) {
                OnError(ex);
            }
        }
        public void Dispose()
        {
            IsRunning = false;

            try {
                if (shutdownTimer != null)
                {
                    shutdownTimer.Stop();
                    shutdownTimer.Elapsed -= ShutdownTimerElapsed;
                    shutdownTimer.Dispose();
                    shutdownTimer = null;
                }
            } catch (Exception ex) {
                LoggingService.LogError("Test loader dispose error.", ex);
            }

            try {
                if (testServer != null)
                {
                    testServer.Dispose();
                    testServer = null;
                }
            } catch (Exception ex) {
                LoggingService.LogError("Test loader dispose error.", ex);
            }

            try {
                if (dotNetTestOperation != null)
                {
                    if (!dotNetTestOperation.IsCompleted)
                    {
                        dotNetTestOperation.Cancel();
                    }
                    dotNetTestOperation = null;
                }
            } catch (Exception ex) {
                LoggingService.LogError("Test loader dispose error.", ex);
            }
        }