You need to sign in to do that
Don't have an account?

Test Class for SOQL Select Query
public class SOQL_1 { public List<Account> accList {set;get;} //Contructor public SOQL_1(){ accList=[SELECT Name,Phone,Industry,Rating from Account]; } }-----------------------------
Test Class
-----------------------------
@isTest private class Test_Class_3 { @isTest static void accList(){ SOQL_1 s1=new SOQL_1(); Account a = new Account(); a.name='Ravi'; a.phone='12345'; insert a; Account a2=[Select Id,Name,Phone from Account where name='Ravi' LIMIT 1]; System.assert(a2!=null); } }Is this Correct.
Can you change line number 4 in test class :
static testMethod void accList(){
// this is " testMethod" required if test class is running all methods is not going to run only "testMethod" will run.
https://trailhead.salesforce.com/en/modules/apex_testing/units/apex_testing_intro
Thanks,
Harish R.
All Answers
Can you change line number 4 in test class :
static testMethod void accList(){
// this is " testMethod" required if test class is running all methods is not going to run only "testMethod" will run.
https://trailhead.salesforce.com/en/modules/apex_testing/units/apex_testing_intro
Thanks,
Harish R.