public async Task RemoveDefaultEntity_RemovesDefaultEntity() { var target = new CheckoutDataRepository(SetupAddressService(), SetupPaymentMethodService(), null); await target.SetDefaultPaymentMethodAsync("1"); var defaultShippingAddress = await target.GetDefaultShippingAddressAsync(); var defaultBillingAddress = await target.GetDefaultBillingAddressAsync(); var defaultPaymentMethod = await target.GetDefaultPaymentMethodAsync(); Assert.IsNotNull(defaultShippingAddress); Assert.IsNotNull(defaultBillingAddress); Assert.IsNotNull(defaultPaymentMethod); await target.RemoveDefaultShippingAddressAsync(); await target.RemoveDefaultBillingAddressAsync(); await target.RemoveDefaultPaymentMethodAsync(); defaultShippingAddress = await target.GetDefaultShippingAddressAsync(); defaultBillingAddress = await target.GetDefaultBillingAddressAsync(); defaultPaymentMethod = await target.GetDefaultPaymentMethodAsync(); Assert.IsNull(defaultShippingAddress); Assert.IsNull(defaultBillingAddress); Assert.IsNull(defaultPaymentMethod); }
public async Task GetDefaultValues_Returns_DefaultValues() { var target = new CheckoutDataRepository(SetupAddressService(), SetupPaymentMethodService(), null); var defaultShippingAddress = await target.GetDefaultShippingAddressAsync(); var defaultBilingAddress = await target.GetDefaultBillingAddressAsync(); var defaultPaymentMethod = await target.GetDefaultPaymentMethodAsync(); Assert.IsNotNull(defaultShippingAddress); Assert.AreEqual(defaultShippingAddress.Id, "3"); Assert.IsNotNull(defaultBilingAddress); Assert.AreEqual(defaultBilingAddress.Id, "2"); Assert.IsNull(defaultPaymentMethod); }