Exemplo n.º 1
0
        public void GetByCourseIdReturnsAllCoursesWithTheGivenId()
        {
            var courseId = "test";

            BaseServiceTests.Initialize();

            var countWithId = this.dbFixture.dbContext.Assignments
                              .Where(a => a.IsDeleted == false && a.Lecturecise.CourseId == courseId).Count();

            var repository = new DbRepository <Assignment>(this.dbFixture.dbContext);
            var service    = new AssignmentService(repository);

            Assert.Equal(countWithId, service.GetByCourseId(courseId).Count());
        }