• Satheesh1105
  • NEWBIE
  • 10 Points
  • Member since 2020

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 2
    Replies
User-added imagei want to know what are the uses and functionality  of each and every value
this plugin store document method has 3 default parameter, how to define a value for this parameter? if you have any samples please guide me...
I dont know what's the error in this test class
In test Class Line no 4 List acc didn't return any value
Apex class
public with sharing class ShowOppurtunity {
    @AuraEnabled(cacheable=true)
    public static List<Opportunity> showoppurtunity(String AccId) {
        system.debug(AccId);
        List<Opportunity> lstOpportunity = [SELECT Name,StageName,TrackingNumber__c,LeadSource,Description FROM Opportunity WHERE AccountId = :AccId ];
        system.debug(lstOpportunity);
        return lstOpportunity;
    }
}

Apex test Class

@isTest
public with sharing class ShowOppurtunityTest {
    static testmethod void testData(){
        Test.startTest();
        List<Account> acc = [SELECT Id FROM ACCOUNT LIMIT 1];
        system.debug('1');
        system.debug(acc);
        if (acc != null) {
        List<Opportunity> opp =[SELECT Name,StageName,TrackingNumber__c,LeadSource,Description FROM Opportunity WHERE AccountId = :acc[0].Id];
        List<Opportunity> opt = ShowOppurtunity.showoppurtunity(String.valueOf(acc[0].Id));
        system.debug(opp);
        system.debug(opt);
        System.assertEquals(opp,opt);
        Test.stopTest();
        }
    }
}
 
this plugin store document method has 3 default parameter, how to define a value for this parameter? if you have any samples please guide me...
I dont know what's the error in this test class
In test Class Line no 4 List acc didn't return any value
Apex class
public with sharing class ShowOppurtunity {
    @AuraEnabled(cacheable=true)
    public static List<Opportunity> showoppurtunity(String AccId) {
        system.debug(AccId);
        List<Opportunity> lstOpportunity = [SELECT Name,StageName,TrackingNumber__c,LeadSource,Description FROM Opportunity WHERE AccountId = :AccId ];
        system.debug(lstOpportunity);
        return lstOpportunity;
    }
}

Apex test Class

@isTest
public with sharing class ShowOppurtunityTest {
    static testmethod void testData(){
        Test.startTest();
        List<Account> acc = [SELECT Id FROM ACCOUNT LIMIT 1];
        system.debug('1');
        system.debug(acc);
        if (acc != null) {
        List<Opportunity> opp =[SELECT Name,StageName,TrackingNumber__c,LeadSource,Description FROM Opportunity WHERE AccountId = :acc[0].Id];
        List<Opportunity> opt = ShowOppurtunity.showoppurtunity(String.valueOf(acc[0].Id));
        system.debug(opp);
        system.debug(opt);
        System.assertEquals(opp,opt);
        Test.stopTest();
        }
    }
}