Ejemplo n.º 1
0
        public async void EventTeachersByTeacherId_Not_Exists()
        {
            var mock = new ServiceMockFacade <ITeacherService, ITeacherRepository>();

            mock.RepositoryMock.Setup(x => x.EventTeachersByTeacherId(default(int), It.IsAny <int>(), It.IsAny <int>())).Returns(Task.FromResult <List <EventTeacher> >(new List <EventTeacher>()));
            var service = new TeacherService(mock.LoggerMock.Object,
                                             mock.MediatorMock.Object,
                                             mock.RepositoryMock.Object,
                                             mock.ModelValidatorMockFactory.TeacherModelValidatorMock.Object,
                                             mock.DALMapperMockFactory.DALTeacherMapperMock,
                                             mock.DALMapperMockFactory.DALEventTeacherMapperMock,
                                             mock.DALMapperMockFactory.DALRateMapperMock,
                                             mock.DALMapperMockFactory.DALTeacherTeacherSkillMapperMock);

            List <ApiEventTeacherServerResponseModel> response = await service.EventTeachersByTeacherId(default(int));

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