Пример #1
0
        public void GetAllCompleted_ReturnExpectedResult(
            IReadOnlyList <CompletedEnglishMultimedia> allMultimedia,
            IReadOnlyList <CompletedEnglishTask> allTasks,
            IReadOnlyList <GroupedCompletedStatistic> expectedModels)
        {
            // Arrange
            var generalStatistic = new GeneralStatistic(allMultimedia, allTasks);

            // Act
            IReadOnlyList <GroupedCompletedStatistic> groupedModels = generalStatistic.GetAllCompleted();

            // Arrange
            groupedModels.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 });
        }