0
public DiscoverOrg_ConflictResolver(ApexPages.StandardController controller) 
    {
        LoadPage();
        // Research request start
        reportSubmited = '';
        reportNotSubmited = '';
        testing = false;
        // Research request Ends
    }
3
  • Can you post what you have tried so far and where the issue you are facing?
    – highfive
    May 4, 2016 at 6:53
  • You don't need to cover (or test at all) the standard controller. That is Salesforce code. You only need to test your own. code.
    – mkorman
    May 4, 2016 at 7:09
  • What is your question ? May 4, 2016 at 10:36

1 Answer 1

4

This is how to create an instance of your controller extension and test it (here assuming Contact but use whatever type you are working with):

@IsTest
private class DiscoverOrg_ConflictResolverTest {

    @IsTest
    static void test() {

        Contact c = new Contact(LastName = 'Smith');
        insert c;

        DiscoverOrg_ConflictResolver controller = new DiscoverOrg_ConflictResolver(
                new ApexPages.StandardController(c)
                );

        // Add asserts for intitial state of controller
        // Add controller method/property calls and asserts
    }
}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .