public void TeacherDegree_GetById_Test_Is_Invoke_Repo_GetById()
 {
     //Arrange
     var logger = new Mock<ILogger>();
     var iRepository = new Mock<IRepository<TeacherDegree>>();
     var iUnitOfWork = new Mock<IUnitOfWork>();
     iUnitOfWork.Setup(st => st.TeacherDegreeRepository).Returns(iRepository.Object);
     AutoMapper.Mapper.CreateMap<ViewTeacherDegree, TeacherDegree>();
     var viewModel = AutoMapper.Mapper.Map<ViewTeacherDegree, TeacherDegree>(this.teacherDegree);
     iRepository.Setup(inv => inv.GetById(It.Is<int>(i => i > 0))).Returns(viewModel);
     var teacherDegreeService = new TeacherDegreeService(logger.Object, iUnitOfWork.Object);
     int anyIdMoreZero = 2;
     //Act
     teacherDegreeService.GetTeacherDegreeById(anyIdMoreZero);
     //Assert
     iRepository.Verify(inv => inv.GetById(anyIdMoreZero), Times.Once);
 }
 public void TeacherDegree_GetById_Test_Is_Generete_Exeption_If_Id_less_zero()
 {
     //Arrange
     var logger = new Mock<ILogger>();
     var iRepository = new Mock<IRepository<TeacherDegree>>();
     var iUnitOfWork = new Mock<IUnitOfWork>();
     AutoMapper.Mapper.CreateMap<ViewTeacherDegree, TeacherDegree>();
     var viewModel = AutoMapper.Mapper.Map<ViewTeacherDegree, TeacherDegree>(this.teacherDegree);
     iUnitOfWork.Setup(st => st.TeacherDegreeRepository).Returns(iRepository.Object);
     var teacherDegreeService = new TeacherDegreeService(logger.Object, iUnitOfWork.Object);
     int anyIdLessZero = -5;
     //Act
     var tempteacherDegree = teacherDegreeService.GetTeacherDegreeById(anyIdLessZero);
 }