function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
laurent.greiwelding1.3974669707216677E12laurent.greiwelding1.3974669707216677E12 

Help for testing my apex class

Hy evrybody,

Can you help me for make the test for this class :

public with sharing class DispatcherContactNewController {

    public DispatcherContactNewController(ApexPages.StandardController controller) {
        this.controller = controller;
    }

    public PageReference getRedir() {

        PageReference newPage;
        
         String c = ApexPages.currentPage().getParameters().get('RecordType');
         String a = ApexPages.currentPage().getParameters().get('accid');
                   
        if (C == '012F0000000yGsq') {
            newPage = Page.Visual_contact;
            newPage.getParameters().put('RecordType', c);          
            newPage.getParameters().put('accid', a);
           
            return newPage.setRedirect(true);           
                   
        } else {
           
            newPage = new PageReference('/003/e');
            newPage.getParameters().put('accid', a);
            newPage.getParameters().put('RecordType', c);
            newPage.getParameters().put('nooverride', '1');
            return newPage.setRedirect(true);
        }

   
   
    }

    public final ApexPages.StandardController controller;
   
   

}

I'm lost with the test
Vinit_KumarVinit_Kumar
Have you written any Test class for this class where we can help you ??

If so,please post I would try to help you :)
laurent.greiwelding1.3974669707216677E12laurent.greiwelding1.3974669707216677E12
I have not written test class, i don't know how. Can you help me ?
Vinit_KumarVinit_Kumar
I would suggest to go through the below links for writing Apex Tests :-

https://www.salesforce.com/us/developer/docs/pages/Content/pages_controller_error_handling.htm

http://wiki.developerforce.com/page/An_Introduction_to_Apex_Code_Test_Methods