public static string GetTokenFromApprovalUrl(List <Links> links) { var resource = new PayPalResourceObject { links = links }; return(resource.GetTokenFromApprovalUrl()); }
public void LinksApprovalUrlTokenTest() { var resource = new PayPalResourceObject { links = GetLinksList() }; var token = resource.GetTokenFromApprovalUrl(); Assert.AreEqual("EC-0JP008296V451950C", token); }
public void LinksNoApprovalUrlEmptyTokenTest() { var resource = new PayPalResourceObject { links = new List <Links> { GetLinks(false) } }; var token = resource.GetTokenFromApprovalUrl(); Assert.IsTrue(string.IsNullOrEmpty(token)); }