You need to sign in to do that
Don't have an account?
BDArnz
The code itself works fine. I get no errors running the test method. The System.AssertEquals doesn't bomb out but the results tell me I have no coverage for any of the lines in the ClearSelections method.
How do I test a PageReference Method?
I'm working to write tests for a controller and I can't seem to get coverage for a method that returns a PageReference.
Code:
public class CaseWizardController2 { Public String AcctSearch {get;set;} Public Account SelectedAccount {get;set;} Public PageReference clearSelections(){ PageReference ClearSelections = new PageReference('/apex/casewizard1'); ClearSelections.setRedirect(true); return ClearSelections; } static testMethod void testCaseWizard() { CaseWizardController testWizard = new CaseWizardController(); testWizard.clearSelections(); System.AssertEquals('/apex/casewizard1',testWizard.ClearSelections().getURL()); system.debug(logginglevel.INFO, 'Test Method>>>' + testWizard.ClearSelections().getURl()); } }
The code itself works fine. I get no errors running the test method. The System.AssertEquals doesn't bomb out but the results tell me I have no coverage for any of the lines in the ClearSelections method.
Does anyone know what I'm doing wrong here?