public static async Task WithUpdateableCartWithSingleCustomLineItem(IClient client, Func <CartDraft, CartDraft> draftAction, Func <Cart, Task <Cart> > func) { await WithTaxCategory(client, async taxCategory => { var customLineItemDraft = TestingUtility.GetCustomLineItemDraft(taxCategory); var cartDraft = DefaultCartDraftWithCustomLineItem(new CartDraft(), customLineItemDraft); await WithUpdateableAsync(client, cartDraft, draftAction, func); }); }
public static async Task WithCartWithSingleCustomLineItem(IClient client, Func <CartDraft, CartDraft> draftAction, Func <Cart, Task> func) { var address = TestingUtility.GetRandomAddress(); var taxRateDraft = TestingUtility.GetTaxRateDraft(address); await WithTaxCategory(client, draft => DefaultTaxCategoryDraftWithTaxRate(draft, taxRateDraft), async taxCategory => { var customLineItemDraft = TestingUtility.GetCustomLineItemDraft(taxCategory); var cartDraft = DefaultCartDraftWithShippingAddress(new CartDraft(), address); cartDraft = DefaultCartDraftWithCustomLineItem(cartDraft, customLineItemDraft); await WithAsync(client, cartDraft, draftAction, func); }); }