コード例 #1
0
        public void MapModelToBO()
        {
            var mapper = new BOLPersonMapper();
            ApiPersonRequestModel model = new ApiPersonRequestModel();

            model.SetProperties("A");
            BOPerson response = mapper.MapModelToBO(1, model);

            response.PersonName.Should().Be("A");
        }
コード例 #2
0
        public void MapBOToModel()
        {
            var      mapper = new BOLPersonMapper();
            BOPerson bo     = new BOPerson();

            bo.SetProperties(1, "A");
            ApiPersonResponseModel response = mapper.MapBOToModel(bo);

            response.PersonId.Should().Be(1);
            response.PersonName.Should().Be("A");
        }
コード例 #3
0
        public void MapEFToBO()
        {
            var    mapper = new DALPersonMapper();
            Person entity = new Person();

            entity.SetProperties(1, "A");

            BOPerson response = mapper.MapEFToBO(entity);

            response.PersonId.Should().Be(1);
            response.PersonName.Should().Be("A");
        }
コード例 #4
0
        public void MapBOToEF()
        {
            var mapper = new DALPersonMapper();
            var bo     = new BOPerson();

            bo.SetProperties(1, "A");

            Person response = mapper.MapBOToEF(bo);

            response.PersonId.Should().Be(1);
            response.PersonName.Should().Be("A");
        }
コード例 #5
0
        public void MapBOToModelList()
        {
            var      mapper = new BOLPersonMapper();
            BOPerson bo     = new BOPerson();

            bo.SetProperties(1, "A");
            List <ApiPersonResponseModel> response = mapper.MapBOToModel(new List <BOPerson>()
            {
                { bo }
            });

            response.Count.Should().Be(1);
        }
コード例 #6
0
        public void MapBOToModelList()
        {
            var      mapper = new BOLPersonMapper();
            BOPerson bo     = new BOPerson();

            bo.SetProperties(1, "A", "A", 1, "A", "A", "A", DateTime.Parse("1/1/1987 12:00:00 AM"), true, "A", Guid.Parse("8420cdcf-d595-ef65-66e7-dff9f98764da"), "A", "A");
            List <ApiPersonResponseModel> response = mapper.MapBOToModel(new List <BOPerson>()
            {
                { bo }
            });

            response.Count.Should().Be(1);
        }
コード例 #7
0
        public void MapModelToBO()
        {
            var mapper = new BOLPersonMapper();
            ApiPersonRequestModel model = new ApiPersonRequestModel();

            model.SetProperties("A", "A", 1, "A", "A", "A", DateTime.Parse("1/1/1987 12:00:00 AM"), true, "A", Guid.Parse("8420cdcf-d595-ef65-66e7-dff9f98764da"), "A", "A");
            BOPerson response = mapper.MapModelToBO(1, model);

            response.AdditionalContactInfo.Should().Be("A");
            response.Demographic.Should().Be("A");
            response.EmailPromotion.Should().Be(1);
            response.FirstName.Should().Be("A");
            response.LastName.Should().Be("A");
            response.MiddleName.Should().Be("A");
            response.ModifiedDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
            response.NameStyle.Should().Be(true);
            response.PersonType.Should().Be("A");
            response.Rowguid.Should().Be(Guid.Parse("8420cdcf-d595-ef65-66e7-dff9f98764da"));
            response.Suffix.Should().Be("A");
            response.Title.Should().Be("A");
        }
コード例 #8
0
        public void MapEFToBO()
        {
            var    mapper = new DALPersonMapper();
            Person entity = new Person();

            entity.SetProperties("A", 1, "A", 1, "A", "A", "A", DateTime.Parse("1/1/1987 12:00:00 AM"), true, "A", Guid.Parse("8420cdcf-d595-ef65-66e7-dff9f98764da"), "A", "A");

            BOPerson response = mapper.MapEFToBO(entity);

            response.AdditionalContactInfo.Should().Be("A");
            response.BusinessEntityID.Should().Be(1);
            response.Demographic.Should().Be("A");
            response.EmailPromotion.Should().Be(1);
            response.FirstName.Should().Be("A");
            response.LastName.Should().Be("A");
            response.MiddleName.Should().Be("A");
            response.ModifiedDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
            response.NameStyle.Should().Be(true);
            response.PersonType.Should().Be("A");
            response.Rowguid.Should().Be(Guid.Parse("8420cdcf-d595-ef65-66e7-dff9f98764da"));
            response.Suffix.Should().Be("A");
            response.Title.Should().Be("A");
        }