You need to sign in to do that
Don't have an account?
Ivan Winzer
system assert is failing in sandbox
So i have test class that keeps failing when run in sandbox. The main error i am getting is:
Error MessageSystem.AssertException: Assertion Failed: Expected: , Actual: Collection
Stack TraceClass.Test_DataPushtoAccount.testDataPushtoAccount: line 19, column 1
Below is the code and im not sure why its saying its expecting a null i query it in my c = statement and the filed is set in hte creation of the customer. Can anyone let me know what im not seeing.
Error MessageSystem.AssertException: Assertion Failed: Expected: , Actual: Collection
Stack TraceClass.Test_DataPushtoAccount.testDataPushtoAccount: line 19, column 1
Below is the code and im not sure why its saying its expecting a null i query it in my c = statement and the filed is set in hte creation of the customer. Can anyone let me know what im not seeing.
@isTest public with sharing class Test_DataPushtoAccount { @isTest public static void testDataPushtoAccount(){ Account a = new Account(Name = 'Test MainContactTrigger', RecordTypeID = '01240000000UZ4V'); // a.RecordType = 'Household'; insert a; Contact c = new Contact(AccountID = a.id, firstName = 'Test MainContactTrigger', lastName = 'Tester', email = 'testfake@gmail.com', Pricing_Profile__c = 'Collection'); insert c; // System.debug('Contact record num: ' + [SELECT Id FROM Contact].size()); c = [select AccountId, Account.Name, Pricing_Profile__c from Contact where id = :c.id limit 1]; System.assertEquals('Test MainContactTrigger', a.Name); System.assertEquals(1, [SELECT Id FROM Contact].size()); System.assertEquals(a.id, c.AccountId); System.assertEquals(a.Pricing_Profile__c, c.Pricing_Profile__c); } }
Hi,
You have missed the populating the field Pricing_Profile__c in account.
Modified Code will be:
If you will get help from this docs Please give me Best Answer.
Thanks,
All Answers
Hi,
You have missed the populating the field Pricing_Profile__c in account.
Modified Code will be:
If you will get help from this docs Please give me Best Answer.
Thanks,