+ Start a Discussion
Cameron SeitzCameron Seitz 

In a System.AssertEquals() is it possible to have the expected outcome just greater than 0?

in a System.AssertEquals() is it possible to have some kind of logic in the expected outcome? For example, if I just need the expected outcome to be greater than 0.
 
System.AssertEquals(database.countquery('SELECT ts2__Placement__r.TCEDaudit__c FROM Placement'), > 1 );

 
Best Answer chosen by Cameron Seitz
Alain CabonAlain Cabon
Hi,

System.Assert instead of System.AssertEquals
 
System.Assert([select count() from account] > 0,'Count must be positive');

System.Assert((Decimal)([select sum(amount) total from opportunity][0]).get('total') > 1000,'Amount must be greater than 1000');