Esempio n. 1
0
        public void GetPerDayForLastMonthStatistic_ReturnExpectedResult(
            IReadOnlyList <CompletedEnglishMultimedia> allMultimedia,
            IReadOnlyList <CompletedEnglishTask> allTasks,
            IReadOnlyList <PerDayStatistic> expectedModels)
        {
            // Arrange
            var generalStatistic = new GeneralStatistic(allMultimedia, allTasks);

            // Act
            IReadOnlyList <PerDayStatistic> perDayStatistics = generalStatistic.GetPerDayForLastMonthStatistic();

            // Arrange
            perDayStatistics.Should().BeEquivalentTo(expectedModels);
        }
        public static IEnumerable <object[]> GetFullStatistic_ReturnExpectedResult_Data()
        {
            var userId = Guid.NewGuid();
            var completedEnglishTask       = CompletedEnglishTaskFactory.GetSimpleModels(_random.Next(15, 25), userId);
            var completedEnglishMultimedia = CompletedEnglishMultimediaFactory.GetSimpleModels(_random.Next(15, 25), userId);

            var englishTaskStatistic       = new EnglishTaskStatistic(completedEnglishTask);
            var englishMultimediaStatistic = new EnglishMultimediaStatistic(completedEnglishMultimedia);
            var generalStatistic           = new GeneralStatistic(completedEnglishMultimedia, completedEnglishTask);

            var expectedFullStatistic = new FullStatistic
            {
                GroupedCompletedStatistic           = generalStatistic.GetAllCompleted(),
                PerDayStatistic                     = generalStatistic.GetPerDayForLastMonthStatistic(),
                PerTasksEnglishLevelsStatistic      = englishTaskStatistic.GetTasksPerEnglishLevelStatistic(),
                TasksCorrectnessStatistic           = englishTaskStatistic.GetTasksCorrectnessStatistic(),
                PerMultimediaEnglishLevelsStatistic = englishMultimediaStatistic.GetMultimediaPerEnglishLevelStatistic(),
                PerTextTypeStatistic                = englishMultimediaStatistic.GetPerTextTypeStatistic(),
                PerVideoTypeStatistic               = englishMultimediaStatistic.GetPerVideoTypeStatistic(),
            };

            yield return(new object[] { userId, englishMultimediaStatistic, englishTaskStatistic, expectedFullStatistic });
        }