• uday kiran 216
  • NEWBIE
  • 0 Points
  • Member since 2020

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 0
    Replies
Test.starttest();
List<Database.DeleteResult> result2 = Database.delete(oppList, false);
LogDAO.logDatabaseError(result2, 'LagDAO:deleteResult');
Test.stopTest();

system.assertequals(true, opp.Id !=null); 
String errMsg = 'Your attempt to delete Test Opp could not be completed beacuse it is associated with the follow opportunity information.'; 
System.assert(([SELECT Details__c from Log__c Where ExcceptionType__c = 'Delete_Failed' LIMIT 1]. Details__c).contains(errMsg));
Test.starttest();
List<Database.DeleteResult> result2 = Database.delete(oppList, false);
LogDAO.logDatabaseError(result2, 'LagDAO:deleteResult');
Test.stopTest();

system.assertequals(true, opp.Id !=null); 
String errMsg = 'Your attempt to delete Test Opp could not be completed beacuse it is associated with the follow opportunity information.'; 
System.assert(([SELECT Details__c from Log__c Where ExcceptionType__c = 'Delete_Failed' LIMIT 1]. Details__c).contains(errMsg));