paypale/identity_test.go
2016-01-18 15:42:42 +07:00

22 lines
618 B
Go

package paypalsdk
import "testing"
func TestGrantNewAccessTokenFromAuthCode(t *testing.T) {
c, _ := NewClient(testClientID, testSecret, APIBaseSandBox)
token, _ := c.GrantNewAccessTokenFromAuthCode("123", "http://example.com/myapp/return.php")
if token.Token != "" {
t.Errorf("Empty token must be returned for invalid code")
}
}
func TestGrantNewAccessTokenFromRefreshToken(t *testing.T) {
c, _ := NewClient(testClientID, testSecret, APIBaseSandBox)
token, _ := c.GrantNewAccessTokenFromRefreshToken("123")
if token.Token != "" {
t.Errorf("Empty token must be returned for invalid refresh token")
}
}