I have a flow in my app that inserts Response objects into an array, This is the response object:
@interface AppResponse : NSObject
@property (nonatomic, assign) MotSDKState state;
@property (strong, nonatomic) NSError * _Nullable error;
@property (nonatomic, assign) NSInteger errorCode;
@property (strong, nonatomic) NSDictionary * _Nullable response;
@end
I want to check at the end of the flow if the array is correct, so I create a test:
var err = AppResponse()
err.errorCode = 1000
err.state = .failed
let expectedArray = [err]
XCTAssertEqual(self.responsesArray, expectedArray)
I also tried with Nimble:
expect(self.responsesArray).to(equal(expectedArray))
And I get for both of them this unit test failed error:
error: -[****.**** *****] : failed - expected to equal <[<Appesponse: 0x600003288240>]>, got <[<Appesponse: 0x6000032948d0>]>
Any idea what is the problem? how I can compare two arrays of objects?