You need to sign in to do that
Don't have an account?
Sukriti Sharma
Write a test class for an Apex Class
I wrote an Apex Class to create an account. The user is giving the Account Name as input. am reading the input using JS and passing the parameter for Apex Class. I have to write a Test Class for the same. Please help me with it.
public with sharing class AddAccount { @AuraEnabled public static Account insertNewAccount(String accountName){ Account newAccount = new Account(); newAccount.Name = accountName; try{ insert newAccount; return newAccount; } catch(Exception d){ return null; } } }
Try Below Code 100%Coverage Please Mark It As Best Answer If It Helps
Thank You!
All Answers
Try Below Code 100%Coverage Please Mark It As Best Answer If It Helps
Thank You!
try with below code.
Thanks!!