Beispiel #1
0
        public List <CourseEntity> GetCoursesByStudentId(Guid userId)
        {
            if (userId.Equals(Guid.Empty))
            {
                throw new BadInfoException();
            }

            return(CourseFactory.Create_TwoCourseEntities_ValidMinimum_CustomStudentId(userId));
        }
        public void GetCoursesByStudentId_ValidGuid_GetsTwoCourses()
        {
            var testRepo      = new MockRepository <CourseEntity>();
            var testStudentId = Guid.NewGuid();
            var testCourses   = CourseFactory.Create_TwoCourseEntities_ValidMinimum_CustomStudentId(testStudentId);

            foreach (var courseEntity in testCourses)
            {
                testRepo.Create(courseEntity);
            }

            var testClass = InteractorFactory.Create_CourseInteractor(testRepo);

            var result = testClass.GetCoursesByStudentId(testStudentId);

            result.Count.ShouldBe(2);
        }