You need to sign in to do that
Don't have an account?
Sabrina Oliveira 3
How can I get a good coverage with my class test?
My class:
My class test:
But I'm receiving 0% of coverage. What am I missing?
public class getAccount { @AuraEnabled public static Account getAcct(Id accountId){ return (Account) Database.query( ' SELECT Name, Observations__c FROM Account WHERE Id =: accountId LIMIT 1 ' )[0]; } @AuraEnabled public static Account saveAcct(Account act){ upsert act; return act; } }
My class test:
public class getAccountTest { @TestSetup static void dataSetup(){ Account acc = new Account(); acc.Name = 'Testing'; acc.Status__c = 'Active'; acc.Observations__c = 'teste'; insert acc; } static testmethod void getAccountTestMethod() { Test.StartTest(); getAccount instancevar = new getAccount(); Test.StopTest(); List<Account> accResult = [SELECT Id FROM Account WHERE Name = 'Testing' ]; System.assertEquals(1, accResult.size() , 'Not created account'); } }
But I'm receiving 0% of coverage. What am I missing?
Try Below Test Class 100% Coverage Please Mark It As Best Answer If It Helps
Thank You!
All Answers
Try Below Test Class 100% Coverage Please Mark It As Best Answer If It Helps
Thank You!
Thank you, it helped me a lot!