payload: {"action":"created","comment":{"url":"https://api.github.com/repos/kontur-courses/testing/pulls/comments/341275184","pull_request_review_id":310061421,"id":341275184,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDM0MTI3NTE4NA==","diff_hunk":"@@ -1,33 +1,80 @@\n-﻿using System;\n+using System;\n using System.Text.RegularExpressions;\n using FluentAssertions;\n using NUnit.Framework;\n+using NUnit.Framework.Internal;\n \n namespace HomeExercises\n {\n \tpublic class NumberValidatorTests\n \t{\n-\t\t[Test]\n-\t\tpublic void Test()\n+\t\t[TestCase(-123, 2, true, TestName = \"Scale < 0\")]\n+\t\tpublic void CreateValidator_ThrowWhenIncorrectInput_Scale(int precision, int scale, bool onlyPositive = true)\n \t\t{\n-\t\t\tAssert.Throws<ArgumentException>(() => new NumberValidator(-1, 2, true));\n-\t\t\tAssert.DoesNotThrow(() => new NumberValidator(1, 0, true));\n-\t\t\tAssert.Throws<ArgumentException>(() => new NumberValidator(-1, 2, false));\n-\t\t\tAssert.DoesNotThrow(() => new NumberValidator(1, 0, true));\n+\t\t\tAction act = () => new NumberValidator(precision, scale, onlyPositive);\n+\t\t\tact.ShouldThrow<ArgumentException>($\"scale {scale} isn't possible\");\n+\t\t}\n+\n+\t\t[TestCase(0, 2, true, TestName = \"Precision == 0\")]\n+\t\t[TestCase(-123, 2, true, TestName = \"Precision < 0\")]\n+\t\tpublic void CreateValidator_ThrowWhenIncorrectInput_Precision(int precision, int scale, bool onlyPositive)\n+\t\t{\n+\t\t\tAction act = () => new NumberValidator(precision, scale, onlyPositive);\n+\t\t\tact.ShouldThrow<ArgumentException>($\"precision {precision} isn't possible\");\n+\t\t}\n+\n+\t\t[TestCase(2, 2, true, TestName = \"Precision == Scale\")]\n+\t\t[TestCase(1, 2, true, TestName = \"Precision < Scale\")]\n+\t\tpublic void CreateValidator_ThrowWhenIncorrectInput_PrecisionAndScaleCompare(int precision, int scale, bool onlyPositive)\n+\t\t{\n+\t\t\tAction act = () => new NumberValidator(precision, scale, onlyPositive);\n+\t\t\tact.ShouldThrow<ArgumentException>($\"precision {precision} with scale {scale} isn't possible\");\n+\t\t}\n+\n+\t\t[Category(\"Correct Input\")]\n+\t\t[TestCase(3, 2, true, TestName = \"Typical constructor init\")]\n+\t\t[TestCase(10, 0, true, TestName = \"Scale zero in constructor\")]\n+\t\tpublic void CreateValidator_CorrectInput(int precision, int scale, bool onlyPositive)\n+\t\t{\n+\t\t\tAction act = () => new NumberValidator(precision, scale, onlyPositive);\n+\t\t\tact.ShouldNotThrow<ArgumentException>();\n+\t\t}\n+\n+\t\t[Category(\"Correct Input\")]\n+\t\t[TestCase(\"+1.23\", TestName = \"With plus symbol and fractional part\")]\n+\t\t[TestCase(\"-1.23\", TestName = \"With minus symbol and fractional part\")]\n+\t\t[TestCase(\"0\", TestName = \"Int part zero\")]\n+\t\t[TestCase(\"0.0\", TestName = \"Int and frac part zero\")]\n+\t\tpublic void IsValidNumber_CorrectInput(string value)\n+\t\t{\n+\t\t\tnew NumberValidator(5, 2, false).IsValidNumber(value).Should().BeTrue();\n+\t\t}\n \n-\t\t\tAssert.IsTrue(new NumberValidator(17, 2, true).IsValidNumber(\"0.0\"));\n-\t\t\tAssert.IsTrue(new NumberValidator(17, 2, true).IsValidNumber(\"0\"));\n-\t\t\tAssert.IsTrue(new NumberValidator(17, 2, true).IsValidNumber(\"0.0\"));\n-\t\t\tAssert.IsFalse(new NumberValidator(3, 2, true).IsValidNumber(\"00.00\"));\n-\t\t\tAssert.IsFalse(new NumberValidator(3, 2, true).IsValidNumber(\"-0.00\"));\n-\t\t\tAssert.IsTrue(new NumberValidator(17, 2, true).IsValidNumber(\"0.0\"));\n-\t\t\tAssert.IsFalse(new NumberValidator(3, 2, true).IsValidNumber(\"+0.00\"));\n-\t\t\tAssert.IsTrue(new NumberValidator(4, 2, true).IsValidNumber(\"+1.23\"));\n-\t\t\tAssert.IsFalse(new NumberValidator(3, 2, true).IsValidNumber(\"+1.23\"));\n-\t\t\tAssert.IsFalse(new NumberValidator(17, 2, true).IsValidNumber(\"0.000\"));\n-\t\t\tAssert.IsFalse(new NumberValidator(3, 2, true).IsValidNumber(\"-1.23\"));\n-\t\t\tAssert.IsFalse(new NumberValidator(3, 2, true).IsValidNumber(\"a.sd\"));\n+\t\t[Category(\"Incorrect parsing\")]\n+        \t[TestCase(\"\", TestName = \"Empty string\")]\n+\t\t[TestCase(null, TestName = \"Null input\")]\n+\t\t[TestCase(\"ad.s\", TestName = \"Other symbols input\")]\n+\t\t[TestCase(\"0..0\", TestName = \"Double point\")]\n+\t\t[TestCase(\"0.\", TestName = \"Empty frac part\")]\n+\t\t[TestCase(\".0\", TestName = \"Empty int part\")]\n+\t\t[TestCase(\"--0.0\", TestName = \"Double sign symbol\")]\n+\t\t\n+\t\tpublic void IsValidNumber_IncorrectInputString_ParseFalse(string value)\n+\t\t{\n+\t\t\tnew NumberValidator(3,2).IsValidNumber(value).Should().BeFalse();\n \t\t}\n+\n+\t\t[Category(\"Doesn't fit the value rule\")]\n+\t\t[TestCase(\"000.00\", TestName = \"Length more than precision\")]\n+\t\t[TestCase(\"00000\", TestName = \"Length more than precision without frac parth\")]","path":"cs/HomeExercises/NumberValidatorTests.cs","position":null,"original_position":88,"commit_id":"81ca7861b7ceb5a77eb515c5ce81b4f94a976afd","original_commit_id":"72edcf28a7866faebdc4913c3261980bccf026aa","user":{"login":"ArtyMgn","id":21121427,"node_id":"MDQ6VXNlcjIxMTIxNDI3","avatar_url":"https://avatars1.githubusercontent.com/u/21121427?v=4","gravatar_id":"","url":"https://api.github.com/users/ArtyMgn","html_url":"https://github.com/ArtyMgn","followers_url":"https://api.github.com/users/ArtyMgn/followers","following_url":"https://api.github.com/users/ArtyMgn/following{/other_user}","gists_url":"https://api.github.com/users/ArtyMgn/gists{/gist_id}","starred_url":"https://api.github.com/users/ArtyMgn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ArtyMgn/subscriptions","organizations_url":"https://api.github.com/users/ArtyMgn/orgs","repos_url":"https://api.github.com/users/ArtyMgn/repos","events_url":"https://api.github.com/users/ArtyMgn/events{/privacy}","received_events_url":"https://api.github.com/users/ArtyMgn/received_events","type":"User","site_admin":false},"body":":heavy_check_mark:","created_at":"2019-10-31T17:35:14Z","updated_at":"2019-10-31T17:35:15Z","html_url":"https://github.com/kontur-courses/testing/pull/95#discussion_r341275184","pull_request_url":"https://api.github.com/repos/kontur-courses/testing/pulls/95","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/kontur-courses/testing/pulls/comments/341275184"},"html":{"href":"https://github.com/kontur-courses/testing/pull/95#discussion_r341275184"},"pull_request":{"href":"https://api.github.com/repos/kontur-courses/testing/pulls/95"}},"in_reply_to_id":340433852},"pull_request":{"url":"https://api.github.com/repos/kontur-courses/testing/pulls/95","id":333639035,"node_id":"MDExOlB1bGxSZXF1ZXN0MzMzNjM5MDM1","html_url":"https://github.com/kontur-courses/testing/pull/95","diff_url":"https://github.com/kontur-courses/testing/pull/95.diff","patch_url":"https://github.com/kontur-courses/testing/pull/95.patch","issue_url":"https://api.github.com/repos/kontur-courses/testing/issues/95","number":95,"state":"open","locked":false,"title":"Сикачин Николай ","user":{"login":"EnergyNick","id":13437827,"node_id":"MDQ6VXNlcjEzNDM3ODI3","avatar_url":"https://avatars0.githubusercontent.com/u/13437827?v=4","gravatar_id":"","url":"https://api.github.com/users/EnergyNick","html_url":"https://github.com/EnergyNick","followers_url":"https://api.github.com/users/EnergyNick/followers","following_url":"https://api.github.com/users/EnergyNick/following{/other_user}","gists_url":"https://api.github.com/users/EnergyNick/gists{/gist_id}","starred_url":"https://api.github.com/users/EnergyNick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EnergyNick/subscriptions","organizations_url":"https://api.github.com/users/EnergyNick/orgs","repos_url":"https://api.github.com/users/EnergyNick/repos","events_url":"https://api.github.com/users/EnergyNick/events{/privacy}","received_events_url":"https://api.github.com/users/EnergyNick/received_events","type":"User","site_admin":false},"body":"@ArtyMgn","created_at":"2019-10-29T14:07:34Z","updated_at":"2019-10-31T17:35:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1fb5ecf2c05e4e1bcd98f93d3a3ef7d948b15d14","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/kontur-courses/testing/pulls/95/commits","review_comments_url":"https://api.github.com/repos/kontur-courses/testing/pulls/95/comments","review_comment_url":"https://api.github.com/repos/kontur-courses/testing/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kontur-courses/testing/issues/95/comments","statuses_url":"https://api.github.com/repos/kontur-courses/testing/statuses/81ca7861b7ceb5a77eb515c5ce81b4f94a976afd","head":{"label":"EnergyNick:master","ref":"master","sha":"81ca7861b7ceb5a77eb515c5ce81b4f94a976afd","user":{"login":"EnergyNick","id":13437827,"node_id":"MDQ6VXNlcjEzNDM3ODI3","avatar_url":"https://avatars0.githubusercontent.com/u/13437827?v=4","gravatar_id":"","url":"https://api.github.com/users/EnergyNick","html_url":"https://github.com/EnergyNick","followers_url":"https://api.github.com/users/EnergyNick/followers","following_url":"https://api.github.com/users/EnergyNick/following{/other_user}","gists_url":"https://api.github.com/users/EnergyNick/gists{/gist_id}","starred_url":"https://api.github.com/users/EnergyNick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EnergyNick/subscriptions","organizations_url":"https://api.github.com/users/EnergyNick/orgs","repos_url":"https://api.github.com/users/EnergyNick/repos","events_url":"https://api.github.com/users/EnergyNick/events{/privacy}","received_events_url":"https://api.github.com/users/EnergyNick/received_events","type":"User","site_admin":false},"repo":{"id":218299598,"node_id":"MDEwOlJlcG9zaXRvcnkyMTgyOTk1OTg=","name":"testing","full_name":"EnergyNick/testing","private":false,"owner":{"login":"EnergyNick","id":13437827,"node_id":"MDQ6VXNlcjEzNDM3ODI3","avatar_url":"https://avatars0.githubusercontent.com/u/13437827?v=4","gravatar_id":"","url":"https://api.github.com/users/EnergyNick","html_url":"https://github.com/EnergyNick","followers_url":"https://api.github.com/users/EnergyNick/followers","following_url":"https://api.github.com/users/EnergyNick/following{/other_user}","gists_url":"https://api.github.com/users/EnergyNick/gists{/gist_id}","starred_url":"https://api.github.com/users/EnergyNick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EnergyNick/subscriptions","organizations_url":"https://api.github.com/users/EnergyNick/orgs","repos_url":"https://api.github.com/users/EnergyNick/repos","events_url":"https://api.github.com/users/EnergyNick/events{/privacy}","received_events_url":"https://api.github.com/users/EnergyNick/received_events","type":"User","site_admin":false},"html_url":"https://github.com/EnergyNick/testing","description":null,"fork":true,"url":"https://api.github.com/repos/EnergyNick/testing","forks_url":"https://api.github.com/repos/EnergyNick/testing/forks","keys_url":"https://api.github.com/repos/EnergyNick/testing/keys{/key_id}","collaborators_url":"https://api.github.com/repos/EnergyNick/testing/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/EnergyNick/testing/teams","hooks_url":"https://api.github.com/repos/EnergyNick/testing/hooks","issue_events_url":"https://api.github.com/repos/EnergyNick/testing/issues/events{/number}","events_url":"https://api.github.com/repos/EnergyNick/testing/events","assignees_url":"https://api.github.com/repos/EnergyNick/testing/assignees{/user}","branches_url":"https://api.github.com/repos/EnergyNick/testing/branches{/branch}","tags_url":"https://api.github.com/repos/EnergyNick/testing/tags","blobs_url":"https://api.github.com/repos/EnergyNick/testing/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/EnergyNick/testing/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/EnergyNick/testing/git/refs{/sha}","trees_url":"https://api.github.com/repos/EnergyNick/testing/git/trees{/sha}","statuses_url":"https://api.github.com/repos/EnergyNick/testing/statuses/{sha}","languages_url":"https://api.github.com/repos/EnergyNick/testing/languages","stargazers_url":"https://api.github.com/repos/EnergyNick/testing/stargazers","contributors_url":"https://api.github.com/repos/EnergyNick/testing/contributors","subscribers_url":"https://api.github.com/repos/EnergyNick/testing/subscribers","subscription_url":"https://api.github.com/repos/EnergyNick/testing/subscription","commits_url":"https://api.github.com/repos/EnergyNick/testing/commits{/sha}","git_commits_url":"https://api.github.com/repos/EnergyNick/testing/git/commits{/sha}","comments_url":"https://api.github.com/repos/EnergyNick/testing/comments{/number}","issue_comment_url":"https://api.github.com/repos/EnergyNick/testing/issues/comments{/number}","contents_url":"https://api.github.com/repos/EnergyNick/testing/contents/{+path}","compare_url":"https://api.github.com/repos/EnergyNick/testing/compare/{base}...{head}","merges_url":"https://api.github.com/repos/EnergyNick/testing/merges","archive_url":"https://api.github.com/repos/EnergyNick/testing/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/EnergyNick/testing/downloads","issues_url":"https://api.github.com/repos/EnergyNick/testing/issues{/number}","pulls_url":"https://api.github.com/repos/EnergyNick/testing/pulls{/number}","milestones_url":"https://api.github.com/repos/EnergyNick/testing/milestones{/number}","notifications_url":"https://api.github.com/repos/EnergyNick/testing/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/EnergyNick/testing/labels{/name}","releases_url":"https://api.github.com/repos/EnergyNick/testing/releases{/id}","deployments_url":"https://api.github.com/repos/EnergyNick/testing/deployments","created_at":"2019-10-29T13:55:37Z","updated_at":"2019-10-31T13:03:32Z","pushed_at":"2019-10-31T13:03:30Z","git_url":"git://github.com/EnergyNick/testing.git","ssh_url":"git@github.com:EnergyNick/testing.git","clone_url":"https://github.com/EnergyNick/testing.git","svn_url":"https://github.com/EnergyNick/testing","homepage":null,"size":2841,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"kontur-courses:master","ref":"master","sha":"13375172c8789e9f80570f3ffcecf72f25995f0e","user":{"login":"kontur-courses","id":19208073,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE5MjA4MDcz","avatar_url":"https://avatars2.githubusercontent.com/u/19208073?v=4","gravatar_id":"","url":"https://api.github.com/users/kontur-courses","html_url":"https://github.com/kontur-courses","followers_url":"https://api.github.com/users/kontur-courses/followers","following_url":"https://api.github.com/users/kontur-courses/following{/other_user}","gists_url":"https://api.github.com/users/kontur-courses/gists{/gist_id}","starred_url":"https://api.github.com/users/kontur-courses/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kontur-courses/subscriptions","organizations_url":"https://api.github.com/users/kontur-courses/orgs","repos_url":"https://api.github.com/users/kontur-courses/repos","events_url":"https://api.github.com/users/kontur-courses/events{/privacy}","received_events_url":"https://api.github.com/users/kontur-courses/received_events","type":"Organization","site_admin":false},"repo":{"id":70393598,"node_id":"MDEwOlJlcG9zaXRvcnk3MDM5MzU5OA==","name":"testing","full_name":"kontur-courses/testing","private":false,"owner":{"login":"kontur-courses","id":19208073,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE5MjA4MDcz","avatar_url":"https://avatars2.githubusercontent.com/u/19208073?v=4","gravatar_id":"","url":"https://api.github.com/users/kontur-courses","html_url":"https://github.com/kontur-courses","followers_url":"https://api.github.com/users/kontur-courses/followers","following_url":"https://api.github.com/users/kontur-courses/following{/other_user}","gists_url":"https://api.github.com/users/kontur-courses/gists{/gist_id}","starred_url":"https://api.github.com/users/kontur-courses/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kontur-courses/subscriptions","organizations_url":"https://api.github.com/users/kontur-courses/orgs","repos_url":"https://api.github.com/users/kontur-courses/repos","events_url":"https://api.github.com/users/kontur-courses/events{/privacy}","received_events_url":"https://api.github.com/users/kontur-courses/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/kontur-courses/testing","description":null,"fork":false,"url":"https://api.github.com/repos/kontur-courses/testing","forks_url":"https://api.github.com/repos/kontur-courses/testing/forks","keys_url":"https://api.github.com/repos/kontur-courses/testing/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kontur-courses/testing/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kontur-courses/testing/teams","hooks_url":"https://api.github.com/repos/kontur-courses/testing/hooks","issue_events_url":"https://api.github.com/repos/kontur-courses/testing/issues/events{/number}","events_url":"https://api.github.com/repos/kontur-courses/testing/events","assignees_url":"https://api.github.com/repos/kontur-courses/testing/assignees{/user}","branches_url":"https://api.github.com/repos/kontur-courses/testing/branches{/branch}","tags_url":"https://api.github.com/repos/kontur-courses/testing/tags","blobs_url":"https://api.github.com/repos/kontur-courses/testing/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kontur-courses/testing/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kontur-courses/testing/git/refs{/sha}","trees_url":"https://api.github.com/repos/kontur-courses/testing/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kontur-courses/testing/statuses/{sha}","languages_url":"https://api.github.com/repos/kontur-courses/testing/languages","stargazers_url":"https://api.github.com/repos/kontur-courses/testing/stargazers","contributors_url":"https://api.github.com/repos/kontur-courses/testing/contributors","subscribers_url":"https://api.github.com/repos/kontur-courses/testing/subscribers","subscription_url":"https://api.github.com/repos/kontur-courses/testing/subscription","commits_url":"https://api.github.com/repos/kontur-courses/testing/commits{/sha}","git_commits_url":"https://api.github.com/repos/kontur-courses/testing/git/commits{/sha}","comments_url":"https://api.github.com/repos/kontur-courses/testing/comments{/number}","issue_comment_url":"https://api.github.com/repos/kontur-courses/testing/issues/comments{/number}","contents_url":"https://api.github.com/repos/kontur-courses/testing/contents/{+path}","compare_url":"https://api.github.com/repos/kontur-courses/testing/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kontur-courses/testing/merges","archive_url":"https://api.github.com/repos/kontur-courses/testing/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kontur-courses/testing/downloads","issues_url":"https://api.github.com/repos/kontur-courses/testing/issues{/number}","pulls_url":"https://api.github.com/repos/kontur-courses/testing/pulls{/number}","milestones_url":"https://api.github.com/repos/kontur-courses/testing/milestones{/number}","notifications_url":"https://api.github.com/repos/kontur-courses/testing/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kontur-courses/testing/labels{/name}","releases_url":"https://api.github.com/repos/kontur-courses/testing/releases{/id}","deployments_url":"https://api.github.com/repos/kontur-courses/testing/deployments","created_at":"2016-10-09T09:44:47Z","updated_at":"2019-10-26T09:37:24Z","pushed_at":"2019-10-31T17:34:15Z","git_url":"git://github.com/kontur-courses/testing.git","ssh_url":"git@github.com:kontur-courses/testing.git","clone_url":"https://github.com/kontur-courses/testing.git","svn_url":"https://github.com/kontur-courses/testing","homepage":null,"size":2831,"stargazers_count":8,"watchers_count":8,"language":"C#","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":130,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":40,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":130,"open_issues":40,"watchers":8,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kontur-courses/testing/pulls/95"},"html":{"href":"https://github.com/kontur-courses/testing/pull/95"},"issue":{"href":"https://api.github.com/repos/kontur-courses/testing/issues/95"},"comments":{"href":"https://api.github.com/repos/kontur-courses/testing/issues/95/comments"},"review_comments":{"href":"https://api.github.com/repos/kontur-courses/testing/pulls/95/comments"},"review_comment":{"href":"https://api.github.com/repos/kontur-courses/testing/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kontur-courses/testing/pulls/95/commits"},"statuses":{"href":"https://api.github.com/repos/kontur-courses/testing/statuses/81ca7861b7ceb5a77eb515c5ce81b4f94a976afd"}},"author_association":"NONE"}}
other: {"actor":{"display_login":"ArtyMgn"}}