You need to sign in to do that
Don't have an account?
Test Class help
i want to create a test class for my trigger someone could help me with that?
trigger aiu_IfaceLimiteCreditoDiario on IfaceLimiteCreditoDiario__c (after insert, after update) { List<Account> Auxacc = new List<Account>(); List<Account> ListAcc = [Select id,a.TipoLimite__c, a.LimiteCredito__c, a.C_digo_do_Cliente__c From Account a]; for(IfaceLimiteCreditoDiario__c iface : Trigger.new){ for(Account acc : ListAcc){ if(String.valueOf(acc.C_digo_do_Cliente__c) == iface.CustomerNumber__c){ Account accs = acc; accs.LimiteCredito__c = iface.LimiteCredito__c; accs.TipoLimite__c = iface.TipoLimite__c; Auxacc.add (accs); } } } update Auxacc; }
The gist is, you'll want to create a test class and one or more test methods which insert IfaceLimiteCreditoDiario__c records. You'll then need to add asserts to verify that your trigger is working as expected. The more test methods and more asserts the better.