private AssessmentSection Build(CreateModel source, Data.Entities.Section section)
 {
     var target = new AssessmentSection();
     MapAssessment(target);
     MapSection(source, target, section);
     return target;
 }
 private void MapAssessment(AssessmentSection target)
 {
     target.AssessmentTitle = _assessment.AssessmentTitle;
     target.AssessedGradeLevelDescriptorId = _assessment.AssessedGradeLevelDescriptorId;
     target.AcademicSubjectDescriptorId = _assessment.AcademicSubjectDescriptorId;
     target.Version = _assessment.Version;
 }
 private void MapSection(CreateModel source, AssessmentSection target, Data.Entities.Section section)
 {
     target.SchoolId = section.SchoolId;
     target.SchoolYear = section.SchoolYear;
     target.TermTypeId = section.TermTypeId;
     target.LocalCourseCode = section.LocalCourseCode;
     target.ClassroomIdentificationCode = section.ClassroomIdentificationCode;
     target.ClassPeriodName = section.ClassPeriodName;
 }
Esempio n. 4
0
 private void MakeAssessmentSectionAssociations()
 {
     foreach (var assessment in _assessments)
     {
         var assessmentSection = new AssessmentSection
         {
             Assessment = assessment,
             Section = _section
         };
         _assessmentSections.Add(assessmentSection);
         assessment.AssessmentSections.Add(assessmentSection);
     }
     _section.AssessmentSections = _assessmentSections;
 }
        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();
        }