Register
Submit a solution
The challenge is finished.

Challenge Overview

Project Overview

We have a Lead Assignment Business Logic already created. We need Apex test classes for validating the code and have 90%+ code coverage.

        1. Lead Assignment has business logic to route Lead to Eligible partner.

        2. Most eligible partner account is one of Round Robin Group Member (Round_Robin_Group_Member__c.Account__c) from Lead Round Robin Group (Lead.Round_Robin_Group__c)

        3. The attached document contains the relationship details.

Implementation

 1.  If Most eligible partner Account Partner_Type__c is not equal to Distributor then Account ID goes into Lead.Assigned_to_Partner__c otherwise in Assigned_to_Distributor__c
 2.  If there is no single group member which have at least one match then Lead. Round_Robin_Assignment_Status__c is updated
 3.  Refer Attached Document for Database Schema and examples.

 

Technical Details

The class contains the logic. You have to write only Apex Test Class for code correctness and coverage.

  1. Lead assignment code can be invoked either by providing Lead instance or by providing Set of lead ids so call code in both ways. Here is code to directly invoke

------------------------------

Set<ID> ids = new Set<ID>();

ids.add('00QV0000004DyqrMAC');

LeadAssignment la = new LeadAssignment(ids); // or pass List of Leads

la.processRRAssignment();

la.saveLeads();

LeadAssignment. updateRRMembers();

--------------------

Technical Acceptance Criteria

1.Apex Unit test class that provide 95%+ code coverage

2. Ensure that Test class cover all sample scenarios as per attached doc.

3. Test classes should create their own data, and only rely on existing data.

4. Have Positive assert to ensure to correct Assigned to Partner or Assigned to Distributor is populated

5. Have Negative asset  to validate that fields are not populated where they should not.

 

 



Final Submission Guidelines

Submission Guidelines

  1. Apex Test class(es).
  2. Detailed Instructions Instructions to run the class
  3. An unmanaged package would be great but not required.

Coding Guidelines

  1. Follow Salesforce Best Practices & Coding Guidelines http://wiki.developerforce.com/page/Apex_Code_Best_Practices

Assets

  1. Zip code which contains source code along with required object metadata. 
  2. Examples and ERD 

Review style

Final Review

Community Review Board

Approval

User Sign-Off

Challenge links

ID: 30043011