Beispiel #1
0
        public void MapEntityToModelList()
        {
            var    mapper = new DALStudioMapper();
            Studio item   = new Studio();

            item.SetProperties(1, "A", "A", "A", "A", "A", "A", "A");
            List <ApiStudioServerResponseModel> response = mapper.MapEntityToModel(new List <Studio>()
            {
                { item }
            });

            response.Count.Should().Be(1);
        }
Beispiel #2
0
        public void MapEFToBOList()
        {
            var    mapper = new DALStudioMapper();
            Studio entity = new Studio();

            entity.SetProperties("A", "A", "A", 1, "A", "A", "A", "A");

            List <BOStudio> response = mapper.MapEFToBO(new List <Studio>()
            {
                entity
            });

            response.Count.Should().Be(1);
        }
        public virtual Studio MapBOToEF(
            BOStudio bo)
        {
            Studio efStudio = new Studio();

            efStudio.SetProperties(
                bo.Address1,
                bo.Address2,
                bo.City,
                bo.Id,
                bo.Name,
                bo.Province,
                bo.Website,
                bo.Zip);
            return(efStudio);
        }
Beispiel #4
0
        public void MapEntityToModel()
        {
            var    mapper = new DALStudioMapper();
            Studio item   = new Studio();

            item.SetProperties(1, "A", "A", "A", "A", "A", "A", "A");
            ApiStudioServerResponseModel response = mapper.MapEntityToModel(item);

            response.Address1.Should().Be("A");
            response.Address2.Should().Be("A");
            response.City.Should().Be("A");
            response.Id.Should().Be(1);
            response.Name.Should().Be("A");
            response.Province.Should().Be("A");
            response.Website.Should().Be("A");
            response.Zip.Should().Be("A");
        }
Beispiel #5
0
        public void MapEFToBO()
        {
            var    mapper = new DALStudioMapper();
            Studio entity = new Studio();

            entity.SetProperties("A", "A", "A", 1, "A", "A", "A", "A");

            BOStudio response = mapper.MapEFToBO(entity);

            response.Address1.Should().Be("A");
            response.Address2.Should().Be("A");
            response.City.Should().Be("A");
            response.Id.Should().Be(1);
            response.Name.Should().Be("A");
            response.Province.Should().Be("A");
            response.Website.Should().Be("A");
            response.Zip.Should().Be("A");
        }
Beispiel #6
0
        public virtual Studio MapModelToEntity(
            int id,
            ApiStudioServerRequestModel model
            )
        {
            Studio item = new Studio();

            item.SetProperties(
                id,
                model.Address1,
                model.Address2,
                model.City,
                model.Name,
                model.Province,
                model.Website,
                model.Zip);
            return(item);
        }