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
Reddy ChandraReddy Chandra 

How to write test class for below class

Hi 
public class DealVariables {
   public static boolean approvesent=false;
    public static boolean rejectsent=false;   
  
}

thanks in advance

regards
Reddy
Best Answer chosen by Reddy Chandra
Henry Akpala 10Henry Akpala 10
@IsTest
private class DealVariablesTest {
    static testMethod void testScenario() {
        DealVariables d = new DealVariables();
        boolean ap = DealVariables.approvesent;
        boolean re = DealVariables.rejectsent;   
    }

}

 

All Answers

v varaprasadv varaprasad
Hi Chandra,

Please use below code : 
@isTest
public class DealVariables_Test {    
  static testMethod void testInsertAccount(){
        DealVariables.approvesent = false;
        DealVariables.rejectsent  = false;
        
    }

}
Static variables can directly call with class name.

Hope this helps.
please let me know incase of any further assistance.

If it helps you please mark it as Best Answer.

Thanks
Varaprasad
 
Henry Akpala 10Henry Akpala 10
@IsTest
private class DealVariablesTest {
    static testMethod void testScenario() {
        DealVariables d = new DealVariables();
        boolean ap = DealVariables.approvesent;
        boolean re = DealVariables.rejectsent;   
    }

}

 
This was selected as the best answer