Announcement

Collapse
No announcement yet.

Unit Testing custom code

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Unit Testing custom code

    I've written some custom code (based loosely on the donations.cls from the example unmanaged package) and need to write unit tests now that the code is set and ready to deploy. (I know, I know, tests should have been written long ago!)

    Very specifically, I've gotten everything set up in my unit test as I would if I were simply entering information on the form via the gui, but when calling the "Submit()" method, I get an "argument 3 cannot be null" error somewhere in the managed package after the cnpxmlstring.Send_Transaction_api(cnpxmlstring.xml file); call. Any idea of something I might be doing wrong?

    More broadly, how do you suggest we test custom applications that use the PaaS API? Obviously, no callouts are going to happen. Do you handle spoofing a callout, and creating the resulting temporary contact/etc inside your managed package? Or should we just get as far as invoking the callout, and then in a separate test, start the flow with creating our own Temporary Contact?

    Any guidance would be appreciated.

  • #2
    Good day!

    May we have access to your account to review? Please grant us a 7 day access so we can review & discuss with the developers.
    Regards,
    Click & Pledge Support Department

    On Salesforce? Help us by rating our app: Click & Pledge Donor Management on AppExchange

    Join us @ the educational webinars: https://clickandpledge.com/webinars/
    Live Support available Join between 3:00 - 3:30 p.m. ET Monday - Thursday: https://clickandpledge.com/webinars/
    Are you on Salesforce? Join us at the Power of Us Hub: https://powerofus.force.com/0F980000000CjpC

    Comment

    Working...
    X