+ 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!!