예제 #1
0
        public void ShouldMapClassPeriodToIndexModel()
        {
            var classPeriodIndexModel = new IndexModel();
            var classPeriodEntity = new Web.Data.Entities.ClassPeriod
            {
                ClassPeriodName = "Period 1"
            };

            var classPeriodToIndexMapper = new ClassPeriodToIndexModelMapper();

            classPeriodToIndexMapper.Map(classPeriodEntity, classPeriodIndexModel);

            classPeriodIndexModel.ClassPeriodName.ShouldBe("Period 1");
        }
예제 #2
0
        public void ShouldMapCreateModelToClassPeriod()
        {
            SetUp();
            var classPeriodEntity = new Web.Data.Entities.ClassPeriod();
            var classPeriodCreateModel = new CreateModel
            {
                ClassPeriodName = "Period 1"
            };

            var createModeltoClassPeriodMapper = new CreateModelToClassPeriodMapper(_schoolRepository);
            createModeltoClassPeriodMapper.Map(classPeriodCreateModel, classPeriodEntity);

            classPeriodEntity.ClassPeriodName.ShouldBe("Period 1");
            classPeriodEntity.SchoolId.ShouldBe(1);
        }