public void PreReqOverrideErrorTest2() { //// Arrange var errors = new List<string>(); Mock<IInstructorRepository> mockRepository = new Mock<IInstructorRepository>(); InstructorService iserv = new InstructorService(mockRepository.Object); iserv.RespondToPreReqOverride(2, string.Empty, ref errors); Assert.AreEqual(1, errors.Count); }
public string RespondToPreReqOverride(int scheduleId, string studentId) { var errors = new List<string>(); var repository = new InstructorRepository(this.entities); var service = new InstructorService(repository); service.RespondToPreReqOverride(scheduleId, studentId, ref errors); if (errors.Count == 0) { return "ok"; } return "error"; }
public void PreReqOverride() { //// Arrange var errors = new List<string>(); Mock<IInstructorRepository> mockRepository = new Mock<IInstructorRepository>(); InstructorService iserv = new InstructorService(mockRepository.Object); mockRepository.Setup(x => x.ApprovePreReqOverride(1, "1", ref errors)); iserv.RespondToPreReqOverride(1, "1", ref errors); mockRepository.Verify(x => x.ApprovePreReqOverride(1, "1", ref errors), Times.Once()); }