Ejemplo n.º 1
0
        public void FindByCourseId_WhenCalled_ReturnsAllOfferingsForGivenCourseId()
        {
            var courseId  = 5;
            var professor = FakeOfferingRepository.oliverQueen;

            var result = _offeringServ.FindByCourseId(courseId);

            Assert.That(result.FirstOrDefault().Professor, Is.EqualTo(professor));
            Assert.That(result, Is.Not.Null);
            Assert.That(result.Count(), Is.EqualTo(3));
        }
Ejemplo n.º 2
0
        public IHttpActionResult GetByCourseId(int courseId)
        {
            var offerings = _offeringService.FindByCourseId(courseId);

            var offeringsDto = offerings
                               .Select(o =>
            {
                return(GetOfferingDto(o));
            });

            return(Ok(offeringsDto));
        }