I have a unit test for a method which gets an object from a collection. This keeps failing and I cannot see why, so I have created a very simple test below to create 2 suppl
When testing the individual properties, you compare the string/integer values. They are equal, and so the tests pass.
When testing the parent objects, you compare only the two container structures of type Supplier - and even though those may hold equal property values, they are not equal: Since you are instantiating two separate objects, they do not reside at the same address in memory.