Пример #1
0
        public void ShouldHaveErrorsIfSectionExists()
        {
            Setup();

            var sectionEntity = new SectionBuilder().Build();

            _genericRepository
            .Get(Arg.Any <SectionByPrimaryKeysQuery>())
            .Returns(sectionEntity);

            _validator.ShouldHaveValidationErrorFor(s => s.Session, _sectionCreateModel);
            _validator.ShouldHaveValidationErrorFor(s => s.Period, _sectionCreateModel);
            _validator.ShouldHaveValidationErrorFor(s => s.Classroom, _sectionCreateModel);
            _validator.ShouldHaveValidationErrorFor(s => s.Course, _sectionCreateModel);
        }
Пример #2
0
        public void ShouldHaveErrorsIfAssessmentExists()
        {
            SetUp();

            _genericRepository
            .Get(Arg.Any <Expression <Func <Web.Data.Entities.Assessment, bool> > >())
            .Returns(_assessmentEntity);

            _validator.ShouldHaveValidationErrorFor(a => a.AssessmentTitle, _createAssessmentModel);
        }
Пример #3
0
        public void ShouldHaveErrorsIfCourseExists()
        {
            Setup();
            var parentCourseEntity = new ParentCourseBuilder().Build();

            _genericRepository
            .Get(Arg.Any <Expression <Func <Web.Data.Entities.ParentCourse, bool> > >())
            .Returns(parentCourseEntity);

            _validator.ShouldHaveValidationErrorFor(c => c.ParentCourseCode, _courseCreateModel.CourseCode);
        }
Пример #4
0
        public void ShouldHaveErrorsWhenLocationExists()
        {
            Setup();
            var locationEntity = new LocationBuilder().Build();

            _genericRepository
            .Get(Arg.Any <Expression <Func <Web.Data.Entities.Location, bool> > >())
            .Returns(locationEntity);

            _validator.ShouldHaveValidationErrorFor(m => m.ClassroomIdentificationCode, _locationCreateModel.ClassroomIdentificationCode);
        }
Пример #5
0
        public void ShouldHaveErrorsIfClassPeriodExists()
        {
            Setup();
            var classPeriodEntity = new ClassPeriodBuilder().Build();

            _genericRepository
            .Get(Arg.Any <Expression <Func <Web.Data.Entities.ClassPeriod, bool> > >())
            .Returns(classPeriodEntity);

            _validator.ShouldHaveValidationErrorFor(m => m.ClassPeriodName, _classPeriodCreateModel.ClassPeriodName);
        }