{"action":"created","comment":{"url":"https://api.github.com/repos/wireapp/wire-ios-data-model/pulls/comments/76089825","id":76089825,"diff_hunk":"@@ -0,0 +1,106 @@\n+//\n+//  File.swift\n+//  ZMCDataModel\n+//\n+//  Created by Marco Conti on 24/08/16.\n+//  Copyright © 2016 Wire Swiss GmbH. All rights reserved.\n+//\n+\n+import Foundation\n+import XCTest\n+\n+class ZMAddressBookContactTests : XCTestCase {\n+    \n+    func testThatTwoContactsAreTheSame() {\n+        \n+        // given\n+        let name = \"Nina\"\n+        let emails = [\"nina@example.com\", \"rocker88@example.com\"]\n+        let phones = [\"+155505123\"]\n+        \n+        // when\n+        let contact1 = ZMAddressBookContact()\n+        let contact2 = ZMAddressBookContact()\n+        for contact in [contact1, contact2] {\n+            contact.firstName = name\n+            contact.emailAddresses = emails\n+            contact.phoneNumbers = phones\n+        }\n+        \n+        // then\n+        XCTAssertEqual(contact1, contact2)\n+        XCTAssertEqual(contact1.hash, contact2.hash)\n+    }\n+    \n+    func testThatTwoContactsAreNotTheSameBecauseEmailIsNotSame() {\n+        \n+        // given\n+        let name = \"Nina\"\n+        let emails = [\"nina@example.com\", \"rocker88@example.com\"]\n+        let phones = [\"+155505123\"]\n+        \n+        let contact1 = ZMAddressBookContact()\n+        let contact2 = ZMAddressBookContact()\n+        for contact in [contact1, contact2] {\n+            contact.firstName = name\n+            contact.emailAddresses = emails\n+            contact.phoneNumbers = phones\n+        }\n+        \n+        // when\n+        contact2.emailAddresses = []\n+        \n+        // then\n+        XCTAssertNotEqual(contact1, contact2)\n+        XCTAssertNotEqual(contact1.hash, contact2.hash)\n+\n+    }\n+    \n+    func testThatTwoContactsAreNotTheSameBecausePhoneIsNotSame() {\n+        \n+        // given\n+        let name = \"Nina\"\n+        let emails = [\"nina@example.com\", \"rocker88@example.com\"]\n+        let phones = [\"+155505123\"]\n+        \n+        let contact1 = ZMAddressBookContact()\n+        let contact2 = ZMAddressBookContact()\n+        for contact in [contact1, contact2] {\n+            contact.firstName = name\n+            contact.emailAddresses = emails\n+            contact.phoneNumbers = phones\n+        }\n+        \n+        // when\n+        contact2.phoneNumbers = []\n+        \n+        // then\n+        XCTAssertNotEqual(contact1, contact2)\n+        XCTAssertNotEqual(contact1.hash, contact2.hash)\n+\n+    }\n+    \n+    func testThatTwoContactsAreNotTheSameBecauseNameIsNotSame() {\n+        \n+        // given\n+        let name = \"Nina\"\n+        let emails = [\"nina@example.com\", \"rocker88@example.com\"]\n+        let phones = [\"+155505123\"]\n+        \n+        let contact1 = ZMAddressBookContact()\n+        let contact2 = ZMAddressBookContact()\n+        for contact in [contact1, contact2] {\n+            contact.firstName = name\n+            contact.emailAddresses = emails\n+            contact.phoneNumbers = phones\n+        }\n+        \n+        // when\n+        contact2.lastName = \"Licci\"\n+        \n+        // then\n+        XCTAssertNotEqual(contact1, contact2)\n+        XCTAssertNotEqual(contact1.hash, contact2.hash)\n+    }\n+    \n+}","path":"Tests/Source/Model/ZMAddressBookContactTests.swift","position":106,"original_position":106,"commit_id":"2a39f1dd90c277f3f564ca5a57e8b12c523f3bf6","original_commit_id":"2a39f1dd90c277f3f564ca5a57e8b12c523f3bf6","user":{"login":"daehn","id":4603353,"avatar_url":"https://avatars.githubusercontent.com/u/4603353?v=3","gravatar_id":"","url":"https://api.github.com/users/daehn","html_url":"https://github.com/daehn","followers_url":"https://api.github.com/users/daehn/followers","following_url":"https://api.github.com/users/daehn/following{/other_user}","gists_url":"https://api.github.com/users/daehn/gists{/gist_id}","starred_url":"https://api.github.com/users/daehn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/daehn/subscriptions","organizations_url":"https://api.github.com/users/daehn/orgs","repos_url":"https://api.github.com/users/daehn/repos","events_url":"https://api.github.com/users/daehn/events{/privacy}","received_events_url":"https://api.github.com/users/daehn/received_events","type":"User","site_admin":false},"body":"Missing newline at the end of the file","created_at":"2016-08-24T16:21:28Z","updated_at":"2016-08-24T16:21:28Z","html_url":"https://github.com/wireapp/wire-ios-data-model/pull/15#discussion_r76089825","pull_request_url":"https://api.github.com/repos/wireapp/wire-ios-data-model/pulls/15","_links":{"self":{"href":"https://api.github.com/repos/wireapp/wire-ios-data-model/pulls/comments/76089825"},"html":{"href":"https://github.com/wireapp/wire-ios-data-model/pull/15#discussion_r76089825"},"pull_request":{"href":"https://api.github.com/repos/wireapp/wire-ios-data-model/pulls/15"}}},"pull_request":{"url":"https://api.github.com/repos/wireapp/wire-ios-data-model/pulls/15","id":82573878,"html_url":"https://github.com/wireapp/wire-ios-data-model/pull/15","diff_url":"https://github.com/wireapp/wire-ios-data-model/pull/15.diff","patch_url":"https://github.com/wireapp/wire-ios-data-model/pull/15.patch","issue_url":"https://api.github.com/repos/wireapp/wire-ios-data-model/issues/15","number":15,"state":"open","locked":false,"title":"Add equality and hash to ZMAddressBookContact","user":{"login":"marcoconti83","id":620000,"avatar_url":"https://avatars.githubusercontent.com/u/620000?v=3","gravatar_id":"","url":"https://api.github.com/users/marcoconti83","html_url":"https://github.com/marcoconti83","followers_url":"https://api.github.com/users/marcoconti83/followers","following_url":"https://api.github.com/users/marcoconti83/following{/other_user}","gists_url":"https://api.github.com/users/marcoconti83/gists{/gist_id}","starred_url":"https://api.github.com/users/marcoconti83/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marcoconti83/subscriptions","organizations_url":"https://api.github.com/users/marcoconti83/orgs","repos_url":"https://api.github.com/users/marcoconti83/repos","events_url":"https://api.github.com/users/marcoconti83/events{/privacy}","received_events_url":"https://api.github.com/users/marcoconti83/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-08-24T16:20:19Z","updated_at":"2016-08-24T16:21:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bd450c68630d2f578330d26251fb01afe35125b4","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/wireapp/wire-ios-data-model/pulls/15/commits","review_comments_url":"https://api.github.com/repos/wireapp/wire-ios-data-model/pulls/15/comments","review_comment_url":"https://api.github.com/repos/wireapp/wire-ios-data-model/pulls/comments{/number}","comments_url":"https://api.github.com/repos/wireapp/wire-ios-data-model/issues/15/comments","statuses_url":"https://api.github.com/repos/wireapp/wire-ios-data-model/statuses/2a39f1dd90c277f3f564ca5a57e8b12c523f3bf6","head":{"label":"wireapp:feature/equality-contacts","ref":"feature/equality-contacts","sha":"2a39f1dd90c277f3f564ca5a57e8b12c523f3bf6","user":{"login":"wireapp","id":16047324,"avatar_url":"https://avatars.githubusercontent.com/u/16047324?v=3","gravatar_id":"","url":"https://api.github.com/users/wireapp","html_url":"https://github.com/wireapp","followers_url":"https://api.github.com/users/wireapp/followers","following_url":"https://api.github.com/users/wireapp/following{/other_user}","gists_url":"https://api.github.com/users/wireapp/gists{/gist_id}","starred_url":"https://api.github.com/users/wireapp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wireapp/subscriptions","organizations_url":"https://api.github.com/users/wireapp/orgs","repos_url":"https://api.github.com/users/wireapp/repos","events_url":"https://api.github.com/users/wireapp/events{/privacy}","received_events_url":"https://api.github.com/users/wireapp/received_events","type":"Organization","site_admin":false},"repo":{"id":57151009,"name":"wire-ios-data-model","full_name":"wireapp/wire-ios-data-model","owner":{"login":"wireapp","id":16047324,"avatar_url":"https://avatars.githubusercontent.com/u/16047324?v=3","gravatar_id":"","url":"https://api.github.com/users/wireapp","html_url":"https://github.com/wireapp","followers_url":"https://api.github.com/users/wireapp/followers","following_url":"https://api.github.com/users/wireapp/following{/other_user}","gists_url":"https://api.github.com/users/wireapp/gists{/gist_id}","starred_url":"https://api.github.com/users/wireapp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wireapp/subscriptions","organizations_url":"https://api.github.com/users/wireapp/orgs","repos_url":"https://api.github.com/users/wireapp/repos","events_url":"https://api.github.com/users/wireapp/events{/privacy}","received_events_url":"https://api.github.com/users/wireapp/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/wireapp/wire-ios-data-model","description":"Core Data model and entity classes","fork":false,"url":"https://api.github.com/repos/wireapp/wire-ios-data-model","forks_url":"https://api.github.com/repos/wireapp/wire-ios-data-model/forks","keys_url":"https://api.github.com/repos/wireapp/wire-ios-data-model/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wireapp/wire-ios-data-model/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wireapp/wire-ios-data-model/teams","hooks_url":"https://api.github.com/repos/wireapp/wire-ios-data-model/hooks","issue_events_url":"https://api.github.com/repos/wireapp/wire-ios-data-model/issues/events{/number}","events_url":"https://api.github.com/repos/wireapp/wire-ios-data-model/events","assignees_url":"https://api.github.com/repos/wireapp/wire-ios-data-model/assignees{/user}","branches_url":"https://api.github.com/repos/wireapp/wire-ios-data-model/branches{/branch}","tags_url":"https://api.github.com/repos/wireapp/wire-ios-data-model/tags","blobs_url":"https://api.github.com/repos/wireapp/wire-ios-data-model/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wireapp/wire-ios-data-model/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wireapp/wire-ios-data-model/git/refs{/sha}","trees_url":"https://api.github.com/repos/wireapp/wire-ios-data-model/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wireapp/wire-ios-data-model/statuses/{sha}","languages_url":"https://api.github.com/repos/wireapp/wire-ios-data-model/languages","stargazers_url":"https://api.github.com/repos/wireapp/wire-ios-data-model/stargazers","contributors_url":"https://api.github.com/repos/wireapp/wire-ios-data-model/contributors","subscribers_url":"https://api.github.com/repos/wireapp/wire-ios-data-model/subscribers","subscription_url":"https://api.github.com/repos/wireapp/wire-ios-data-model/subscription","commits_url":"https://api.github.com/repos/wireapp/wire-ios-data-model/commits{/sha}","git_commits_url":"https://api.github.com/repos/wireapp/wire-ios-data-model/git/commits{/sha}","comments_url":"https://api.github.com/repos/wireapp/wire-ios-data-model/comments{/number}","issue_comment_url":"https://api.github.com/repos/wireapp/wire-ios-data-model/issues/comments{/number}","contents_url":"https://api.github.com/repos/wireapp/wire-ios-data-model/contents/{+path}","compare_url":"https://api.github.com/repos/wireapp/wire-ios-data-model/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wireapp/wire-ios-data-model/merges","archive_url":"https://api.github.com/repos/wireapp/wire-ios-data-model/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wireapp/wire-ios-data-model/downloads","issues_url":"https://api.github.com/repos/wireapp/wire-ios-data-model/issues{/number}","pulls_url":"https://api.github.com/repos/wireapp/wire-ios-data-model/pulls{/number}","milestones_url":"https://api.github.com/repos/wireapp/wire-ios-data-model/milestones{/number}","notifications_url":"https://api.github.com/repos/wireapp/wire-ios-data-model/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wireapp/wire-ios-data-model/labels{/name}","releases_url":"https://api.github.com/repos/wireapp/wire-ios-data-model/releases{/id}","deployments_url":"https://api.github.com/repos/wireapp/wire-ios-data-model/deployments","created_at":"2016-04-26T18:09:28Z","updated_at":"2016-08-22T15:38:37Z","pushed_at":"2016-08-24T16:20:20Z","git_url":"git://github.com/wireapp/wire-ios-data-model.git","ssh_url":"git@github.com:wireapp/wire-ios-data-model.git","clone_url":"https://github.com/wireapp/wire-ios-data-model.git","svn_url":"https://github.com/wireapp/wire-ios-data-model","homepage":"https://wire.com","size":3368,"stargazers_count":5,"watchers_count":5,"language":"Objective-C","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":1,"forks":2,"open_issues":1,"watchers":5,"default_branch":"develop"}},"base":{"label":"wireapp:develop","ref":"develop","sha":"795ce8e6f86bd560178a5961882f47c8f52f1241","user":{"login":"wireapp","id":16047324,"avatar_url":"https://avatars.githubusercontent.com/u/16047324?v=3","gravatar_id":"","url":"https://api.github.com/users/wireapp","html_url":"https://github.com/wireapp","followers_url":"https://api.github.com/users/wireapp/followers","following_url":"https://api.github.com/users/wireapp/following{/other_user}","gists_url":"https://api.github.com/users/wireapp/gists{/gist_id}","starred_url":"https://api.github.com/users/wireapp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wireapp/subscriptions","organizations_url":"https://api.github.com/users/wireapp/orgs","repos_url":"https://api.github.com/users/wireapp/repos","events_url":"https://api.github.com/users/wireapp/events{/privacy}","received_events_url":"https://api.github.com/users/wireapp/received_events","type":"Organization","site_admin":false},"repo":{"id":57151009,"name":"wire-ios-data-model","full_name":"wireapp/wire-ios-data-model","owner":{"login":"wireapp","id":16047324,"avatar_url":"https://avatars.githubusercontent.com/u/16047324?v=3","gravatar_id":"","url":"https://api.github.com/users/wireapp","html_url":"https://github.com/wireapp","followers_url":"https://api.github.com/users/wireapp/followers","following_url":"https://api.github.com/users/wireapp/following{/other_user}","gists_url":"https://api.github.com/users/wireapp/gists{/gist_id}","starred_url":"https://api.github.com/users/wireapp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wireapp/subscriptions","organizations_url":"https://api.github.com/users/wireapp/orgs","repos_url":"https://api.github.com/users/wireapp/repos","events_url":"https://api.github.com/users/wireapp/events{/privacy}","received_events_url":"https://api.github.com/users/wireapp/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/wireapp/wire-ios-data-model","description":"Core Data model and entity classes","fork":false,"url":"https://api.github.com/repos/wireapp/wire-ios-data-model","forks_url":"https://api.github.com/repos/wireapp/wire-ios-data-model/forks","keys_url":"https://api.github.com/repos/wireapp/wire-ios-data-model/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wireapp/wire-ios-data-model/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wireapp/wire-ios-data-model/teams","hooks_url":"https://api.github.com/repos/wireapp/wire-ios-data-model/hooks","issue_events_url":"https://api.github.com/repos/wireapp/wire-ios-data-model/issues/events{/number}","events_url":"https://api.github.com/repos/wireapp/wire-ios-data-model/events","assignees_url":"https://api.github.com/repos/wireapp/wire-ios-data-model/assignees{/user}","branches_url":"https://api.github.com/repos/wireapp/wire-ios-data-model/branches{/branch}","tags_url":"https://api.github.com/repos/wireapp/wire-ios-data-model/tags","blobs_url":"https://api.github.com/repos/wireapp/wire-ios-data-model/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wireapp/wire-ios-data-model/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wireapp/wire-ios-data-model/git/refs{/sha}","trees_url":"https://api.github.com/repos/wireapp/wire-ios-data-model/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wireapp/wire-ios-data-model/statuses/{sha}","languages_url":"https://api.github.com/repos/wireapp/wire-ios-data-model/languages","stargazers_url":"https://api.github.com/repos/wireapp/wire-ios-data-model/stargazers","contributors_url":"https://api.github.com/repos/wireapp/wire-ios-data-model/contributors","subscribers_url":"https://api.github.com/repos/wireapp/wire-ios-data-model/subscribers","subscription_url":"https://api.github.com/repos/wireapp/wire-ios-data-model/subscription","commits_url":"https://api.github.com/repos/wireapp/wire-ios-data-model/commits{/sha}","git_commits_url":"https://api.github.com/repos/wireapp/wire-ios-data-model/git/commits{/sha}","comments_url":"https://api.github.com/repos/wireapp/wire-ios-data-model/comments{/number}","issue_comment_url":"https://api.github.com/repos/wireapp/wire-ios-data-model/issues/comments{/number}","contents_url":"https://api.github.com/repos/wireapp/wire-ios-data-model/contents/{+path}","compare_url":"https://api.github.com/repos/wireapp/wire-ios-data-model/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wireapp/wire-ios-data-model/merges","archive_url":"https://api.github.com/repos/wireapp/wire-ios-data-model/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wireapp/wire-ios-data-model/downloads","issues_url":"https://api.github.com/repos/wireapp/wire-ios-data-model/issues{/number}","pulls_url":"https://api.github.com/repos/wireapp/wire-ios-data-model/pulls{/number}","milestones_url":"https://api.github.com/repos/wireapp/wire-ios-data-model/milestones{/number}","notifications_url":"https://api.github.com/repos/wireapp/wire-ios-data-model/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wireapp/wire-ios-data-model/labels{/name}","releases_url":"https://api.github.com/repos/wireapp/wire-ios-data-model/releases{/id}","deployments_url":"https://api.github.com/repos/wireapp/wire-ios-data-model/deployments","created_at":"2016-04-26T18:09:28Z","updated_at":"2016-08-22T15:38:37Z","pushed_at":"2016-08-24T16:20:20Z","git_url":"git://github.com/wireapp/wire-ios-data-model.git","ssh_url":"git@github.com:wireapp/wire-ios-data-model.git","clone_url":"https://github.com/wireapp/wire-ios-data-model.git","svn_url":"https://github.com/wireapp/wire-ios-data-model","homepage":"https://wire.com","size":3368,"stargazers_count":5,"watchers_count":5,"language":"Objective-C","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":1,"forks":2,"open_issues":1,"watchers":5,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/wireapp/wire-ios-data-model/pulls/15"},"html":{"href":"https://github.com/wireapp/wire-ios-data-model/pull/15"},"issue":{"href":"https://api.github.com/repos/wireapp/wire-ios-data-model/issues/15"},"comments":{"href":"https://api.github.com/repos/wireapp/wire-ios-data-model/issues/15/comments"},"review_comments":{"href":"https://api.github.com/repos/wireapp/wire-ios-data-model/pulls/15/comments"},"review_comment":{"href":"https://api.github.com/repos/wireapp/wire-ios-data-model/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/wireapp/wire-ios-data-model/pulls/15/commits"},"statuses":{"href":"https://api.github.com/repos/wireapp/wire-ios-data-model/statuses/2a39f1dd90c277f3f564ca5a57e8b12c523f3bf6"}}}}
{"actor":{"display_login":"daehn"}}