Exemplo n.º 1
0
        public void ShouldNotHaveErrorsIfSectionDoesNotExist()
        {
            Setup();

            _genericRepository
            .Get(Arg.Any <SectionByPrimaryKeysQuery>())
            .Returns(null as Web.Data.Entities.Section);

            _validator.ShouldNotHaveValidationErrorFor(s => s.Session, _sectionCreateModel);
            _validator.ShouldNotHaveValidationErrorFor(s => s.Period, _sectionCreateModel);
            _validator.ShouldNotHaveValidationErrorFor(s => s.Classroom, _sectionCreateModel);
            _validator.ShouldNotHaveValidationErrorFor(s => s.Course, _sectionCreateModel);
        }
Exemplo n.º 2
0
        public void ShouldNotHaveErrorsIfCourseDoesNotExist()
        {
            Setup();
            _genericRepository
            .Get(Arg.Any <Expression <Func <Web.Data.Entities.ParentCourse, bool> > >())
            .Returns(null as Web.Data.Entities.ParentCourse);

            _validator.ShouldNotHaveValidationErrorFor(c => c.ParentCourseCode, _courseCreateModel.CourseCode);
        }
Exemplo n.º 3
0
        public void ShouldNotHaveErrorsWhenLocationDoesNotExist()
        {
            Setup();

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

            _validator.ShouldNotHaveValidationErrorFor(m => m.ClassroomIdentificationCode, _locationCreateModel.ClassroomIdentificationCode);
        }
Exemplo n.º 4
0
        public void ShouldNotHaveErrorsIfClassPeriodDoesNotExist()
        {
            Setup();

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

            _validator.ShouldNotHaveValidationErrorFor(m => m.ClassPeriodName, _classPeriodCreateModel.ClassPeriodName);
        }
Exemplo n.º 5
0
        public void ShouldNotHaveErrorsIfAssessmentDoesNotExist()
        {
            SetUp();

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

            _validator.ShouldNotHaveValidationErrorFor(a => a.AssessmentTitle, _createAssessmentModel);
        }