Exemplo n.º 1
0
 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);
 }
Exemplo n.º 2
0
        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);
        }