Skip to main content
1 of 3
Eric
  • 54.4k
  • 11
  • 104
  • 196

An alternate approach is to just not annotate it and test it via the methods that use it.

It's private for a reason so why open it up to test methods.

You can create scenarios to test you logic for the methods that call it.

Use TestVisible sparingly and if that cannot be done question why it is private.

In your case just call verifyDate with different dates and assert the returned values are correct. Use different combinations to test the varying outcomes. Also test null dates to ensure error handling/protection is appropriate

Eric
  • 54.4k
  • 11
  • 104
  • 196