I want to write unit test to test my Paypal Express Checkout integration.
I have problem in the step where buyer authorize payment in Paypal screen

Is there a way to simulate this action in my test code?
I use sandbox test account
As the interface to PayPal is all controlled by PayPal, why not simply use a mock, and avoid the interaction. This way, any changes there will work, and your code just has to know how to send the first request, and validate the return from PayPal, which is all in the Mock setup.
If you want to do the actual test, then the Paypal Sandbox Instructions for the classic API may be followed.
This method is not suitable for automated unit testing but works great on test that are manually run.
Once you have a Token from SetExpressCheckout, create a new HttpListener that has the same address as the 'ReturnUrl' specified in SetExpressCheckout and wait for a request (synchronously). Point a browser to the PayPal authentication screen with Process.Start and once the payment has been authorized/canceled the user browser will be redirected to the local address of your HttpListener that you can then use to grab the Token & PayerID.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With