You need to sign in to do that
Don't have an account?

Controller Test Coverage
I am new to writing test coverage and thought that I was starting with a simple code snippet. What would the test coverage look like for the following code?
public class webinarController { private List<Podcast_SD__c> podcasts; public List<Podcast_SD__c> getpodcasts() { podcasts = [Select Name, Link__c, Featured__c, Link_Name__c, Description__c, Episode_Number__c from Podcast_SD__c order by Episode_Number__c desc]; return podcasts; } private List<webinar__c> webinars; public List<webinar__c> getwebinars() { webinars = [Select Name, Link__c, Featured__c, Link_Type__c, Title__c, Type__c, Year_QTR__c from Webinar__c order by Name asc]; return webinars; }
Also, please take a look on below links so you can learn better how to write a test class. It contains positive, negetive test cases etc.. My TestClass is very basic.
https://www.salesforce.com/us/developer/docs/apexcode/Content/apex_qs_test.htm
https://www.salesforce.com/us/developer/docs/apexcode/Content/apex_testing_best_practices.htm
https://developer.salesforce.com/page/An_Introduction_to_Apex_Code_Test_Methods
Simple example is like
Also you should add Count properies for Webinar__c and Episode_Number__c to avoid getting out of right bound of data.