0

I have a problem when i try to implement some tests in IOS using OCMOCK; Indeed, i need the equivalent of easy mock ary eq to expect byte array argument is equal to the given array. here's an example:

invoked:  openConnectionWithJavaLangByteArray:[0xffffffa0, 0x0, 0x0, 0x0, 0x0, 0x10, 0x10, 0x10]
expected: openConnectionWithJavaLangByteArray:[0xffffffa0, 0x0, 0x0, 0x0, 0x0, 0x10, 0x10, 0x10]

The buffers argument are same but we need , like when implementing in java to use ary eq to compare the equality of these two buffers. any help? thanks.

LuigiEdlCarno
  • 2,410
  • 2
  • 21
  • 37

1 Answers1

1

You can use [OCMArg checkWithBlock:] Example:

[[yourMockObject expect] someMethodWithParameter:[OCMArg checkWithBlock:^BOOL(id param)
                                                  {
                                                      // assertions with param here.
                                                      // return BOOL indicating if the expectation passed or not.
                                                  }]];
[yourMockObject verify];
e1985
  • 6,239
  • 1
  • 24
  • 39