+ Start a Discussion
datadaddydatadaddy 

System.AssertEquals for a Visualforce PAge message

I am writing a test method for a Visualforce extension class. One of the scenios I wantt oconfirm that a certain error message appears. The message is below. I am not sure in my System. AssertEquals parameters, what I would put? Please adivce. Thanks.

 

     String sMsg = 'There are not vaild Bookings. Please contact the System Admin';
           ApexPages.Message msg = new ApexPages.Message(ApexPages.Severity.INFO, sMsg);
           ApexPages.addMessage(msg);
        

santoshgoresantoshgore

try out using ApexPages hasMessages or getMessages methods.

Devendra@SFDCDevendra@SFDC

Hi,

 

Santoshgore89 is correct!!

 

Look at  this example for a reference.

 

Thanks,

Devendra