Ejemplo n.º 1
0
        public async void All()
        {
            var mock    = new ServiceMockFacade <ILessonRepository>();
            var records = new List <Lesson>();

            records.Add(new Lesson());
            mock.RepositoryMock.Setup(x => x.All(It.IsAny <int>(), It.IsAny <int>())).Returns(Task.FromResult(records));
            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 <ApiLessonResponseModel> response = await service.All();

            response.Should().HaveCount(1);
            mock.RepositoryMock.Verify(x => x.All(It.IsAny <int>(), It.IsAny <int>()));
        }