{"action":"created","issue":{"url":"https://api.github.com/repos/JuliusSweetland/OptiKey/issues/160","labels_url":"https://api.github.com/repos/JuliusSweetland/OptiKey/issues/160/labels{/name}","comments_url":"https://api.github.com/repos/JuliusSweetland/OptiKey/issues/160/comments","events_url":"https://api.github.com/repos/JuliusSweetland/OptiKey/issues/160/events","html_url":"https://github.com/JuliusSweetland/OptiKey/pull/160","id":113251525,"number":160,"title":"Issue 14 - Write unit tests","user":{"login":"padmo","id":1918007,"avatar_url":"https://avatars.githubusercontent.com/u/1918007?v=3","gravatar_id":"","url":"https://api.github.com/users/padmo","html_url":"https://github.com/padmo","followers_url":"https://api.github.com/users/padmo/followers","following_url":"https://api.github.com/users/padmo/following{/other_user}","gists_url":"https://api.github.com/users/padmo/gists{/gist_id}","starred_url":"https://api.github.com/users/padmo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/padmo/subscriptions","organizations_url":"https://api.github.com/users/padmo/orgs","repos_url":"https://api.github.com/users/padmo/repos","events_url":"https://api.github.com/users/padmo/events{/privacy}","received_events_url":"https://api.github.com/users/padmo/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-10-25T20:53:02Z","updated_at":"2015-10-26T11:16:06Z","closed_at":"2015-10-26T11:12:51Z","pull_request":{"url":"https://api.github.com/repos/JuliusSweetland/OptiKey/pulls/160","html_url":"https://github.com/JuliusSweetland/OptiKey/pull/160","diff_url":"https://github.com/JuliusSweetland/OptiKey/pull/160.diff","patch_url":"https://github.com/JuliusSweetland/OptiKey/pull/160.patch"},"body":"Hi Julius,\r\n\r\nI just stumbled on your project via Reddit Originals, looked cool and it's open source in .NET (so no extra technology barrier for me), so I checked it out because I wanted to try to contribute to an open source project for a while now, see what i's like :)\r\n\r\nThis pull request contains changes related to https://github.com/JuliusSweetland/OptiKey/issues/14\r\nThe goal is to capture the current behavior in automated tests, so any unintentional changes are flagged and you get more confidence to refactor and add new features, minimizing regressions.\r\n\r\nTo demonstrate my approach, I have started with the MainViewModel constructor.\r\nThe test names are purposefully verbose, aiming to focus on the functional instead of the technical, hopefully making them as clear and meaningful as possible:\r\n1. Namespace contains the subject (e.g. MainViewModelSpecifications)\r\n2. The class name contains the part of the subject under test in a given scenario (e.g. WhenConstructGivenConversationOnlyMode)\r\n3. The test method contains the specification (e.g. ThenWindowShouldBeMaximised)\r\n\r\nExpected behavior is specified as should, since requirements can change, but you then explicitly have to change or remove the test.\r\n\r\nNotes:\r\n1. To be able to setup different scenarios, I made the internals of JuliusSweetland.OptiKey visible to the test project\r\n2. I added a TestBase class, to streamline the style of the tests\r\n3. I couldn't test all scenarios (AttachScratchpadEnabledListener is not tested, AttachKeyboardSupportsMultiKeySelectionListener is partially tested)\r\n\r\nIf you're interested in continuing on this path, let me know, I'll see what I can contribute :)"},"comment":{"url":"https://api.github.com/repos/JuliusSweetland/OptiKey/issues/comments/151103567","html_url":"https://github.com/JuliusSweetland/OptiKey/pull/160#issuecomment-151103567","issue_url":"https://api.github.com/repos/JuliusSweetland/OptiKey/issues/160","id":151103567,"user":{"login":"JuliusSweetland","id":4722561,"avatar_url":"https://avatars.githubusercontent.com/u/4722561?v=3","gravatar_id":"","url":"https://api.github.com/users/JuliusSweetland","html_url":"https://github.com/JuliusSweetland","followers_url":"https://api.github.com/users/JuliusSweetland/followers","following_url":"https://api.github.com/users/JuliusSweetland/following{/other_user}","gists_url":"https://api.github.com/users/JuliusSweetland/gists{/gist_id}","starred_url":"https://api.github.com/users/JuliusSweetland/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JuliusSweetland/subscriptions","organizations_url":"https://api.github.com/users/JuliusSweetland/orgs","repos_url":"https://api.github.com/users/JuliusSweetland/repos","events_url":"https://api.github.com/users/JuliusSweetland/events{/privacy}","received_events_url":"https://api.github.com/users/JuliusSweetland/received_events","type":"User","site_admin":false},"created_at":"2015-10-26T11:16:06Z","updated_at":"2015-10-26T11:16:06Z","body":"I very much like what you've done here! Thank you. I am very interested in continuing down this path if you have any more time?"}}