{"action":"created","issue":{"url":"https://api.github.com/repos/tpierrain/NFluent/issues/138","repository_url":"https://api.github.com/repos/tpierrain/NFluent","labels_url":"https://api.github.com/repos/tpierrain/NFluent/issues/138/labels{/name}","comments_url":"https://api.github.com/repos/tpierrain/NFluent/issues/138/comments","events_url":"https://api.github.com/repos/tpierrain/NFluent/issues/138/events","html_url":"https://github.com/tpierrain/NFluent/issues/138","id":143780116,"number":138,"title":"<ushort> and <ushort> ... can produce some Headhake ;-)","user":{"login":"SilNak","id":18025453,"avatar_url":"https://avatars.githubusercontent.com/u/18025453?v=3","gravatar_id":"","url":"https://api.github.com/users/SilNak","html_url":"https://github.com/SilNak","followers_url":"https://api.github.com/users/SilNak/followers","following_url":"https://api.github.com/users/SilNak/following{/other_user}","gists_url":"https://api.github.com/users/SilNak/gists{/gist_id}","starred_url":"https://api.github.com/users/SilNak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SilNak/subscriptions","organizations_url":"https://api.github.com/users/SilNak/orgs","repos_url":"https://api.github.com/users/SilNak/repos","events_url":"https://api.github.com/users/SilNak/events{/privacy}","received_events_url":"https://api.github.com/users/SilNak/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/tpierrain/NFluent/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/tpierrain/NFluent/labels/enhancement","name":"enhancement","color":"84b6eb"},{"url":"https://api.github.com/repos/tpierrain/NFluent/labels/wontfix","name":"wontfix","color":"ffffff"}],"state":"open","locked":false,"assignee":{"login":"dupdob","id":3131866,"avatar_url":"https://avatars.githubusercontent.com/u/3131866?v=3","gravatar_id":"","url":"https://api.github.com/users/dupdob","html_url":"https://github.com/dupdob","followers_url":"https://api.github.com/users/dupdob/followers","following_url":"https://api.github.com/users/dupdob/following{/other_user}","gists_url":"https://api.github.com/users/dupdob/gists{/gist_id}","starred_url":"https://api.github.com/users/dupdob/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dupdob/subscriptions","organizations_url":"https://api.github.com/users/dupdob/orgs","repos_url":"https://api.github.com/users/dupdob/repos","events_url":"https://api.github.com/users/dupdob/events{/privacy}","received_events_url":"https://api.github.com/users/dupdob/received_events","type":"User","site_admin":false},"milestone":null,"comments":0,"created_at":"2016-03-27T06:05:08Z","updated_at":"2016-05-27T21:48:45Z","closed_at":null,"body":"Consider the following:\r\n`            ushort usValue = 2;\r\n            int iValue = 1;\r\n            Check.That(usValue).IsEqualTo<ushort>(iValue + 1);`\r\n\r\nnFluent Error Message Factory (EMF) is grumpy:\r\n\r\n> NFluent.FluentCheckException: \r\nThe checked value is different from the expected one.\r\nThe checked value:\r\n\t[2] of type: [ushort]\r\nThe expected value:\r\n\t[2] of type: [int]\r\n\r\nA tentative to make it happy with:\r\n`            ushort usValue = 2;\r\n            int iValue = 1;\r\n            Check.That<ushort>(usValue).IsEqualTo<ushort>(iValue + 1);`\r\n\r\nNow way, the EMF is still Grumpy (he is french or what!):\r\n\r\n> NFluent.FluentCheckException: \r\nThe checked value is different from the expected one.\r\nThe checked value:\r\n\t[2] of type: [ushort]\r\nThe expected value:\r\n\t[2] of type: [int]\r\n\r\nHas any good french ;-), we need to workaround with the truth:\r\n`            ushort usValue = 2;\r\n            int iValue = 1;\r\n            Check.That<int>(usValue).IsEqualTo<int>(iValue + 1);`\r\n\r\nA straightaway syntax would be fine:\r\n `            ushort usValue = 2;\r\n            int iValue = 1;\r\n            Check.That(usValue).IsEqualTo(iValue + 1);`\r\n"},"comment":{"url":"https://api.github.com/repos/tpierrain/NFluent/issues/comments/222260783","html_url":"https://github.com/tpierrain/NFluent/issues/138#issuecomment-222260783","issue_url":"https://api.github.com/repos/tpierrain/NFluent/issues/138","id":222260783,"user":{"login":"dupdob","id":3131866,"avatar_url":"https://avatars.githubusercontent.com/u/3131866?v=3","gravatar_id":"","url":"https://api.github.com/users/dupdob","html_url":"https://github.com/dupdob","followers_url":"https://api.github.com/users/dupdob/followers","following_url":"https://api.github.com/users/dupdob/following{/other_user}","gists_url":"https://api.github.com/users/dupdob/gists{/gist_id}","starred_url":"https://api.github.com/users/dupdob/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dupdob/subscriptions","organizations_url":"https://api.github.com/users/dupdob/orgs","repos_url":"https://api.github.com/users/dupdob/repos","events_url":"https://api.github.com/users/dupdob/events{/privacy}","received_events_url":"https://api.github.com/users/dupdob/received_events","type":"User","site_admin":false},"created_at":"2016-05-27T21:48:45Z","updated_at":"2016-05-27T21:48:45Z","body":"I propose not to change the current behavior: \r\nin your example, _iValue+1_ is automatically 'upgraded' to **int** because _1_ is an **int**.\r\n\r\nDuring the initial behavior discussions for numerical checks, we **decided that the precise type was a natural part of the expected value** and that most developers would prefer to have to precisely specify the type.\r\n\r\nSo, I will implement **an improved error message** to cover the case where **checked and expected have the same value with different type**."}}
{"actor":{"display_login":"dupdob"}}