Could anyone show me what a test for a class like this would look like? Example:
I am totally lost here. Thanks, Johnpublic class BuyerAlert{
public List<Buyer__c> listOfBuyer {get; set;}
public Buyer__c Buyer {get;set;}
public BuyerAlert() {
listOfBuyer = [Select id, name, Raw_Conversion__c, Call_Dur__c, Sold_Calls_Today__c from Buyer__c WHERE Buyer_Call_Handling_Alert__c = TRUE ORDER BY Sold_Calls_Today__c DESC];
}
}
2 respuestas
Hello Jhon,Use this code :@isTest(seeAllData = false)public class BuyerAlertTest{ // Unit test Method static testmethod void UnitTest() { //Create your buyer record with required field //Buyer__c b = new Buyer__c(Buyer_Call_Handling_Alert__c = true); //insert b; test.startTest(); BuyerAlert ba = new BuyerAlert(); test.stopTest(); } }If this answers your question then hit Like and mark it as solution!