public void UpdateTaTutorErrorTest() { //// Arrange var errors = new List <string>(); var mockRepository = new Mock <ITaTutorRepository>(); var tatutorService = new TaTutorService(mockRepository.Object); //// Act tatutorService.UpdateTaTutor(null, ref errors); //// Assert Assert.AreEqual(1, errors.Count); }
public void InsertTaTutorBadFirstName() { //// Arranage var errors = new List <string>(); var mockRepository = new Mock <ITaTutorRepository>(); var tatutorService = new TaTutorService(mockRepository.Object); var tatutor = new TaTutor { TaTutorId = "A0123456", FirstName = "J4ne", LastName = "Doe" }; //// Act tatutorService.InsertTaTutor(tatutor, ref errors); //// Assert Assert.AreEqual(1, errors.Count); }
public void InsertTaTutorErrorTest2() { //// Arranage var errors = new List <string>(); var mockRepository = new Mock <ITaTutorRepository>(); var tatutorService = new TaTutorService(mockRepository.Object); var tatutor = new TaTutor { TaTutorId = string.Empty }; //// Act tatutorService.InsertTaTutor(tatutor, ref errors); //// Assert Assert.AreEqual(1, errors.Count); }
public void GetTaTutorListTest() { //// Arrange var errors = new List <string>(); var mockRepository = new Mock <ITaTutorRepository>(); var tatutorService = new TaTutorService(mockRepository.Object); var tatutorList = new List <TaTutor>(); tatutorList.Add(new TaTutor { TaTutorId = "A0123456", FirstName = "Tony", LastName = "Stark" }); tatutorList.Add(new TaTutor { TaTutorId = "A0987655", FirstName = "John", LastName = "Smith" }); mockRepository.Setup(x => x.GetTutorList(ref errors)).Returns(tatutorList); //// Act var otherList = tatutorService.GetTutorList(ref errors); //// Assert Assert.AreEqual(tatutorList, otherList); }