Пример #1
0
        public async void LessonXStudents_Not_Exists()
        {
            var mock = new ServiceMockFacade <ILessonRepository>();

            mock.RepositoryMock.Setup(x => x.LessonXStudents(default(int), It.IsAny <int>(), It.IsAny <int>())).Returns(Task.FromResult <List <LessonXStudent> >(new List <LessonXStudent>()));
            var service = new LessonService(mock.LoggerMock.Object,
                                            mock.RepositoryMock.Object,
                                            mock.ModelValidatorMockFactory.LessonModelValidatorMock.Object,
                                            mock.BOLMapperMockFactory.BOLLessonMapperMock,
                                            mock.DALMapperMockFactory.DALLessonMapperMock,
                                            mock.BOLMapperMockFactory.BOLLessonXStudentMapperMock,
                                            mock.DALMapperMockFactory.DALLessonXStudentMapperMock,
                                            mock.BOLMapperMockFactory.BOLLessonXTeacherMapperMock,
                                            mock.DALMapperMockFactory.DALLessonXTeacherMapperMock);

            List <ApiLessonXStudentResponseModel> response = await service.LessonXStudents(default(int));

            response.Should().BeEmpty();
            mock.RepositoryMock.Verify(x => x.LessonXStudents(default(int), It.IsAny <int>(), It.IsAny <int>()));
        }