We're back with another Q & A with Matt K, and today's question comes from the Trailblazer Community!
In the #Apex group, a Trailblazer asked for test coverage on some of their code! They shared a snippet of their Apex which sends an email using a flow and Matt walks us through formulating the test class and test coverage (for free!) - and running the show solo this time!
The solution this time not only involved reverse-engineering the existing code, creating a matching object and visualforce page, solving some inherited issues from the code pasted into the Trailblazer Community, showing us how to insert test data, navigating limits and restrictions in test coverage classes and methods, and more!
Matt then goes further and, in line with test coverage best practices, walks us through creating Assertions to notify us (and future devs) about failures in execution to make future troubleshooting even easier!
And then he re-factors the code to make it all fall in line with Apex best practices!
This is a terrific example of how a dev, new to a project or org, has to approach troubleshooting an issue in the existing codebase or automations / processes!
Link to Question (and solution): https://trailhead.salesforce.com/trai...
Link to Blog (and solution): TBA
Link to submit your own questions to Q & A with Matt K!: https://go.mkp.dev/Q&A
(of course you're also always welcome to leave them in the comments)
As always, thanks for watching and please be sure to like and subscribe!
コメント