Notifications
Clear all
Jun 12, 2024 12:32 pm
I am getting the error: Expression cannot be assigned - in the following code:
if (ocp != null && ocp.Active__c = true){ Assert.areEqual (true, resp.success); } else { Assert.areEqual(false, resp.success); Assert.areNotEqual('This is not Account 1.5', resp.message); }
1 Reply
Jun 12, 2024 12:35 pm
Comparison operator is ==
= is assignment operator
Corrected code:
if (ocp != null && ocp.Active__c == true){ Assert.areEqual (true, resp.success); } else { Assert.areEqual(false, resp.success); Assert.areNotEqual('This is not Account 1.5', resp.message); }