public void ShouldTransformEducationWithNullEducationTypeToDto() { var param = new Db.Education { EducationId = 1, City = "Ipsum City", Country = "Dolor Republic", State = "Lorem State", SchoolName = "Fudge School", YearAttended = DateTime.UtcNow, YearGraduated = DateTime.UtcNow, EducationTypeId = 1, EducationType = null, UserId = 1, User = new Db.User { UserId = 1 } }; var result = EducationMapper.ToDto(param); Assert.IsInstanceOf(typeof(Education), result); Assert.NotNull(result); Assert.IsNull(result.EducationType); }
public void ShouldAddEducation() { var dbResult = new Education { EducationId = 4, EducationType = new EducationType(), City = "Foo", State = "Bar", Country = "Baz", Course = "Fudge", UserId = 1, User = new User { UserId = 1, UserName = "******" } }; _educationRepository = new Mock<IEducationRepository>(); _educationRepository.Setup(a => a.Add(It.IsAny<Education>())).Returns(dbResult); _educationLogic = new EducationLogic(_educationRepository.Object); var result = _educationLogic.Add(new Common.Contracts.Education { EducationId = 4, EducationType = new Common.Contracts.EducationType(), City = "Foo", State = "Bar", Country = "Baz", Course = "Fudge", UserId = 1 }); Assert.IsNotNull(result); }