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());
        }
Ejemplo n.º 3
0
 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());
     }
 }
Ejemplo n.º 4
0
        /// ------------------------------------------------------------------------------------
        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);
        }
Ejemplo n.º 5
0
        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);
 }