You need to sign in to do that
Don't have an account?
Dolgoldy
Want help here
Hi all, help me to write test class
public class myjob { @AuraEnabled(cacheable=true) Public static List<Job_Requirement__c> myservice() { list<Job_Requirement__c> lstjob = [select id, Name, Service_Name__c, Type__c from Job_Requirement__c where Type__c='Standard']; return lstjob; } @AuraEnabled(cacheable=true) Public static List<Job_Requirement__c> myservicegeneral() { list<Job_Requirement__c> lstjobgeneral = [select id, Name, Service_Name__c, Type__c from Job_Requirement__c where Type__c='Specialty']; return lstjobgeneral; } @AuraEnabled(cacheable=true) Public static List<Job_Requirement__c> myservicinteriror() { list<Job_Requirement__c> lstjobinteriror = [select id, Name, Service_Name__c, Type__c from Job_Requirement__c where Type__c='Custom Named']; return lstjobinteriror; } @AuraEnabled(cacheable=false) Public static List<Job_Requirement__c> getStandardWorkOrders() { list<Job_Requirement__c> lstjob = [select id, Name, Service_Name__c, Type__c from Job_Requirement__c ]; //Type__c='Standard']; return lstjob; } Public static List<Job_Requirement__c> getSpecialityWokOrders() { list<Job_Requirement__c> lstjobgeneral = [select id, Name, Service_Name__c, Type__c from Job_Requirement__c where Type__c='Specialty']; return lstjobgeneral; } }
Please use below code:-
if you need any assistanse, Please let me know!!
Kindly mark my solution as the best answer if it helps you.
Thanks
Mukesh
All Answers
Please use below code:-
if you need any assistanse, Please let me know!!
Kindly mark my solution as the best answer if it helps you.
Thanks
Mukesh
Thank u this help me lot
can u help me in this getting error as Variable does not exist: id
@isTest
public class GetProjectJobRequirementJunctionTest {
@isTest
static void setupTest1(){
ProjectJobRequirementJunction__c objJob1 = new ProjectJobRequirementJunction__c();
objJob1.name = 'test';
//objJob1.Work_Name__c = 'Test service';
objJob1.Schedule_Status__c = 'standard';
objjob1.Project__c='test project';
insert objjob1;
Test.startTest();
list<ProjectJobRequirementJunction__c> opId = [SELECT Id,name FROM ProjectJobRequirementJunction__c ];
// mstResult = RFPDateController.fetchDates(opId);
GetProjectJobRequirementJunction_ctlr.getRecords(opid.id);
GetProjectJobRequirementJunction_ctlr.fetchRecords(opid.id);
Test.stopTest();
}
@isTest
static void setupTest2(){
Contractor__c objcon=new Contractor__c();
objcon.name='test1';
objcon.Link__c='test contractor';
Test.startTest();
list< Contractor__c> opId = [SELECT Id,name FROM Contractor__c ];
GetProjectJobRequirementJunction_ctlr.getContractorRecords();
GetProjectJobRequirementJunction_ctlr.getLinkFromContractorRecords(opid.Id);
Test.stopTest();
}
@isTest
static void setupTest3(){
Project_Work_Order_Line_Item__c objcon=new Project_Work_Order_Line_Item__c();
// objcon.name='test1';
objcon.QTY__c=101;
objcon.Piece_Rate_QTY__c=100;
objcon.Materials_QTY__c =102;
objcon.Rate__c=5;
objcon.Hourly__c=true;
Test.startTest();
list< Project_Work_Order_Line_Item__c> opId = [SELECT Id,name FROM Project_Work_Order_Line_Item__c ];
GetProjectJobRequirementJunction_ctlr.getLineItemsold(opid.id);
GetProjectJobRequirementJunction_ctlr.getLineItems(opid.Id);
Test.stopTest();
}
}
Please use below code:-
Regards
Mukesh