Skip to content

Instantly share code, notes, and snippets.

@Mozu-CS
Created December 8, 2015 20:48
Show Gist options
  • Save Mozu-CS/bd28ef7047dfcd5ee38d to your computer and use it in GitHub Desktop.
Save Mozu-CS/bd28ef7047dfcd5ee38d to your computer and use it in GitHub Desktop.
Method for retrieving test data that then gets mapped to a customer object in Mozu
private System.Data.DataTable GetContactTestData()
{
var tblContact = new System.Data.DataTable();
tblContact.Columns.Add("Id");
tblContact.Columns.Add("Type");
tblContact.Columns.Add("IsPrimary");
tblContact.Columns.Add("CompanyOrOrganization");
tblContact.Columns.Add("FirstName");
tblContact.Columns.Add("MiddleNameorInitial");
tblContact.Columns.Add("LastNameOrSurname");
tblContact.Columns.Add("Email");
tblContact.Columns.Add("FaxNumber");
tblContact.Columns.Add("HomePhone");
tblContact.Columns.Add("MobilePhone");
tblContact.Columns.Add("WorkPhone");
tblContact.Columns.Add("AddressType");
tblContact.Columns.Add("Address1");
tblContact.Columns.Add("Address2");
tblContact.Columns.Add("CityOrTown");
tblContact.Columns.Add("StateOrProvince");
tblContact.Columns.Add("PostalOrZipCode");
tblContact.Columns.Add("CountryCode");
System.Data.DataRow newRow = tblContact.NewRow();
newRow["Id"] = "101"; //externalId
newRow["Type"] = "Billing";
newRow["IsPrimary"] = true;
newRow["CompanyOrOrganization"] = "Main Corp";
newRow["FirstName"] = "Jon";
newRow["LastNameOrSurname"] = "Smithe";
newRow["Email"] = "vip_shopper@mozu.com";
newRow["WorkPhone"] = "555-555-5555";
newRow["AddressType"] = "Commercial";
newRow["Address1"] = "100 Main Corp Way";
newRow["Address2"] = "Building 9";
newRow["CityOrTown"] = "New York";
newRow["StateOrProvince"] = "NY";
newRow["PostalOrZipCode"] = "10026";
newRow["CountryCode"] = "US";
tblContact.Rows.Add(newRow);
return tblContact;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment