{"action":"created","issue":{"url":"https://api.github.com/repos/dennisdoomen/fluentassertions/issues/235","labels_url":"https://api.github.com/repos/dennisdoomen/fluentassertions/issues/235/labels{/name}","comments_url":"https://api.github.com/repos/dennisdoomen/fluentassertions/issues/235/comments","events_url":"https://api.github.com/repos/dennisdoomen/fluentassertions/issues/235/events","html_url":"https://github.com/dennisdoomen/fluentassertions/issues/235","id":58095751,"number":235,"title":"Interfaces","user":{"login":"Fydon","id":3404761,"avatar_url":"https://avatars.githubusercontent.com/u/3404761?v=3","gravatar_id":"","url":"https://api.github.com/users/Fydon","html_url":"https://github.com/Fydon","followers_url":"https://api.github.com/users/Fydon/followers","following_url":"https://api.github.com/users/Fydon/following{/other_user}","gists_url":"https://api.github.com/users/Fydon/gists{/gist_id}","starred_url":"https://api.github.com/users/Fydon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Fydon/subscriptions","organizations_url":"https://api.github.com/users/Fydon/orgs","repos_url":"https://api.github.com/users/Fydon/repos","events_url":"https://api.github.com/users/Fydon/events{/privacy}","received_events_url":"https://api.github.com/users/Fydon/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-02-18T17:02:09Z","updated_at":"2015-02-19T02:42:36Z","closed_at":null,"body":"Is there a way to get the object inside a interface to be compared, without explicitly typecasting? In the example below I need to know to iterate through a list to check equivalence, as the first check only checks the list and not the properties of class c.\r\n\r\n    interface i\r\n    {\r\n    }\r\n\r\n    class c : i\r\n    {\r\n        public string property { get; set; }\r\n    }\r\n\r\n    class Program\r\n    {\r\n        static void Main( string[] args )\r\n        {\r\n            var a = new List<i> { new c() { property = \"hello\" } };\r\n            var b = new List<i> { new c() { property = \"world\" } };\r\n\r\n            a.ShouldBeEquivalentTo( b );\r\n            for( int i = 0; i < a.Count; ++i )\r\n            {\r\n                ( (c)a[i] ).ShouldBeEquivalentTo( (c)b[i] ); // AssertionFailedException thrown here\r\n            }\r\n        }\r\n    }"},"comment":{"url":"https://api.github.com/repos/dennisdoomen/fluentassertions/issues/comments/74990632","html_url":"https://github.com/dennisdoomen/fluentassertions/issues/235#issuecomment-74990632","issue_url":"https://api.github.com/repos/dennisdoomen/fluentassertions/issues/235","id":74990632,"user":{"login":"vossad01","id":965439,"avatar_url":"https://avatars.githubusercontent.com/u/965439?v=3","gravatar_id":"","url":"https://api.github.com/users/vossad01","html_url":"https://github.com/vossad01","followers_url":"https://api.github.com/users/vossad01/followers","following_url":"https://api.github.com/users/vossad01/following{/other_user}","gists_url":"https://api.github.com/users/vossad01/gists{/gist_id}","starred_url":"https://api.github.com/users/vossad01/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vossad01/subscriptions","organizations_url":"https://api.github.com/users/vossad01/orgs","repos_url":"https://api.github.com/users/vossad01/repos","events_url":"https://api.github.com/users/vossad01/events{/privacy}","received_events_url":"https://api.github.com/users/vossad01/received_events","type":"User","site_admin":false},"created_at":"2015-02-19T02:42:36Z","updated_at":"2015-02-19T02:42:36Z","body":"Alternatively, now that 3.3.0 has released, you can use the `RespectingRuntimeTypes` option.\r\n\r\n```c#\r\na.ShouldBeEquivalentTo(b, options => options.RespectingRuntimeTypes());\r\n```\r\n\r\nYou can even configure that to be the default behavior using the static `AssertionOptions` class, if appropriate."}}