Ejemplo n.º 1
0
        public void ShouldMapCreateModelToLocation()
        {
            _schoolRepository = Substitute.For<ISchoolRepository>();
            _schoolRepository.GetSchool().Returns(
                new School
                {
                    SchoolId = 1
                });

            var locationEntity = new Web.Data.Entities.Location();
            var locationCreateModel = new CreateModel
            {
                ClassroomIdentificationCode = "BKL200",
                MaximumNumberOfSeats = 50,
                OptimalNumberOfSeats = 30
            };

            var createModelToLocationMapper = new CreateModelToLocationMapper(_schoolRepository);
            createModelToLocationMapper.Map(locationCreateModel, locationEntity);

            locationEntity.ClassroomIdentificationCode.ShouldBe("BKL200");
            locationEntity.MaximumNumberOfSeats.ShouldBe(50);
            locationEntity.OptimalNumberOfSeats.ShouldBe(30);
            locationEntity.SchoolId.ShouldBe(1);
        }
Ejemplo n.º 2
0
        public void ShouldMapLocationToIndexModel()
        {
            var locationIndexModel = new IndexModel();
            var locationEntity = new Web.Data.Entities.Location
            {
                ClassroomIdentificationCode = "BKL200",
                MaximumNumberOfSeats = 50,
                OptimalNumberOfSeats = 30
            };

            var locationToIndexMapper = new LocationToIndexModelMapper();
            locationToIndexMapper.Map(locationEntity, locationIndexModel);

            locationIndexModel.ClassroomIdentificationCode.ShouldBe("BKL200");
            locationIndexModel.MaximumNumberOfSeats.ShouldBe(50);
            locationIndexModel.OptimalNumberOfSeats.ShouldBe(30);
        }
Ejemplo n.º 3
0
        public void ShouldMapLocationToIndexModel()
        {
            var locationIndexModel = new IndexModel();
            var locationEntity     = new Web.Data.Entities.Location
            {
                ClassroomIdentificationCode = "BKL200",
                MaximumNumberOfSeats        = 50,
                OptimalNumberOfSeats        = 30
            };

            var locationToIndexMapper = new LocationToIndexModelMapper();

            locationToIndexMapper.Map(locationEntity, locationIndexModel);

            locationIndexModel.ClassroomIdentificationCode.ShouldBe("BKL200");
            locationIndexModel.MaximumNumberOfSeats.ShouldBe(50);
            locationIndexModel.OptimalNumberOfSeats.ShouldBe(30);
        }