Пример #1
0
        public void ShouldMapCourseToIndexModel()
        {
            var courseIndexModel = new IndexModel();
            var courseEntity     = new Web.Data.Entities.Course
            {
                CourseCode    = "CSC101",
                CourseTitle   = "Intro to Programming",
                NumberOfParts = 1,
                AcademicSubjectDescriptorId      = (int)AcademicSubjectDescriptorEnum.EnglishLanguageArts,
                CourseDescription                = "Learnin some Java",
                DateCourseAdopted                = new DateTime(2014, 07, 03),
                HighSchoolCourseRequirement      = false,
                CourseGPAApplicabilityTypeId     = (int)CourseGPAApplicabilityTypeEnum.Applicable,
                CourseDefinedByTypeId            = (int)CourseDefinedByTypeEnum.LEA,
                MinimumAvailableCreditTypeId     = (int)CreditTypeEnum.Adulteducationcredit,
                MinimumAvailableCreditConversion = 3m,
                MinimumAvailableCredit           = 3m,
                MaximumAvailableCreditTypeId     = (int)CreditTypeEnum.CareerandTechnicalEducationcredit,
                MaximumAvailableCreditConversion = 3m,
                MaximumAvailableCredit           = 3m,
                CareerPathwayTypeId              = (int)CareerPathwayTypeEnum.AgricultureFoodandNaturalResources,
                TimeRequiredForCompletion        = 10,
            };

            var courseToCreateModelMapper = new CourseToIndexModelMapper();

            courseToCreateModelMapper.Map(courseEntity, courseIndexModel);

            courseIndexModel.CourseCode.ShouldBe("CSC101");
            courseIndexModel.CourseTitle.ShouldBe("Intro to Programming");
            courseIndexModel.CourseDescription.ShouldBe("Learnin some Java");
        }
Пример #2
0
        public void ShouldMapCourseToIndexModel()
        {
            var courseIndexModel = new IndexModel();
            var courseEntity = new Web.Data.Entities.Course
            {
                CourseCode = "CSC101",
                CourseTitle = "Intro to Programming",
                NumberOfParts = 1,
                AcademicSubjectDescriptorId = (int)AcademicSubjectDescriptorEnum.EnglishLanguageArts,
                CourseDescription = "Learnin some Java",
                DateCourseAdopted = new DateTime(2014, 07, 03),
                HighSchoolCourseRequirement = false,
                CourseGPAApplicabilityTypeId = (int)CourseGPAApplicabilityTypeEnum.Applicable,
                CourseDefinedByTypeId = (int)CourseDefinedByTypeEnum.LEA,
                MinimumAvailableCreditTypeId = (int)CreditTypeEnum.Adulteducationcredit,
                MinimumAvailableCreditConversion = 3m,
                MinimumAvailableCredit = 3m,
                MaximumAvailableCreditTypeId = (int)CreditTypeEnum.CareerandTechnicalEducationcredit,
                MaximumAvailableCreditConversion = 3m,
                MaximumAvailableCredit = 3m,
                CareerPathwayTypeId = (int)CareerPathwayTypeEnum.AgricultureFoodandNaturalResources,
                TimeRequiredForCompletion = 10,
            };

            var courseToCreateModelMapper = new CourseToIndexModelMapper();
            courseToCreateModelMapper.Map(courseEntity, courseIndexModel);

            courseIndexModel.CourseCode.ShouldBe("CSC101");
            courseIndexModel.CourseTitle.ShouldBe("Intro to Programming");
            courseIndexModel.CourseDescription.ShouldBe("Learnin some Java");
        }
        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);
        }
Пример #4
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);
        }