示例#1
0
        private void Setup()
        {
            var studentAssessmentToEnterResultsStudentModelMapper =
                Substitute.For <IMapper <StudentAssessment, EnterResultsStudentModel> >();

            studentAssessmentToEnterResultsStudentModelMapper.Build(Arg.Any <StudentAssessment>())
            .Returns(new EnterResultsStudentModel());

            var downloader = Substitute.For <IFileDownloader>();

            _profilePhotoUrlFetcher = Substitute.For <ProfilePhotoUrlFetcher>(downloader);
            _mapper = new AssessmentToEnterResultsModelMapper(studentAssessmentToEnterResultsStudentModelMapper, _profilePhotoUrlFetcher);

            _profilePhotoUrlFetcher.GetProfilePhotoThumbnailUrlOrDefault(Arg.Any <Int32>()).Returns("/Assets/Images/placeholder.png");

            _entity = new AssessmentBuilder()
                      .WithAssessmentLearningStandards()
                      .WithAssessmentPerformanceLevels()
                      .Build();

            Web.Data.Entities.Student student1 = new StudentBuilder().Build();
            Web.Data.Entities.Student student2 = new StudentBuilder().Build();

            _section           = new SectionBuilder().WithStudent(student1).WithStudent(student2).WithAssessment(_entity).Build();
            _assessmentSection = _section.AssessmentSections.First();
        }
示例#2
0
 public AssessmentBuilder WithSection(Web.Data.Entities.Section section)
 {
     _assessmentSections = new List <AssessmentSection>
     {
         new AssessmentSection
         {
             Section = section
         }
     };
     return(this);
 }
        private void SetUp()
        {
            _section = new SectionBuilder().Build();
            var genericRepositoryStub = Substitute.For<IGenericRepository>();
            genericRepositoryStub.Get(Arg.Any<Expression<Func<Web.Data.Entities.Section, bool>>>()).Returns(_section);

            var schoolRepository = Substitute.For<ISchoolRepository>();
            _school = new SchoolBuilder().Build();
            schoolRepository.GetSchool().Returns(_school);

            _mapper = new SetModelToStudentSectionAssociationMapper(genericRepositoryStub, schoolRepository);
        }
        private void SetUp()
        {
            _section = new SectionBuilder().Build();
            var genericRepositoryStub = Substitute.For <IGenericRepository>();

            genericRepositoryStub.Get(Arg.Any <Expression <Func <Web.Data.Entities.Section, bool> > >()).Returns(_section);

            var schoolRepository = Substitute.For <ISchoolRepository>();

            _school = new SchoolBuilder().Build();
            schoolRepository.GetSchool().Returns(_school);

            _mapper = new SetModelToStudentSectionAssociationMapper(genericRepositoryStub, schoolRepository);
        }
示例#5
0
        public Web.Data.Entities.Section Build()
        {
            _section = new Web.Data.Entities.Section
            {
                SectionIdentity             = _sectionIdentity,
                SchoolId                    = Constants.SchoolId,
                SchoolYear                  = SchoolYear,
                TermTypeId                  = TermTypeId,
                ClassPeriodName             = _classPeriodName,
                ClassroomIdentificationCode = _classroomIdentificationCode,
                LocalCourseCode             = _localCourseCode,
                UniqueSectionCode           = _uniqueSectionCode,
                SequenceOfCourse            = SequenceOfCourse,
                Session = _session,
                StudentSectionAttendanceEvents = _attendanceEvents
            };
            MakeStudentSectionAssociations();
            MakeAssessmentSectionAssociations();

            return(_section);
        }
