#suzz1911
1 messages · Page 1 of 1 (latest)
Hi! What exactly Stripe-related do you want to test?
i've created apis for checkout-session, customer-portal get and post apis
i want to create unti tests for them. for that i want to know how can i moq the stipe
Are you using the .NET Stripe SDK?
stripe.net nuget
private readonly Mock<IStripeClient> _client;
new Mock<CustomerService>(_client);
etc
var customerList = new Mock<StripeList<Customer>>();
or how can i moq the stripe, so that the unit test will work
You can call the Test mode API in your tests, that's fine
so this will correct response
Mock<StripeList<Customer>> customerList = new Mock<StripeList<Customer>>();
customerList.Data.Add(new Customer { Id = "cus_test" });
Cannot resolve symbol 'Data'
this is error when i tried ti use like this
I don't know how .NET mocks work, unfortunately. But as I said, you can call real Stripe API in your tests, and avoid mocks.
ok