A developer created this Apex trigger that calls MyClass,myStartmethod:
The developer creates a test method that calls MyClase,myStartmethod directly, resulting in 81% overall code coverage.
What happens wtier the developer tries to deploy the ... and two classes to production, assuming no other code exists?
A. The deployment fails because the Apr- MgQM has no code coverage.
B. The deployment tails because no assertions mett made in the lest method.
C. The deployment passes became the Apex code has the requited 75% code coverage.
D. The deployment passes because both classes and the trigger were included ki the deployment.
A. The deployment fails because the Apr- MgQM has no code coverage.
Explanation:
Even though the test method directly calls MyClass.myStartMethod() and achieves 81% overall code coverage, the Apex trigger itself has no explicit coverage, meaning the deployment will fail.
Key Considerations for Deployment:
✅ Salesforce requires at least 75% code coverage for Apex classes and triggers.
✅ Triggers must have their own coverage—calling a method indirectly does not cover the trigger execution.
✅ Test methods must explicitly invoke the trigger logic to count toward the trigger's coverage.