public void SaveFilesClearShotsTest() { try { // No shots in capturer at start. Assert.AreEqual(0, _capturer.Shots.Count); _capturer.IsTakingShots = true; _capturer.TakeShot(new ScreenshotArgs(_mouseLeftDown1, _mouseLeftUp1, false)); // Save shot to file, then remove the zip immediately. _capturer.SaveShots(); System.IO.Directory.Delete(ScreenCapturer.Properties.Settings.Default.SaveFolder, true); Assert.AreEqual(0, _capturer.Shots.Count); } catch (System.ComponentModel.Win32Exception) { // Most likely a "The handle is invalid" exception. No UI on test runner. Assert.Ignore("Test runner does not have access to UI."); } }