public void Customer_Serialize_PropertyNamesAsExpected() { // Arrange var customer = new Customer(); // Act var serializedObject = JsonConvert.SerializeObject(customer); // Assert Assert.AreEqual(@"{ ""company"": false, ""locale"": null, ""ip_address"": null, ""forwarded_ip"": null, ""first_name"": null, ""last_name"": null, ""address1"": null, ""address2"": null, ""house_number"": null, ""zip_code"": null, ""city"": null, ""state"": null, ""country"": null, ""phone"": null, ""email"": null, ""disable_send_email"": null }".RemoveWhiteSpace(), serializedObject.RemoveWhiteSpace()); }
public static OrderRequest CreateDirectPayAfterDeliveryOrder(string orderId, string description, int amountInCents, string currencyCode, PaymentOptions paymentOptions, GatewayInfo gatewayInfo, ShoppingCart shoppingCart, CheckoutOptions checkoutOptions, Customer customer) { return new OrderRequest( OrderType.Direct, orderId, description, amountInCents, currencyCode, paymentOptions) { GatewayId = "PAYAFTER", GatewayInfo = gatewayInfo, ShoppingCart = shoppingCart, Customer = customer, CheckoutOptions = checkoutOptions }; }
public static OrderRequest CreateDirectKlarnaOrder(string orderId, string description, int amountInCents, string currencyCode, PaymentOptions paymentOptions, GatewayInfo gatewayInfo, ShoppingCart shoppingCart, CheckoutOptions checkoutOptions, Customer customer, DeliveryAddress deliveryAddress) { return new OrderRequest( OrderType.Direct, orderId, description, amountInCents, currencyCode, paymentOptions) { GatewayId = "KLARNA", GatewayInfo = gatewayInfo, ShoppingCart = shoppingCart, Customer = customer, DeliveryAddress = deliveryAddress, CheckoutOptions = checkoutOptions }; }