Exemple #1
0
        public virtual ApiStoreResponseModel MapBOToModel(
            BOStore boStore)
        {
            var model = new ApiStoreResponseModel();

            model.SetProperties(boStore.BusinessEntityID, boStore.Demographic, boStore.ModifiedDate, boStore.Name, boStore.Rowguid, boStore.SalesPersonID);

            return(model);
        }
        public void MapResponseToRequest()
        {
            var mapper = new ApiStoreModelMapper();
            var model  = new ApiStoreResponseModel();

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

            response.Demographic.Should().Be("A");
            response.ModifiedDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
            response.Name.Should().Be("A");
            response.Rowguid.Should().Be(Guid.Parse("8420cdcf-d595-ef65-66e7-dff9f98764da"));
            response.SalesPersonID.Should().Be(1);
        }