public void AssemblyCleanUp() { if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) { ProcessProvider.CloseProcess(_testApiProcess); } }
public static void StopWinAppDriver() { if (_shouldStartLocalService) { if (ProcessProvider.IsProcessWithNameRunning("WinAppDriver")) { ProcessProvider.CloseProcess(_winAppDriverProcess); } } }
public void ClosesExistingProcess() { // Arrange var process = new Process(); var startInfo = new ProcessStartInfo { WindowStyle = ProcessWindowStyle.Hidden, FileName = "cmd.exe", }; process.StartInfo = startInfo; process.Start(); var processProvider = new ProcessProvider(); // Act processProvider.CloseProcess(process); // Assert // ReSharper disable once UnusedVariable Assert.Throws <InvalidOperationException>(() => { var processName = process.ProcessName; }); }
public static void AssemblyCleanUp() { ProcessProvider.CloseProcess(_testApiProcess); }
public static void PreAfterTestRun() { ProcessProvider.CloseProcess(_testApiProcess); }