{"action":"created","issue":{"url":"https://api.github.com/repos/nunit/nunit/issues/2891","repository_url":"https://api.github.com/repos/nunit/nunit","labels_url":"https://api.github.com/repos/nunit/nunit/issues/2891/labels{/name}","comments_url":"https://api.github.com/repos/nunit/nunit/issues/2891/comments","events_url":"https://api.github.com/repos/nunit/nunit/issues/2891/events","html_url":"https://github.com/nunit/nunit/issues/2891","id":332655335,"node_id":"MDU6SXNzdWUzMzI2NTUzMzU=","number":2891,"title":"Assert.AreEqual with IConvertible values","user":{"login":"oznetmaster","id":5798625,"node_id":"MDQ6VXNlcjU3OTg2MjU=","avatar_url":"https://avatars3.githubusercontent.com/u/5798625?v=4","gravatar_id":"","url":"https://api.github.com/users/oznetmaster","html_url":"https://github.com/oznetmaster","followers_url":"https://api.github.com/users/oznetmaster/followers","following_url":"https://api.github.com/users/oznetmaster/following{/other_user}","gists_url":"https://api.github.com/users/oznetmaster/gists{/gist_id}","starred_url":"https://api.github.com/users/oznetmaster/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oznetmaster/subscriptions","organizations_url":"https://api.github.com/users/oznetmaster/orgs","repos_url":"https://api.github.com/users/oznetmaster/repos","events_url":"https://api.github.com/users/oznetmaster/events{/privacy}","received_events_url":"https://api.github.com/users/oznetmaster/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-06-15T06:01:32Z","updated_at":"2018-06-15T21:56:20Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"I am using Assert.AreEqual (1, TestValue) where TestValue is a UInt128 which fully implements IConvertible:\r\n``` \r\npublic struct UInt128 : IComparable<UInt128>, IComparable, IEquatable<UInt128>, IFormattable, IConvertible\r\n```\r\n\r\nas wells as IComparable between itself and int.\r\n\r\nThis assert always fails:\r\n```\r\n  Expected: 1 (Int32)\r\n  But was:  1 (UInt128)\r\n```\r\n\r\nShouldn't NUnit use either the IComparable interface or the IConvertible interface when comparing these two values for equality?"},"comment":{"url":"https://api.github.com/repos/nunit/nunit/issues/comments/397752382","html_url":"https://github.com/nunit/nunit/issues/2891#issuecomment-397752382","issue_url":"https://api.github.com/repos/nunit/nunit/issues/2891","id":397752382,"node_id":"MDEyOklzc3VlQ29tbWVudDM5Nzc1MjM4Mg==","user":{"login":"oznetmaster","id":5798625,"node_id":"MDQ6VXNlcjU3OTg2MjU=","avatar_url":"https://avatars3.githubusercontent.com/u/5798625?v=4","gravatar_id":"","url":"https://api.github.com/users/oznetmaster","html_url":"https://github.com/oznetmaster","followers_url":"https://api.github.com/users/oznetmaster/followers","following_url":"https://api.github.com/users/oznetmaster/following{/other_user}","gists_url":"https://api.github.com/users/oznetmaster/gists{/gist_id}","starred_url":"https://api.github.com/users/oznetmaster/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oznetmaster/subscriptions","organizations_url":"https://api.github.com/users/oznetmaster/orgs","repos_url":"https://api.github.com/users/oznetmaster/repos","events_url":"https://api.github.com/users/oznetmaster/events{/privacy}","received_events_url":"https://api.github.com/users/oznetmaster/received_events","type":"User","site_admin":false},"created_at":"2018-06-15T21:56:20Z","updated_at":"2018-06-15T21:56:20Z","author_association":"CONTRIBUTOR","body":"It is interesting that apparently, Assert.AreEqual (bool, bool) is not supported either?\r\n\r\nPerhaps any type that implements IConvertible should be considered a Numeric, since by definition it can be converted to any of the primitive numeric types that are already considered Numeric?\r\n\r\nSo:\r\n```\r\n        public static bool IsNumericType(Object obj)\r\n        {\r\n            return IsFloatingPointNumeric(obj) || IsFixedPointNumeric(obj);\r\n        }\r\n```\r\n\r\nwould become:\r\n```\r\n        public static bool IsNumericType(Object obj)\r\n        {\r\n            return IsFloatingPointNumeric(obj) || IsFixedPointNumeric(obj) || obj is IConvertible;\r\n        }\r\n```\r\nand the rest of Numerics would be changed appropriately.\r\n"}}
{"actor":{"display_login":"oznetmaster"}}