You need to sign in to do that
Don't have an account?
nr123
Test Code for simple class returning SOQL Query Results
I have a very small class that queries 2 objects and displays resullts on a visualforce page. I am having trouble writing the test for this class. Any suggestions would be greatly appreciated. I am getting 0 coverage right now. This is the class that I am trying to test:
public with sharing class ReassignController { //query for cases that are unassigned public List<Opportunity> getUCases() { return [SELECT Level_1_Case_Number__c, Name, Id, Worksite_Core__c, Received_Date_Case__c, CIS_Rep__c FROM Opportunity WHERE CIS_Rep__c = null AND Level_1_Case_Number__c !=null AND Received_Date_Case__c > :date.parse('1/1/2011') ]; } //query for Amendments that are unassigned public List<Amendment__c> getUAmends(){ return [SELECT Level_1__c, Name, CIS__c, Id,AmendmentInstructions__c, Requested_Date__c FROM Amendment__c WHERE CIS__c='' AND Completed_Date__c = null AND DeclinedDate__c=null AND Requested_Date__c > :date.parse('1/1/2011')]; } }
Thanks.
Hi,
Please follow the below steps for Test coverage.
Hope this works for you.
All Answers
Hi,
Please follow the below steps for Test coverage.
Hope this works for you.
Thank you! That is what I needed.
This is my Test Class with 100% coverage: