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
eshh31eshh31 

Could someone help me write a test class for this bit of class

public class QuoteQuickActionController {

    @auraEnabled
    public static opportunity getopportunity(string oppId){
        Opportunity opp=[Select id,accountId,pricebook2Id from opportunity where id =: oppId];
                         return opp;
    }
}
Best Answer chosen by eshh31
AmitSoniAmitSoni
@isTest
public class QuoteQuickActionControllerTest {

     @isTest
     static void test_methos() {        
        Test.startTest();
        Opportunity opp = new Opportunity(Name='test opportunity', StageName='Close Won', CloseDate=date.today());
            insert opp;
        opportunity opp1 = QuoteQuickActionController.getopportunity(opp.Id); 
        Test.stopTest();
    }
}
Hope this will be helpful!!