{"id":24385,"date":"2019-02-21T16:28:20","date_gmt":"2019-02-21T21:28:20","guid":{"rendered":"https:\/\/mjtsai.com\/blog\/?p=24385"},"modified":"2019-02-26T15:55:06","modified_gmt":"2019-02-26T20:55:06","slug":"inverted-xctestexpectations","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2019\/02\/21\/inverted-xctestexpectations\/","title":{"rendered":"Inverted XCTestExpectations"},"content":{"rendered":"<p><a href=\"https:\/\/pfandrade.me\/blog\/inverted-expectations\/\">Paulo Andrade<\/a>:<\/p>\n<blockquote cite=\"https:\/\/pfandrade.me\/blog\/inverted-expectations\/\">\n<p>But what about asserting a notification isn&rsquo;t sent? Waiting for an expectation that&rsquo;s not fulfilled will always result in an error&#8230; So I started browsing the headers of XCTest and I came across <code>isInverted<\/code> property on <code>XCTestExpectation<\/code>.<\/p>\n<\/blockquote>\n<p id=\"inverted-xctestexpectations-update-2019-02-26\">Update (2019-02-26): <a href=\"https:\/\/twitter.com\/heathborders\/status\/1098745498863841281\">Heath Borders<\/a>:<\/p>\n<blockquote cite=\"https:\/\/twitter.com\/heathborders\/status\/1098745498863841281\">\n<p>I created an extension with that as an initializer because property-based injection means that you don&rsquo;t get warnings about unused local variables.<\/p>\n<\/blockquote>","protected":false},"excerpt":{"rendered":"<p>Paulo Andrade: But what about asserting a notification isn&rsquo;t sent? Waiting for an expectation that&rsquo;s not fulfilled will always result in an error&#8230; So I started browsing the headers of XCTest and I came across isInverted property on XCTestExpectation. Update (2019-02-26): Heath Borders: I created an extension with that as an initializer because property-based injection [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"apple_news_api_created_at":"2019-02-21T21:28:23Z","apple_news_api_id":"6bad1a48-3269-4648-b3ca-b32cabad8d04","apple_news_api_modified_at":"2019-02-26T20:55:10Z","apple_news_api_revision":"AAAAAAAAAAAAAAAAAAAAAA==","apple_news_api_share_url":"https:\/\/apple.news\/Aa60aSDJpRkizyrMsq62NBA","apple_news_coverimage":0,"apple_news_coverimage_caption":"","apple_news_is_hidden":false,"apple_news_is_paid":false,"apple_news_is_preview":false,"apple_news_is_sponsored":false,"apple_news_maturity_rating":"","apple_news_metadata":"\"\"","apple_news_pullquote":"","apple_news_pullquote_position":"","apple_news_slug":"","apple_news_sections":"\"\"","apple_news_suppress_video_url":false,"apple_news_use_image_component":false,"footnotes":""},"categories":[4],"tags":[31,1610,30,1609,71,268],"class_list":["post-24385","post","type-post","status-publish","format-standard","hentry","category-programming-category","tag-ios","tag-ios-12","tag-mac","tag-macos-10-14","tag-programming","tag-testing"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/24385","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/comments?post=24385"}],"version-history":[{"count":2,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/24385\/revisions"}],"predecessor-version":[{"id":24424,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/24385\/revisions\/24424"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=24385"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=24385"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=24385"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}