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
SalesforceUser11SalesforceUser11 

increase code coverage. now 37%

Hi,

I am writing a test class. I have covered 3 lines bt I am not getting how to cover remainig. Can anyoe suggest

Class:
global class ACN_ExceptionDebugProvider implements ACN_ExceptionProviderService {
    global ACN_ExceptionLibrary.ExceptionResponse ProcessException (ACN_ExceptionLibrary.ExceptionRequest request) {
        ACN_ExceptionLibrary.ExceptionResponse response = new ACN_ExceptionLibrary.ExceptionResponse();
        response.Id = request.Id;
        response.Name = request.Name;
        response.DataProviderName = request.DataProviderName;
        response.ExceptionMap = request.ExceptionMap;
        response.ExtendedProperties = request.ExtendedProperties;
        
        System.debug(request);
        
        return response;
    }
}

Test Class: Need coverage from 3rd line 

@IsTest
private class ACN_ExceptionDebugProviderTest {

@testSetup
private static void testSetup() {

}

@isTest
private static void testProcessException() {
try {
    Test.startTest();
    new ACN_ExceptionDebugProvider().ProcessException(null);
    Test.stopTest();
} catch(Exception e) {

}
}
}

 
Raj VakatiRaj Vakati
try this code .. set the ExceptionRequest  properties as show below 
 
@IsTest
private class ACN_ExceptionDebugProviderTest {

@testSetup
private static void testSetup() {

}

@isTest
private static void testProcessException() {
try {
    Test.startTest();
	
	ExceptionRequest  er = new ExceptionRequest ();
	er.Name='Test';
	er.DataProviderName='Test';
	er.ExtendedProperties='Test';
	er.ExceptionMap='Test';
	
    new ACN_ExceptionDebugProvider().ProcessException(er);

    Test.stopTest();
} catch(Exception e) {

}
}
}