Here I have @Auraenabled
apex class I'm trying to write a test class but it's throwing an error like below
Static method cannot be referenced from a non-static context: List<AuraSampleController.AccountDetails> AuraSampleController.france(String, String)
Method does not exist or incorrect signature: void saveBatchDet(Integer, String, String) from the type AuraSampleController`
My Apex is like below:
public class AuraSampleController{
public static String language {get;set;}
Public static string NicoPinFce{get;set;}
public static List<AccountDetails> AccountDetailsList {get;set;}
@AuraEnabled
public static List<AccountDetails> france(string NicoPinFce,string QuoteID){
}
@AuraEnabled
public static list<Quote_Line_Item__c> SaveQlis(List<Quote_Line_Item__c> QliList){
}
@AuraEnabled
public static list<batch__c> SaveBatchDet(integer QliRowNum,list<Batch__c> Bt,map<integer,list<batch__c>> Rowmap){
}
}
Test class:
@isTest
public class testAuraSampleController {
@isTest
Public static void aurasamplemethod(){
List<String> AccountDetailsList=new List<string>();
Id QuoteId;
Test.StartTest();
auraSampleController testAccPlan= new auraSampleController();
testAccPlan.france(frab,q3.Id); //first error line I'm getting
testAccPlan.saveQlis(QliList); // first error line this one also
testAccPlan.saveBatchDet(5,'bat','Rowmap');//second error is on this
Test.StopTest();
}
}