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
Meenakshi1212Meenakshi1212 

how to write test class

Hi All,

 

I ma new to salesforce so i don't know how to write test class.

 

can you please tell em how to write test class for below apex class

 

public class AHAccountWrapper{
  public AHAccountWrapper(Boolean radioButton, Account account){
    this.radioButton = radioButton;
    this.account = account;
  }
  public Boolean radioButton{get;set;}
  public Account account{get;set;}
}
TrUs3Uw3TrUs3Uw3
@isTest
private class AHAccountWrapperTest {
	@isTest
    static void myUnitTest() {
        AHAccountWrapper w = new AHAccountWrapper(true, new Account());
    }
}

 

But my suggestion to you is to read Testing Apex

 

Vinit_KumarVinit_Kumar

Meenakshi,

 

Please try below code:-

 

@isTest
private class AHAccountWrapperTest {

static void myUnitTest() {
Account acc = new Account();
AHAccountWrapper w = new AHAccountWrapper(true, acc);
}
}