You need to sign in to do that
Don't have an account?
Talant
What is wrong with this test class? It is not covering, any suggestions?
@isTest public class PropRentTotalSumTEST { @isTest static void testFeeCalculation() { Property__c prop = new Property__c(); prop.Name = 'Test'; prop.Monthly_Rate__c = 0; insert prop; List<Fee__c> fees = new List<Fee__c>(); Fee__c fees1=new Fee__c(); fees1.Name = 'Realtor'; fees1.Cost__c = 1000; fees1.Property__c = prop.Id; Fee__c fees2=new Fee__c(); fees2.Name = 'Lawyer'; fees2.Cost__c = 2000; fees2.Property__c = prop.Id; fees.add(fees1); fees.add(fees2); Test.startTest(); insert fees; delete fees; Test.stopTest(); Property__c propsProperty = [SELECT Monthly_Rate__c FROM Property__c WHERE Id =: prop.Id]; System.assertEquals(0, propsProperty.Monthly_Rate__c); } }
Hi Talant,
I think you need to call your controller class and pass list into methods/assign values to fields.
ExampleClass exampleInstance = new ExampleClass();
exampleInstance.fields = somevalues;
exampleInstance.method(fees);
Thanks,
Sucharita