private void Window_Drop(object sender, DragEventArgs e) { imageResult.Source = null; if (e.Data.GetDataPresent("FileDrop")) { var paths = ((IEnumerable<String>) e.Data.GetData("FileDrop")); var assemblies = DropHelper.GetAssembliesFromDropData(paths).ToList(); var basePath = DropHelper.GetBaseDir(paths); if (assemblies.Any()) { var sm = new SessionManager(); faults.ItemsSource = sm.Faults; using (sm.CreateSession(basePath)) { sm.Add(assemblies); var hasFaults = !sm.RunTests(); imageResult.Source = hasFaults ? _nayImage : _yayImage; } } else { _logger.Info("No assemblies found among dropped files."); } } else { _logger.Info("No files found among dropped items."); } log.Items.Refresh(); if (log.HasItems) { var last = log.Items.Count - 1; log.ScrollIntoView(log.Items[last]); } }
public void RunTests_ReturnsTrueWhenNoFaultsFound_OtherwiseFalse( SessionManager sut, Boolean expected, IEnumerable<FaultInfo> faults) { sut.CurrentSession.Inspect().Returns(faults); Assert.AreEqual(expected, sut.RunTests()); }
public void RunTests_InspectIsCalled(SessionManager sut) { sut.RunTests(); sut.CurrentSession.Received(1).Inspect(); }