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

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.
public class CaseWizardController2 {
    Public String AcctSearch {get;set;}
    Public Account SelectedAccount {get;set;}
    Public PageReference clearSelections(){
        PageReference ClearSelections = new PageReference('/apex/casewizard1');
        return ClearSelections;

    static testMethod void testCaseWizard() { 
        CaseWizardController testWizard = new CaseWizardController();
        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?