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 Add_WillAddAssemblyToSession(SessionManager sut) { var paths = _fixture.CreateMany<String>().ToList(); sut.Add(paths); sut.CurrentSession.Received(1).Add(paths); }