• Gerald Spica 5
  • NEWBIE
  • 0 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies
I have created a custom button on account to delete current account record when some conditions are met. When I click on custom button, it calls Apex Page which in turn calls Controller extension to delete the record. I have written below test class to test it. What logic needs to put in system.assertequals to confirm that record is deleted.

@isTest
private class testClass {    
    static Account testAcc  = new Account ();          
        testAcc.Name = 'TestAccount';
         insert testAcc;
     static testMethod void testDel() {
         Test.startTest();
         Test.setCurrentPage(Page.MyVFPage);
        ApexPages.StandardController sc = new ApexPages.StandardController(testAcc);
        MyCtrlExtension TE = new MyCtrlExtension(sc);
        Pagereference pr = TE.FunctionToDeleteRecord();
        System.assertEquals(?, ?);
        Test.stopTest();
    }
   
}