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
johnn devjohnn dev 

how to put a map on the test calss

how to put a map on the test calss
mukesh guptamukesh gupta
Hi johnn,

Please follow below code:-
 
@isTest
private class Task14_Test {
    
    @isTest static void beforeupdateTest() {
        Map<id,Account> oldmap = new Map<id,Account>();
        Map<id,Account> newmap = new Map<id,Account>();
        Account acct = new Account(Name='Test Account',phone='1111111');
        insert acct;
        oldmap.put(acct.id, acct); //// here we are using old map to store the value
        
        contact con = new contact();
        con.accountid = acct.id;
        con.LastName = 'TestContact';
        insert con;
        
        
        // Perform test
        Test.startTest();
            acct.Phone = '2222222';
            update acct;        
            newmap.put(acct.id, acct);  //// here we are using map to store the value
            
            Task14.beforeupdate(oldmap,newmap);
        Test.stopTest();        
        
        system.assertEquals('2222222', acct.Phone);
    }
    
}



if you need any assistanse, Please let me know!!

Kindly mark my solution as the best answer if it helps you.

Thanks
Mukesh

 
Suzanne ShanksSuzanne Shanks
When you connect the brother printer to the wireless network. It will save the settings. Therefore, whenever you restart the printer and it will be automatically connected to that network.

However, sometimes Brother printer won't connect to wifi. If the user attempts to connect the printer through an unmanaged wireless connection. It says, cannot connect to the network, or the Wi-Fi setup failed error.