Skip to content

Public Properties #54

Discussion options

You must be logged in to vote

We don't handle mocked public attributes/properties directly.
The framework is focused on testing decoupled apex classes that use an apex interface on top of the collaborator implementation and stub its behavior using only the interface layer.

This means that if you have a dependency to another class public attribute that you want to mock then you should either:

  • introduce getters methods, setters methods or both and mock its results with apex mockery
  • create test that involves multiple dependant classes at a upper level in your design

If you can, feel free to share code samples so that we can discuss on your concrete use case

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@mikeabackhouse
Comment options

Answer selected by mikeabackhouse
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants