예제 #1
0
        public void MapBOToModelList()
        {
            var       mapper = new BOLAddressMapper();
            BOAddress bo     = new BOAddress();

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

            response.Count.Should().Be(1);
        }
예제 #2
0
        public void MapModelToBO()
        {
            var mapper = new BOLAddressMapper();
            ApiAddressRequestModel model = new ApiAddressRequestModel();

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

            response.AddressLine1.Should().Be("A");
            response.AddressLine2.Should().Be("A");
            response.City.Should().Be("A");
            response.ModifiedDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
            response.PostalCode.Should().Be("A");
            response.Rowguid.Should().Be(Guid.Parse("8420cdcf-d595-ef65-66e7-dff9f98764da"));
            response.StateProvinceID.Should().Be(1);
        }
예제 #3
0
        public void MapBOToModel()
        {
            var       mapper = new BOLAddressMapper();
            BOAddress bo     = new BOAddress();

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

            response.AddressID.Should().Be(1);
            response.AddressLine1.Should().Be("A");
            response.AddressLine2.Should().Be("A");
            response.City.Should().Be("A");
            response.ModifiedDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
            response.PostalCode.Should().Be("A");
            response.Rowguid.Should().Be(Guid.Parse("8420cdcf-d595-ef65-66e7-dff9f98764da"));
            response.StateProvinceID.Should().Be(1);
        }
예제 #4
0
        public void MapEFToBO()
        {
            var     mapper = new DALAddressMapper();
            Address entity = new Address();

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

            BOAddress response = mapper.MapEFToBO(entity);

            response.AddressID.Should().Be(1);
            response.AddressLine1.Should().Be("A");
            response.AddressLine2.Should().Be("A");
            response.City.Should().Be("A");
            response.ModifiedDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
            response.PostalCode.Should().Be("A");
            response.Rowguid.Should().Be(Guid.Parse("8420cdcf-d595-ef65-66e7-dff9f98764da"));
            response.StateProvinceID.Should().Be(1);
        }