public Course GetCourse(int id) { var errors = new List<string>(); var repository = new CourseRepository(this.entities); var service = new CourseService(repository); return service.GetCourse(id, ref errors); }
public void GetCourseErrorTest() { //// Arranage var errors = new List<string>(); var mockRepository = new Mock<ICourseRepository>(); var courseService = new CourseService(mockRepository.Object); //// Act courseService.GetCourse(0, ref errors); //// Assert Assert.AreEqual(1, errors.Count); }