示例#6
0
        public Web.Data.Entities.Section Build()
        {
            
            _section = new Web.Data.Entities.Section
            {
                SectionIdentity = _sectionIdentity,
                SchoolId = Constants.SchoolId,
                SchoolYear = SchoolYear,
                TermTypeId = TermTypeId,
                ClassPeriodName = _classPeriodName,
                ClassroomIdentificationCode = _classroomIdentificationCode,
                LocalCourseCode = _localCourseCode,
                UniqueSectionCode = _uniqueSectionCode,
                SequenceOfCourse = SequenceOfCourse,
                Session = _session,
                StudentSectionAttendanceEvents = _attendanceEvents
            };
            MakeStudentSectionAssociations();
            MakeAssessmentSectionAssociations();

            return _section;
        }
        private void SetUp()
        {
            _createModel = new CreateAssessmentModelBuilder().Build();
            _assessment = new AssessmentBuilder()
                .WithAssessmentLearningStandards()
                .WithAssessmentPerformanceLevels()
                .Build();

            _genericRepositoryStub = Substitute.For<IGenericRepository>();
            _section = new SectionBuilder().Build();

            var fourthGradeLevelDescriptor = new GradeLevelDescriptor
            {
                GradeLevelDescriptorId = 99,
                GradeLevelTypeId = 100
            };

            _genericRepositoryStub.Get(Arg.Any<GradeLevelTypeDescriptorQuery>()).Returns( fourthGradeLevelDescriptor);

            _genericRepositoryStub.Get(Arg.Any<Expression<Func<Web.Data.Entities.Section, bool>>>())
                                .Returns(_section);
        }
        private void Setup()
        {
            _attendanceRepository = Substitute.For <IAttendanceRepository>();
            _attendanceService    = new AttendanceService(_attendanceRepository);

            _student = new StudentBuilder().Build();
            _section = new SectionBuilder().WithStudent(_student).Build();
            _date    = _student.StudentSectionAssociations.First().BeginDate.AddDays(3);

            _attendanceFlags = new List <AttendanceFlag>
            {
                new AttendanceFlag {
                    StudentUSI = new StudentBuilder().WithStudentUsi(1).Build().StudentUSI, FlagCount = 7
                },
                new AttendanceFlag {
                    StudentUSI = new StudentBuilder().WithStudentUsi(2).Build().StudentUSI, FlagCount = 6
                },
                new AttendanceFlag {
                    StudentUSI = new StudentBuilder().WithStudentUsi(3).Build().StudentUSI, FlagCount = 3
                }
            };
        }
        private void SetUp()
        {
            _createModel = new CreateAssessmentModelBuilder().Build();
            _assessment  = new AssessmentBuilder()
                           .WithAssessmentLearningStandards()
                           .WithAssessmentPerformanceLevels()
                           .Build();

            _genericRepositoryStub = Substitute.For <IGenericRepository>();
            _section = new SectionBuilder().Build();

            var fourthGradeLevelDescriptor = new GradeLevelDescriptor
            {
                GradeLevelDescriptorId = 99,
                GradeLevelTypeId       = 100
            };

            _genericRepositoryStub.Get(Arg.Any <GradeLevelTypeDescriptorQuery>()).Returns(fourthGradeLevelDescriptor);

            _genericRepositoryStub.Get(Arg.Any <Expression <Func <Web.Data.Entities.Section, bool> > >())
            .Returns(_section);
        }
        private void SetUp()
        {
            _genericRepositoryStub = Substitute.For<IGenericRepository>();
            _createModelToAssessmentPerformanceLevelMapperMock = Substitute.For<IPerformanceLevelMapper>();
            _createModelToCreateModelToAssessmentSectionMapperMock = Substitute.For<ICreateModelToAssessmentSectionMapper>();
            _createModelToCreateModelToAssessmentLearningStandardMapperMock =
                Substitute.For<ICreateModelToAssessmentLearningStandardMapper>();

            _section = new SectionBuilder().Build();
            _course = new CourseBuilder().Build();

            _4ThGradeLevelDescriptor = new GradeLevelDescriptor
            {
                GradeLevelDescriptorId = 99,
                GradeLevelTypeId = 100
            };

            _genericRepositoryStub.Get(Arg.Any<GradeLevelTypeDescriptorQuery>())
                                .Returns(_4ThGradeLevelDescriptor);
            _genericRepositoryStub.Get(Arg.Any<Expression<Func<Web.Data.Entities.Section, bool>>>())
                                .Returns(_section);
            _genericRepositoryStub.Get(Arg.Any<Expression<Func<Web.Data.Entities.Course, bool>>>())
                                .Returns(_course);
        }
