public virtual ApiCustomerResponseModel MapBOToModel(
			BOCustomer boCustomer)
		{
			var model = new ApiCustomerResponseModel();

			model.SetProperties(boCustomer.Id, boCustomer.Email, boCustomer.FirstName, boCustomer.LastName, boCustomer.Phone);

			return model;
		}
Beispiel #2
0
        public virtual ApiCustomerResponseModel MapBOToModel(
            BOCustomer boCustomer)
        {
            var model = new ApiCustomerResponseModel();

            model.SetProperties(boCustomer.CustomerID, boCustomer.AccountNumber, boCustomer.ModifiedDate, boCustomer.PersonID, boCustomer.Rowguid, boCustomer.StoreID, boCustomer.TerritoryID);

            return(model);
        }
        public void MapResponseToRequest()
        {
            var mapper = new ApiCustomerModelMapper();
            var model  = new ApiCustomerResponseModel();

            model.SetProperties(1, "A", "A", "A", "A");
            ApiCustomerRequestModel response = mapper.MapResponseToRequest(model);

            response.Email.Should().Be("A");
            response.FirstName.Should().Be("A");
            response.LastName.Should().Be("A");
            response.Phone.Should().Be("A");
        }
Beispiel #4
0
        public void MapResponseToRequest()
        {
            var mapper = new ApiCustomerModelMapper();
            var model  = new ApiCustomerResponseModel();

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

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