Stefanos Zachariadis

1pod

MCAssertReflectiveEqual

Tests are good. Writing production code just for the purpose of testing is not good if you can avoid it. MCAssertReflectiveEqual works just like XCTest's XCAssertEqual but doesn't require Equatable items - it uses reflection to evaluate if two structs, classes, enums, primitives etc are equal or not. Don't write that equals function in your production code if you don't need it. Don't assert multiple fields in your tests - let MCAssertReflectiveEqual do the job for you and make tests easier to read write. Works similarly to other languages' assert reflective equals (assertReflectiveEquals). Allows use fof custom matchers when reflection is too coarse a tool.

License: MIT

  • Swift