Testing for equality in Realm
问题 I'm trying to test for equality among Realm objects in unit tests. However, I'm unable to get objects to return true for their equality. According to the Realm docs here, I should be able to do that: let expectedUser = User() expectedUser.email = "help@realm.io" XCTAssertEqual(testRealm.objects(User.self).first!, expectedUser, "User was not properly updated from server.") However, I get the following test failure with the following code: Realm Model class Blurb: Object { dynamic var text = ""