Skip to main content
added 87 characters in body
Source Link

In my tests I create an object and compare it to the one returned in the function using System.assertEquals. Despite all the properties being exactly the same I still get the "Assertion Failed" message when comparing objects.

Message:

System.AssertException: Assertion Failed: Expected: Attribute:[name=Name, options=null, required=false, showInUI=true, type=String, value=], Actual: Attribute:[name=Name, options=null, required=false, showInUI=true, type=String, value=]

Notice that Expected and Actual are exactly the same.

Note: all properties are primitive types except options which is a list of Strings.

In my tests I create an object and compare it to the one returned in the function using System.assertEquals. Despite all the properties being exactly the same I still get the "Assertion Failed" message when comparing objects.

Message:

System.AssertException: Assertion Failed: Expected: Attribute:[name=Name, options=null, required=false, showInUI=true, type=String, value=], Actual: Attribute:[name=Name, options=null, required=false, showInUI=true, type=String, value=]

Notice that Expected and Actual are exactly the same.

In my tests I create an object and compare it to the one returned in the function using System.assertEquals. Despite all the properties being exactly the same I still get the "Assertion Failed" message when comparing objects.

Message:

System.AssertException: Assertion Failed: Expected: Attribute:[name=Name, options=null, required=false, showInUI=true, type=String, value=], Actual: Attribute:[name=Name, options=null, required=false, showInUI=true, type=String, value=]

Notice that Expected and Actual are exactly the same.

Note: all properties are primitive types except options which is a list of Strings.

added 13 characters in body
Source Link
Mr.Frodo
  • 5.8k
  • 1
  • 17
  • 37

In my tests I create an object and compare it to the one returned in the function using System.assertEquals. Despite all the properties being exactly the same I still get the "Assertion Failed" message when comparing objects.

Message: System.AssertException: Assertion Failed: Expected: Attribute:[name=Name, options=null, required=false, showInUI=true, type=String, value=], Actual: Attribute:[name=Name, options=null, required=false, showInUI=true, type=String, value=]

System.AssertException: Assertion Failed: Expected: Attribute:[name=Name, options=null, required=false, showInUI=true, type=String, value=], Actual: Attribute:[name=Name, options=null, required=false, showInUI=true, type=String, value=]

Notice that Expected and Actual are exactly the same.

In my tests I create an object and compare it to the one returned in the function using System.assertEquals. Despite all the properties being exactly the same I still get the "Assertion Failed" message when comparing objects.

Message: System.AssertException: Assertion Failed: Expected: Attribute:[name=Name, options=null, required=false, showInUI=true, type=String, value=], Actual: Attribute:[name=Name, options=null, required=false, showInUI=true, type=String, value=]

Notice that Expected and Actual are exactly the same.

In my tests I create an object and compare it to the one returned in the function using System.assertEquals. Despite all the properties being exactly the same I still get the "Assertion Failed" message when comparing objects.

Message:

System.AssertException: Assertion Failed: Expected: Attribute:[name=Name, options=null, required=false, showInUI=true, type=String, value=], Actual: Attribute:[name=Name, options=null, required=false, showInUI=true, type=String, value=]

Notice that Expected and Actual are exactly the same.

Source Link

assertEquals | All Object Properties Are the Same but the Assertion Fails

In my tests I create an object and compare it to the one returned in the function using System.assertEquals. Despite all the properties being exactly the same I still get the "Assertion Failed" message when comparing objects.

Message: System.AssertException: Assertion Failed: Expected: Attribute:[name=Name, options=null, required=false, showInUI=true, type=String, value=], Actual: Attribute:[name=Name, options=null, required=false, showInUI=true, type=String, value=]

Notice that Expected and Actual are exactly the same.