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); }
public void ShouldHaveErrorsIfAssessmentExists() { SetUp(); _genericRepository .Get(Arg.Any <Expression <Func <Web.Data.Entities.Assessment, bool> > >()) .Returns(_assessmentEntity); _validator.ShouldHaveValidationErrorFor(a => a.AssessmentTitle, _createAssessmentModel); }
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); }
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); }
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); }