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
Lukas van RooyenLukas van Rooyen 

Receiving Milestone1_Email_Handler_Tst error when trying to deploy my batchable/schedulable apex class

Hi all, first time receiving this error. I am trying to deploy my batchable/schedulable apex class.

 Milestone1_Email_Handler_TsttestEmailWithAttachmentsSystem.AssertException: Assertion Failed
Stack Trace: Class.Milestone1_Email_Handler_Tst.testEmailWithAttachments: line 104, column 1

Milestone1_Email_Handler_TsttestEmailWithoutAttachmentsSystem.AssertException: Assertion Failed
Stack Trace: Class.Milestone1_Email_Handler_Tst.testEmailWithoutAttachments: line 60, column 1

Milestone1_Email_Handler_TsttestNoAliasWithDefaultMilestoneAliasSystem.AssertException: Assertion Failed
Stack Trace: Class.Milestone1_Email_Handler_Tst.testNoAliasWithDefaultMilestoneAlias: line 310, column 1
SwethaSwetha (Salesforce Developers) 
HI Lukas,
An assertion means you are asserting (stating) that a condition is true. If the condition is not true, the assertion will throw an uncatchable exception. That's what is happening.

Check the line numbers mentioned in the stack trace in your test class code and verify if the expected values are being passed to the assert statement.

Recommend reviewing this similar scenario from the past to understand the troubleshooting approach to be followed:
https://salesforce.stackexchange.com/questions/222890/system-assertexception-assertion-failed

If this information helps, please mark the answer as best. Thank you
Lukas van RooyenLukas van Rooyen
system.assert(createdTasks.get(0).Assigned_To__c == users.get(0).Id);

This is were the error seems to be coming from. How do I fix this?