示例#11
0
        private void SetUp()
        {
            _genericRepositoryStub = Substitute.For <IGenericRepository>();
            _createModelToAssessmentPerformanceLevelMapperMock              = Substitute.For <IPerformanceLevelMapper>();
            _createModelToCreateModelToAssessmentSectionMapperMock          = Substitute.For <ICreateModelToAssessmentSectionMapper>();
            _createModelToCreateModelToAssessmentLearningStandardMapperMock =
                Substitute.For <ICreateModelToAssessmentLearningStandardMapper>();

            _section = new SectionBuilder().Build();
            _course  = new CourseBuilder().Build();

            _4ThGradeLevelDescriptor = new GradeLevelDescriptor
            {
                GradeLevelDescriptorId = 99,
                GradeLevelTypeId       = 100
            };

            _genericRepositoryStub.Get(Arg.Any <GradeLevelTypeDescriptorQuery>())
            .Returns(_4ThGradeLevelDescriptor);
            _genericRepositoryStub.Get(Arg.Any <Expression <Func <Web.Data.Entities.Section, bool> > >())
            .Returns(_section);
            _genericRepositoryStub.Get(Arg.Any <Expression <Func <Web.Data.Entities.Course, bool> > >())
            .Returns(_course);
        }
        private void Setup()
        {
            _attendanceRepository = Substitute.For<IAttendanceRepository>();
            _attendanceService = new AttendanceService(_attendanceRepository);

            _student = new StudentBuilder().Build();
            _section = new SectionBuilder().WithStudent(_student).Build();
            _date = _student.StudentSectionAssociations.First().BeginDate.AddDays(3);

            _attendanceFlags = new List<AttendanceFlag>
            {
                new AttendanceFlag{StudentUSI = new StudentBuilder().WithStudentUsi(1).Build().StudentUSI, FlagCount = 7},
                new AttendanceFlag{StudentUSI = new StudentBuilder().WithStudentUsi(2).Build().StudentUSI, FlagCount = 6},
                new AttendanceFlag{StudentUSI = new StudentBuilder().WithStudentUsi(3).Build().StudentUSI, FlagCount = 3}
            };
        }
示例#13
0
 public StudentSectionAttendanceEventBuilder WithSection(Web.Data.Entities.Section section)
 {
     _section = section;
     return(this);
 }
        private void Setup()
        {
            var studentAssessmentToEnterResultsStudentModelMapper =
                Substitute.For<IMapper<StudentAssessment, EnterResultsStudentModel>>();
            studentAssessmentToEnterResultsStudentModelMapper.Build(Arg.Any<StudentAssessment>())
                .Returns(new EnterResultsStudentModel());

            var downloader = Substitute.For<IFileDownloader>();
            _profilePhotoUrlFetcher = Substitute.For<ProfilePhotoUrlFetcher>(downloader);
            _mapper = new AssessmentToEnterResultsModelMapper(studentAssessmentToEnterResultsStudentModelMapper, _profilePhotoUrlFetcher);

            _profilePhotoUrlFetcher.GetProfilePhotoThumbnailUrlOrDefault(Arg.Any<Int32>()).Returns("/Assets/Images/placeholder.png");

            _entity = new AssessmentBuilder()
                .WithAssessmentLearningStandards()
                .WithAssessmentPerformanceLevels()
                .Build();

            Web.Data.Entities.Student student1 = new StudentBuilder().Build();
            Web.Data.Entities.Student student2 = new StudentBuilder().Build();

            _section = new SectionBuilder().WithStudent(student1).WithStudent(student2).WithAssessment(_entity).Build();
            _assessmentSection = _section.AssessmentSections.First();
        }
 public StudentSectionAttendanceEventBuilder WithSection(Web.Data.Entities.Section section)
 {
     _section = section;
     return this;
 }