Find your content:

Search form

You are here

Creating test records for visualforce controller

 
Share

So I have a visualforce page that I am currently trying to write test code for. I have everything setup, and there really is not much to test in my custom controller other than some series of if statements on certain fields (mostly picklists) in my custom object. Obviously, there are several options for all these picklists, so I was wondering is there any way to create records to be tested that have random field values (so that I could probably cover all my options if I just had a large list of records with random field values)? I am hoping not to create records one by one so that every option in every picklist is covered (i.e. all my if statements get tested).


Attribution to: Z_wizard18
This content is remixed from stackoverflow or stackexchange. Please visit https://salesforce.stackexchange.com/questions/34394

My Block Status

My Block Content