function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
TalantTalant 

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);

    }
}

 
SUCHARITA MONDALSUCHARITA MONDAL


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

 

TalantTalant
Hi Sucharita, thanks for the suggestion and code sent to me, I will have a look at it later.
hsd ssdshsd ssds
it's possible that legal investigations are too costly and complicated for private lawyers (https://syedblogs.com/). Hence, it makes sense for courts of law to perform these tasks themselves.