public void GetSessionsFromListHavingFieldValue_FromSpecifiedList_ReturnsThem() { var inList = _sessionRepo.AllItems.Where(x => x.Id != "01"); var outList = SessionWorkflowInformant.GetSessionsFromListHavingFieldValue(inList, SessionFileType.kGenreFieldName, "formulaic_discourse"); Assert.AreEqual(1, outList.Count()); }
public void GetCategorizedSessionsFromListByField_FromSpecifiedList_ReturnsTwoLists() { var inList = _sessionRepo.AllItems.Where(x => x.Id != "04"); var lists = SessionWorkflowInformant.GetCategorizedSessionsFromListByField(inList, SessionFileType.kGenreFieldName); Assert.AreEqual(2, lists.Count); Assert.AreEqual(2, lists["SessionsView.MetadataEditor.Genre.formulaic_discourse"].Count()); Assert.AreEqual(2, lists["SessionsView.MetadataEditor.Genre.singing"].Count()); }
public void GetCategorizedSessionsFromListByField_FromSpecifiedList_ReturnsTwoLists() { using (new ApplicationContainer()) { var inList = _sessionRepo.AllItems.Where(x => x.Id != "04"); var lists = SessionWorkflowInformant.GetCategorizedSessionsFromListByField(inList, SessionFileType.kGenreFieldName); Assert.AreEqual(2, lists.Count); Assert.AreEqual(2, lists["Formulaic Discourse"].Count()); Assert.AreEqual(2, lists["Singing"].Count()); } }
/// ------------------------------------------------------------------------------------ public StatisticsViewModel(Project project, PersonInformant personInformant, SessionWorkflowInformant sessionInformant, IEnumerable <ComponentRole> componentRoles, AudioVideoDataGatherer backgroundStatisticsMananager) { ProjectName = (project == null ? string.Empty : project.Name); ProjectPath = (project == null ? string.Empty : project.FolderPath); PersonInformant = personInformant; SessionInformant = sessionInformant; _componentRoles = componentRoles; _backgroundStatisticsGather = backgroundStatisticsMananager; _backgroundStatisticsGather.NewDataAvailable += HandleNewStatistics; _backgroundStatisticsGather.FinishedProcessingAllFiles += HandleFinishedGatheringStatisticsForAllFiles; _chartBuilder = new HTMLChartBuilder(this); }
private StatisticsViewModel CreateModel() { var nullRole = new ComponentRole(typeof(Session), "someRole", "someRole", ComponentRole.MeasurementTypes.None, p => p.EndsWith("txt"), "$ElementId$_someRole", Color.Magenta, Color.Black); var personInformer = new PersonInformant( new ElementRepository <Person>(_folder.Combine("people"), Person.kFolderName, null, null), null); var sessionInformer = new SessionWorkflowInformant( new ElementRepository <Session>(_folder.Combine("sessions"), Session.kFolderName, null, null), new[] { nullRole }); return(new StatisticsViewModel(null, personInformer, sessionInformer, new[] { nullRole }, new AudioVideoDataGatherer(_folder.Path, new[] { new AudioFileType(null, () => null, null) }))); }
public void TestSetup() { s_componentRoles = ApplicationContainer.ComponentRoles; _sessionRepo = GetMockedSessionRepo(); _informant = new SessionWorkflowInformant(_sessionRepo, s_componentRoles); }