0

like title says ,I'm trying to write a test class for the following constructor , but I'm getting Constructor not defined error. My method is :

public class AccountPlanSumLightningController {
 public class tmpOIResultNode {

        public Decimal x;
        
        public Decimal y;
        
        public String hoverText;
        
        public String currencyCode;

        tmpOIResultNode (Decimal ACNAbilityToImpact, Decimal PotentialValue, String hoverText, String 
          currCode) {
            this.x = ACNAbilityToImpact;
            this.y = PotentialValue;
            this.hoverText = hoverText;
            this.currencyCode = currCode;
        }
    }
}

I was trying tu use in

AccountPlanSumLightningController.tmpOIResultNode testOI = new AccountPlanSumLightningController.tmpOIResultNode(0.10,0.20,'test','010'); 

in test method , but didn't work, any ideas?

1 Answer 1

1

The constructor is private, the default access level for classes, methods, and properties, so you cannot call it outside the class. Add @TestVisible or make the constructor public.

    public tmpOIResultNode (Decimal ACNAbilityToImpact, Decimal PotentialValue, String hoverText, String 

Or

    @TestVisible tmpOIResultNode (Decimal ACNAbilityToImpact, Decimal PotentialValue, String hoverText, String 
1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.