{"action":"created","comment":{"url":"https://api.github.com/repos/yreynhout/Projac/pulls/comments/59209256","id":59209256,"diff_hunk":"@@ -0,0 +1,146 @@\n+﻿namespace Paramol.Tests.SqlClient\n+{\n+    using System;\n+    using System.Data;\n+    using NUnit.Framework;\n+    using Paramol.SqlClient;\n+\n+    [TestFixture]\n+    public class TSqlDecimalValueTests\n+    {\n+        private TSqlDecimalValue _sut;\n+\n+        [SetUp]\n+        public void SetUp()\n+        {\n+            _sut = TSqlDecimalValue.Instance;\n+        }\n+\n+        [Test]\n+        public void IsSqlParameterValue()\n+        {\n+            var sut = SutFactory();\n+\n+            Assert.That(sut, Is.InstanceOf<IDbParameterValue>());\n+        }\n+\n+        [Test]\n+        public void ToDbParameterReturnsExpectedInstance()\n+        {\n+            const string parameterName = \"name\";\n+\n+            var sut = SutFactory(123.0m);\n+\n+            var result = sut.ToDbParameter(parameterName);\n+\n+            result.ExpectSqlParameter(parameterName, SqlDbType.Decimal, 123.0m, false, 0, 18, 1);\n+        }\n+\n+        [Test]\n+        public void ToSqlParameterReturnsExpectedInstance()\n+        {\n+            const string parameterName = \"name\";\n+\n+            var sut = SutFactory(123.0m);\n+\n+            var result = sut.ToSqlParameter(parameterName);\n+\n+            result.ExpectSqlParameter(parameterName, SqlDbType.Decimal, 123, false, 0, 18, 1);\n+        }\n+\n+        [Test]\n+        public void DoesEqualItself()\n+        {\n+            var sut = SutFactory();\n+            var instance = sut;\n+            Assert.That(sut.Equals(instance), Is.True);\n+        }\n+\n+        [Test]\n+        public void DoesNotEqualOtherObjectType()\n+        {\n+            var sut = SutFactory();\n+            Assert.That(sut.Equals(new object()), Is.False);\n+        }\n+\n+        [Test]\n+        public void DoesNotEqualNull()\n+        {\n+            var sut = SutFactory();\n+            Assert.That(sut.Equals(null), Is.False);\n+        }\n+\n+        [Test]\n+        public void TwoInstanceAreEqualIfTheyHaveTheSameValue()\n+        {\n+            var sut = SutFactory(123.0m);\n+            var other = SutFactory(123.0m);\n+            Assert.That(sut.Equals(other), Is.True);\n+        }\n+\n+        [Test]\n+        public void TwoInstanceAreNotEqualIfTheirValueDiffers()\n+        {\n+            var sut = SutFactory(123.0m);\n+            var other = SutFactory(456.0m);\n+            Assert.That(sut.Equals(other), Is.False);\n+        }\n+\n+        [Test]\n+        public void TwoInstanceHaveTheSameHashCodeIfTheyHaveTheSameValue()\n+        {\n+            var sut = SutFactory(123.0m);\n+            var other = SutFactory(123.0m);\n+            Assert.That(sut.GetHashCode().Equals(other.GetHashCode()), Is.True);\n+        }\n+\n+        [Test]\n+        public void TwoInstanceDoNotHaveTheSameHashCodeIfTheirValueDiffers()\n+        {\n+            var sut = SutFactory(123.0m);\n+            var other = SutFactory(456.0m);\n+            Assert.That(sut.GetHashCode().Equals(other.GetHashCode()), Is.False);\n+        }\n+\n+        [TestCase(0, false)]\n+        [TestCase(1, true)]\n+        [TestCase(38, true)]\n+        [TestCase(39, false)]\n+        public void PrecisionMustBeWithinRange(byte scale, bool withinRange)\n+        {\n+            if (!withinRange)\n+            {\n+                Assert.Throws<ArgumentOutOfRangeException>(() => SutFactory(123.0m, scale));\n+            }\n+            else\n+            {\n+                Assert.DoesNotThrow(() => SutFactory(123.0m, scale));\n+            }\n+        }\n+\n+        [TestCase(0, true)]\n+        [TestCase(8, true)]\n+        [TestCase(9, false)]\n+        public void ScaleMustBeWithinRange(byte scale, bool withinRange)\n+        {\n+            if (!withinRange)\n+            {\n+                Assert.Throws<ArgumentOutOfRangeException>(() => SutFactory(123.0m, 8, scale));\n+            }\n+            else\n+            {\n+                Assert.DoesNotThrow(() => SutFactory(123.0m, 8, scale));\n+            }\n+        }\n+\n+        private static TSqlDecimalValue SutFactory()\n+        {\n+            return SutFactory(123.0m);\n+        }\n+\n+        private static TSqlDecimalValue SutFactory(decimal value, byte presision = 18, byte scale = 0)","path":"src/Paramol.Tests/SqlClient/TSqlDecimalValueTests.cs","position":133,"original_position":141,"commit_id":"eb42aa2ab23f1f51d927f91eda0af89e8b2b2ce2","original_commit_id":"6edc82efe7814695a49c9a6308726b3fbc8801cb","user":{"login":"yreynhout","id":142834,"avatar_url":"https://avatars.githubusercontent.com/u/142834?v=3","gravatar_id":"","url":"https://api.github.com/users/yreynhout","html_url":"https://github.com/yreynhout","followers_url":"https://api.github.com/users/yreynhout/followers","following_url":"https://api.github.com/users/yreynhout/following{/other_user}","gists_url":"https://api.github.com/users/yreynhout/gists{/gist_id}","starred_url":"https://api.github.com/users/yreynhout/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yreynhout/subscriptions","organizations_url":"https://api.github.com/users/yreynhout/orgs","repos_url":"https://api.github.com/users/yreynhout/repos","events_url":"https://api.github.com/users/yreynhout/events{/privacy}","received_events_url":"https://api.github.com/users/yreynhout/received_events","type":"User","site_admin":false},"body":"Typo - presision => precision.","created_at":"2016-04-11T14:06:43Z","updated_at":"2016-04-11T14:06:43Z","html_url":"https://github.com/yreynhout/Projac/pull/22#discussion_r59209256","pull_request_url":"https://api.github.com/repos/yreynhout/Projac/pulls/22","_links":{"self":{"href":"https://api.github.com/repos/yreynhout/Projac/pulls/comments/59209256"},"html":{"href":"https://github.com/yreynhout/Projac/pull/22#discussion_r59209256"},"pull_request":{"href":"https://api.github.com/repos/yreynhout/Projac/pulls/22"}}},"pull_request":{"url":"https://api.github.com/repos/yreynhout/Projac/pulls/22","id":65988864,"html_url":"https://github.com/yreynhout/Projac/pull/22","diff_url":"https://github.com/yreynhout/Projac/pull/22.diff","patch_url":"https://github.com/yreynhout/Projac/pull/22.patch","issue_url":"https://api.github.com/repos/yreynhout/Projac/issues/22","number":22,"state":"open","locked":false,"title":"Adds The TSqlDecimalValue Data Type","user":{"login":"ritasker","id":344357,"avatar_url":"https://avatars.githubusercontent.com/u/344357?v=3","gravatar_id":"","url":"https://api.github.com/users/ritasker","html_url":"https://github.com/ritasker","followers_url":"https://api.github.com/users/ritasker/followers","following_url":"https://api.github.com/users/ritasker/following{/other_user}","gists_url":"https://api.github.com/users/ritasker/gists{/gist_id}","starred_url":"https://api.github.com/users/ritasker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ritasker/subscriptions","organizations_url":"https://api.github.com/users/ritasker/orgs","repos_url":"https://api.github.com/users/ritasker/repos","events_url":"https://api.github.com/users/ritasker/events{/privacy}","received_events_url":"https://api.github.com/users/ritasker/received_events","type":"User","site_admin":false},"body":"I have added tests for the new data type. Which\r\nalso include some validation tests to make sure\r\ninvalid objects can be created.","created_at":"2016-04-11T12:56:33Z","updated_at":"2016-04-11T14:06:43Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3f824a9c7b4d3b7bec15aead399659032c7264a7","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/yreynhout/Projac/pulls/22/commits","review_comments_url":"https://api.github.com/repos/yreynhout/Projac/pulls/22/comments","review_comment_url":"https://api.github.com/repos/yreynhout/Projac/pulls/comments{/number}","comments_url":"https://api.github.com/repos/yreynhout/Projac/issues/22/comments","statuses_url":"https://api.github.com/repos/yreynhout/Projac/statuses/eb42aa2ab23f1f51d927f91eda0af89e8b2b2ce2","head":{"label":"ritasker:DecimalDataType","ref":"DecimalDataType","sha":"eb42aa2ab23f1f51d927f91eda0af89e8b2b2ce2","user":{"login":"ritasker","id":344357,"avatar_url":"https://avatars.githubusercontent.com/u/344357?v=3","gravatar_id":"","url":"https://api.github.com/users/ritasker","html_url":"https://github.com/ritasker","followers_url":"https://api.github.com/users/ritasker/followers","following_url":"https://api.github.com/users/ritasker/following{/other_user}","gists_url":"https://api.github.com/users/ritasker/gists{/gist_id}","starred_url":"https://api.github.com/users/ritasker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ritasker/subscriptions","organizations_url":"https://api.github.com/users/ritasker/orgs","repos_url":"https://api.github.com/users/ritasker/repos","events_url":"https://api.github.com/users/ritasker/events{/privacy}","received_events_url":"https://api.github.com/users/ritasker/received_events","type":"User","site_admin":false},"repo":{"id":55786813,"name":"Projac","full_name":"ritasker/Projac","owner":{"login":"ritasker","id":344357,"avatar_url":"https://avatars.githubusercontent.com/u/344357?v=3","gravatar_id":"","url":"https://api.github.com/users/ritasker","html_url":"https://github.com/ritasker","followers_url":"https://api.github.com/users/ritasker/followers","following_url":"https://api.github.com/users/ritasker/following{/other_user}","gists_url":"https://api.github.com/users/ritasker/gists{/gist_id}","starred_url":"https://api.github.com/users/ritasker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ritasker/subscriptions","organizations_url":"https://api.github.com/users/ritasker/orgs","repos_url":"https://api.github.com/users/ritasker/repos","events_url":"https://api.github.com/users/ritasker/events{/privacy}","received_events_url":"https://api.github.com/users/ritasker/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ritasker/Projac","description":"A set of projection libraries","fork":true,"url":"https://api.github.com/repos/ritasker/Projac","forks_url":"https://api.github.com/repos/ritasker/Projac/forks","keys_url":"https://api.github.com/repos/ritasker/Projac/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ritasker/Projac/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ritasker/Projac/teams","hooks_url":"https://api.github.com/repos/ritasker/Projac/hooks","issue_events_url":"https://api.github.com/repos/ritasker/Projac/issues/events{/number}","events_url":"https://api.github.com/repos/ritasker/Projac/events","assignees_url":"https://api.github.com/repos/ritasker/Projac/assignees{/user}","branches_url":"https://api.github.com/repos/ritasker/Projac/branches{/branch}","tags_url":"https://api.github.com/repos/ritasker/Projac/tags","blobs_url":"https://api.github.com/repos/ritasker/Projac/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ritasker/Projac/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ritasker/Projac/git/refs{/sha}","trees_url":"https://api.github.com/repos/ritasker/Projac/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ritasker/Projac/statuses/{sha}","languages_url":"https://api.github.com/repos/ritasker/Projac/languages","stargazers_url":"https://api.github.com/repos/ritasker/Projac/stargazers","contributors_url":"https://api.github.com/repos/ritasker/Projac/contributors","subscribers_url":"https://api.github.com/repos/ritasker/Projac/subscribers","subscription_url":"https://api.github.com/repos/ritasker/Projac/subscription","commits_url":"https://api.github.com/repos/ritasker/Projac/commits{/sha}","git_commits_url":"https://api.github.com/repos/ritasker/Projac/git/commits{/sha}","comments_url":"https://api.github.com/repos/ritasker/Projac/comments{/number}","issue_comment_url":"https://api.github.com/repos/ritasker/Projac/issues/comments{/number}","contents_url":"https://api.github.com/repos/ritasker/Projac/contents/{+path}","compare_url":"https://api.github.com/repos/ritasker/Projac/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ritasker/Projac/merges","archive_url":"https://api.github.com/repos/ritasker/Projac/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ritasker/Projac/downloads","issues_url":"https://api.github.com/repos/ritasker/Projac/issues{/number}","pulls_url":"https://api.github.com/repos/ritasker/Projac/pulls{/number}","milestones_url":"https://api.github.com/repos/ritasker/Projac/milestones{/number}","notifications_url":"https://api.github.com/repos/ritasker/Projac/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ritasker/Projac/labels{/name}","releases_url":"https://api.github.com/repos/ritasker/Projac/releases{/id}","deployments_url":"https://api.github.com/repos/ritasker/Projac/deployments","created_at":"2016-04-08T14:51:36Z","updated_at":"2016-04-08T14:51:38Z","pushed_at":"2016-04-11T13:51:46Z","git_url":"git://github.com/ritasker/Projac.git","ssh_url":"git@github.com:ritasker/Projac.git","clone_url":"https://github.com/ritasker/Projac.git","svn_url":"https://github.com/ritasker/Projac","homepage":"","size":7701,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"yreynhout:master","ref":"master","sha":"ae548c2db875e186aa65aa00d471fb899d00fb28","user":{"login":"yreynhout","id":142834,"avatar_url":"https://avatars.githubusercontent.com/u/142834?v=3","gravatar_id":"","url":"https://api.github.com/users/yreynhout","html_url":"https://github.com/yreynhout","followers_url":"https://api.github.com/users/yreynhout/followers","following_url":"https://api.github.com/users/yreynhout/following{/other_user}","gists_url":"https://api.github.com/users/yreynhout/gists{/gist_id}","starred_url":"https://api.github.com/users/yreynhout/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yreynhout/subscriptions","organizations_url":"https://api.github.com/users/yreynhout/orgs","repos_url":"https://api.github.com/users/yreynhout/repos","events_url":"https://api.github.com/users/yreynhout/events{/privacy}","received_events_url":"https://api.github.com/users/yreynhout/received_events","type":"User","site_admin":false},"repo":{"id":8968639,"name":"Projac","full_name":"yreynhout/Projac","owner":{"login":"yreynhout","id":142834,"avatar_url":"https://avatars.githubusercontent.com/u/142834?v=3","gravatar_id":"","url":"https://api.github.com/users/yreynhout","html_url":"https://github.com/yreynhout","followers_url":"https://api.github.com/users/yreynhout/followers","following_url":"https://api.github.com/users/yreynhout/following{/other_user}","gists_url":"https://api.github.com/users/yreynhout/gists{/gist_id}","starred_url":"https://api.github.com/users/yreynhout/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yreynhout/subscriptions","organizations_url":"https://api.github.com/users/yreynhout/orgs","repos_url":"https://api.github.com/users/yreynhout/repos","events_url":"https://api.github.com/users/yreynhout/events{/privacy}","received_events_url":"https://api.github.com/users/yreynhout/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/yreynhout/Projac","description":"A set of projection libraries","fork":false,"url":"https://api.github.com/repos/yreynhout/Projac","forks_url":"https://api.github.com/repos/yreynhout/Projac/forks","keys_url":"https://api.github.com/repos/yreynhout/Projac/keys{/key_id}","collaborators_url":"https://api.github.com/repos/yreynhout/Projac/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/yreynhout/Projac/teams","hooks_url":"https://api.github.com/repos/yreynhout/Projac/hooks","issue_events_url":"https://api.github.com/repos/yreynhout/Projac/issues/events{/number}","events_url":"https://api.github.com/repos/yreynhout/Projac/events","assignees_url":"https://api.github.com/repos/yreynhout/Projac/assignees{/user}","branches_url":"https://api.github.com/repos/yreynhout/Projac/branches{/branch}","tags_url":"https://api.github.com/repos/yreynhout/Projac/tags","blobs_url":"https://api.github.com/repos/yreynhout/Projac/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/yreynhout/Projac/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/yreynhout/Projac/git/refs{/sha}","trees_url":"https://api.github.com/repos/yreynhout/Projac/git/trees{/sha}","statuses_url":"https://api.github.com/repos/yreynhout/Projac/statuses/{sha}","languages_url":"https://api.github.com/repos/yreynhout/Projac/languages","stargazers_url":"https://api.github.com/repos/yreynhout/Projac/stargazers","contributors_url":"https://api.github.com/repos/yreynhout/Projac/contributors","subscribers_url":"https://api.github.com/repos/yreynhout/Projac/subscribers","subscription_url":"https://api.github.com/repos/yreynhout/Projac/subscription","commits_url":"https://api.github.com/repos/yreynhout/Projac/commits{/sha}","git_commits_url":"https://api.github.com/repos/yreynhout/Projac/git/commits{/sha}","comments_url":"https://api.github.com/repos/yreynhout/Projac/comments{/number}","issue_comment_url":"https://api.github.com/repos/yreynhout/Projac/issues/comments{/number}","contents_url":"https://api.github.com/repos/yreynhout/Projac/contents/{+path}","compare_url":"https://api.github.com/repos/yreynhout/Projac/compare/{base}...{head}","merges_url":"https://api.github.com/repos/yreynhout/Projac/merges","archive_url":"https://api.github.com/repos/yreynhout/Projac/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/yreynhout/Projac/downloads","issues_url":"https://api.github.com/repos/yreynhout/Projac/issues{/number}","pulls_url":"https://api.github.com/repos/yreynhout/Projac/pulls{/number}","milestones_url":"https://api.github.com/repos/yreynhout/Projac/milestones{/number}","notifications_url":"https://api.github.com/repos/yreynhout/Projac/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/yreynhout/Projac/labels{/name}","releases_url":"https://api.github.com/repos/yreynhout/Projac/releases{/id}","deployments_url":"https://api.github.com/repos/yreynhout/Projac/deployments","created_at":"2013-03-23T10:21:01Z","updated_at":"2016-04-06T08:50:47Z","pushed_at":"2016-04-11T13:51:47Z","git_url":"git://github.com/yreynhout/Projac.git","ssh_url":"git@github.com:yreynhout/Projac.git","clone_url":"https://github.com/yreynhout/Projac.git","svn_url":"https://github.com/yreynhout/Projac","homepage":"","size":7691,"stargazers_count":55,"watchers_count":55,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":9,"mirror_url":null,"open_issues_count":6,"forks":9,"open_issues":6,"watchers":55,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/yreynhout/Projac/pulls/22"},"html":{"href":"https://github.com/yreynhout/Projac/pull/22"},"issue":{"href":"https://api.github.com/repos/yreynhout/Projac/issues/22"},"comments":{"href":"https://api.github.com/repos/yreynhout/Projac/issues/22/comments"},"review_comments":{"href":"https://api.github.com/repos/yreynhout/Projac/pulls/22/comments"},"review_comment":{"href":"https://api.github.com/repos/yreynhout/Projac/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/yreynhout/Projac/pulls/22/commits"},"statuses":{"href":"https://api.github.com/repos/yreynhout/Projac/statuses/eb42aa2ab23f1f51d927f91eda0af89e8b2b2ce2"}}}}