Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: update UnitOfWork + Mocker #71

Merged
merged 2 commits into from
Jan 2, 2025
Merged

feat: update UnitOfWork + Mocker #71

merged 2 commits into from
Jan 2, 2025

Conversation

nkskaare
Copy link
Contributor

@nkskaare nkskaare commented Jan 2, 2025

Summary

This pull request introduces enhancements to the Mocker and AssertionBuilder classes, adding new functionalities for method stubbing and assertion in the Apex testing framework. The most important changes include the addition of the AssertionBuilder class, modifications to the Mocker class to support more detailed stubbing and assertion, and updates to the UnitOfWorkTest class to reflect these changes.

New Features:

  • src/apex/utils/classes/UnitOfWork.cls: Move dmlhandler and key generation responsibility to the transaction itself. Allows for different dmlhandlers for unique transactions and also gives the possibility to add transactions to one another.

  • src/apex/utils/classes/AssertionBuilder.cls: Introduced the AssertionBuilder class to facilitate the creation of method call assertions with various configurations, such as argument-specific assertions and call count assertions.

  • src/apex/utils/classes/Mocker.cls: Added support for argument-specific method stubbing and assertion, including new methods like stub, assertMethodCalled, and updated the MockRegistry to handle argument-specific keys. [1] [2] [3] [4] [5] [6] [7] [8]

Updates to Existing Code:

@nkskaare nkskaare merged commit 98ea250 into main Jan 2, 2025
0 of 2 checks passed
@nkskaare nkskaare deleted the feat/uow branch January 2, 2025 12:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant