brandon-conover/salesforcetests icon
public
Published on 3/10/2025
Salesforce Unit Tests

Prompts
Salesforce Unit Tests
Unit Tests
  - name: test
    description: Unit test a function
    prompt: |
      Please write a complete suite of unit tests for this Salesforce function. You should:
        - Use the Salesforce SObject mocking framework
        - Create test methods covering all public methods
        - Implement tests for:
          * Positive scenarios
          * Negative scenarios
          * Bulk processing
          * Different user contexts
        - Aim for 90%+ code coverage
        - Use System.assert methods for validation
        - Include meaningful test method names that describe the scenario
        - Test all branches of conditional logic
        - Verify error handling and exception scenarios
        - Use TestDataFactory for efficient test data creation