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
Kasia Wojewodzka 7Kasia Wojewodzka 7 

Test Class for Process Builder: Error MessageSystem.AssertException: Assertion Failed

Dear Community

Hope you can assit me with resoloving the error messge for the test class

I want to confim that inserted custom Object for test account (where Account Shipping Code is GB) has a correct Email Address updated under custom field: ISAM team to be notified . I am getting error 
Error MessageSystem.AssertException: Assertion Failed: Expected: ISAMS-UK@idexx.com, Actual: isams-uk@idexx.com
Stack TraceClass.Test_PB_CMFUPdateISAMEmail.testCountryGB: line 35, column 1

Would you know how this should fixed? 
@isTest
public class Test_PB_CMFUPdateISAMEmail {
   //tests the following: 
   //Process Builder : "EU - EMEA CMF Updates"
   //test is only for 1 Action update field on CMF Form  ISAM team to be notified based on account country 
   
   
    @TestSetup static void setup() {
        //Create an Account
        Account testAccount = new Account(
          RecordTypeId = Schema.SObjectType.Account.getRecordTypeInfosByName().get('Customer').getRecordTypeId(),
            Name = 'Test Account',
            SAP_Customer_Number__c ='0012345678',
            ShippingCountryCode =  'GB'
      );
        insert testAccount;
        
        //Create Cusotmer Master fiele Update record with 1 of the countires GB
        Customer_Master_File_Update__c testCMF = new Customer_Master_File_Update__c(
            Name = 'test',
            RecordTypeId = Schema.SObjectType.Customer_Master_File_Update__c.getRecordTypeInfosByName().get('Change of Fiscal Data').getRecordTypeId(),
            Account_To_Update__c = testAccount.Id
           
        );
        insert testCMF;
       
               
  }

    //Tests condition Customer Master  file Account Shipping Country = 'GB'
    @isTest
    static void testCountryGB(){
        Test.startTest();
          Customer_Master_File_Update__c testCMF = [SELECT Id, ISAM_team_to_be_notified__c FROM Customer_Master_File_Update__c];   
          system.assertEquals('ISAMS-UK@idexx.com', testCMF.ISAM_team_to_be_notified__c );          
        Test.stopTest();  
    }
}





   
Best Answer chosen by Kasia Wojewodzka 7
SwethaSwetha (Salesforce Developers) 
HI Kasia
This appears to be an issue with case sensitivity failing at system.assertequals method.

Can you try the approach mentioned in https://salesforce.stackexchange.com/questions/58683/apex-assert-vs-assertequals/58685 to see if it fixes the issue.
 
Hope this helps you. Please mark this answer as best so that others facing the same issue will find this information useful.
 
Thank you

All Answers

SwethaSwetha (Salesforce Developers) 
HI Kasia
This appears to be an issue with case sensitivity failing at system.assertequals method.

Can you try the approach mentioned in https://salesforce.stackexchange.com/questions/58683/apex-assert-vs-assertequals/58685 to see if it fixes the issue.
 
Hope this helps you. Please mark this answer as best so that others facing the same issue will find this information useful.
 
Thank you
This was selected as the best answer
Kasia Wojewodzka 7Kasia Wojewodzka 7
It worked. thank you Swetha for your feedback.