{"action":"created","issue":{"url":"https://api.github.com/repos/shouldly/shouldly/issues/400","repository_url":"https://api.github.com/repos/shouldly/shouldly","labels_url":"https://api.github.com/repos/shouldly/shouldly/issues/400/labels{/name}","comments_url":"https://api.github.com/repos/shouldly/shouldly/issues/400/comments","events_url":"https://api.github.com/repos/shouldly/shouldly/issues/400/events","html_url":"https://github.com/shouldly/shouldly/issues/400","id":172990995,"number":400,"title":"ShouldBe produces a false positive on null collections using ? safe navigation","user":{"login":"SwishWez","id":21223568,"avatar_url":"https://avatars.githubusercontent.com/u/21223568?v=3","gravatar_id":"","url":"https://api.github.com/users/SwishWez","html_url":"https://github.com/SwishWez","followers_url":"https://api.github.com/users/SwishWez/followers","following_url":"https://api.github.com/users/SwishWez/following{/other_user}","gists_url":"https://api.github.com/users/SwishWez/gists{/gist_id}","starred_url":"https://api.github.com/users/SwishWez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SwishWez/subscriptions","organizations_url":"https://api.github.com/users/SwishWez/orgs","repos_url":"https://api.github.com/users/SwishWez/repos","events_url":"https://api.github.com/users/SwishWez/events{/privacy}","received_events_url":"https://api.github.com/users/SwishWez/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/shouldly/shouldly/labels/Blocked","name":"Blocked","color":"eb6420"},{"url":"https://api.github.com/repos/shouldly/shouldly/labels/wontfix","name":"wontfix","color":"f7c6c7"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2016-08-24T15:54:15Z","updated_at":"2016-09-06T00:26:36Z","closed_at":null,"body":"This occurs when using ShouldBe to check equality of a potentially null collection for an expected value via safe navigation.\r\n\r\nE.g.\r\nvar expectedCollection = new List<string> { \"Expected\" };\r\n\r\n(Act)\r\n\r\n// Incorrectly passes when Result is null\r\nlookup.Result?.SomeCollection.ShouldBe(expectedCollection);\r\n\r\n// Adding brackets causes the test to correctly fail when Result is null\r\n(lookup.Result?.SomeCollection).ShouldBe(expectedCollection);"},"comment":{"url":"https://api.github.com/repos/shouldly/shouldly/issues/comments/244824715","html_url":"https://github.com/shouldly/shouldly/issues/400#issuecomment-244824715","issue_url":"https://api.github.com/repos/shouldly/shouldly/issues/400","id":244824715,"user":{"login":"JakeGinnivan","id":453152,"avatar_url":"https://avatars.githubusercontent.com/u/453152?v=3","gravatar_id":"","url":"https://api.github.com/users/JakeGinnivan","html_url":"https://github.com/JakeGinnivan","followers_url":"https://api.github.com/users/JakeGinnivan/followers","following_url":"https://api.github.com/users/JakeGinnivan/following{/other_user}","gists_url":"https://api.github.com/users/JakeGinnivan/gists{/gist_id}","starred_url":"https://api.github.com/users/JakeGinnivan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JakeGinnivan/subscriptions","organizations_url":"https://api.github.com/users/JakeGinnivan/orgs","repos_url":"https://api.github.com/users/JakeGinnivan/repos","events_url":"https://api.github.com/users/JakeGinnivan/events{/privacy}","received_events_url":"https://api.github.com/users/JakeGinnivan/received_events","type":"User","site_admin":false},"created_at":"2016-09-06T00:26:36Z","updated_at":"2016-09-06T00:26:36Z","body":"> As cool as that would be, do we want to go down that route? Where do we stop when it comes to showing warnings about language issues such as this? (I'm not saying it's a bad idea.)\r\n\r\nNot sure, but that is the only way I can think of that we can sort this. But yeah, at some point it is up to the test author to ensure the test fails when it should"}}
{"actor":{"display_login":"JakeGinnivan"}}