GitHub PullRequestReviewCommentEvent at 2014-07-26 13:12:06
Repository: VisualFSharpPowerTools
Actor: vasily-kirichenko
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/fsprojects/VisualFSharpPowerTools/pulls/comments/15433777","id":15433777,"diff_hunk":"@@ -0,0 +1,120 @@\n+﻿[<RequireQualifiedAccess>]\n+module FSharpVSPowerTools.Tests.Mocks\n+\n+open System\n+open Microsoft.VisualStudio.Text\n+open Microsoft.VisualStudio.Utilities\n+open Microsoft.VisualStudio.Text.Classification\n+open FSharpVSPowerTools.ProjectSystem\n+open FSharpVSPowerTools\n+open Microsoft.FSharp.Compiler.SourceCodeServices\n+open Microsoft.VisualStudio.Editor\n+open Microsoft.VisualStudio.OLE.Interop\n+open Microsoft.VisualStudio.TextManager.Interop\n+open Microsoft.VisualStudio.Text.Editor\n+\n+/// Create a mock project by reading from a *.fsproj file\n+let createSingleFileProject(projectFileName: string) =","path":"tests/FSharpVSPowerTools.Tests/Mocks.fs","position":17,"original_position":17,"commit_id":"01957b0ade80a3b3e867f9809643ab718d5feca3","original_commit_id":"01957b0ade80a3b3e867f9809643ab718d5feca3","user":{"login":"vasily-kirichenko","id":873919,"avatar_url":"https://avatars.githubusercontent.com/u/873919?","gravatar_id":"a4a51ec4f2d92a22f04d2f03ee7fa2a9","url":"https://api.github.com/users/vasily-kirichenko","html_url":"https://github.com/vasily-kirichenko","followers_url":"https://api.github.com/users/vasily-kirichenko/followers","following_url":"https://api.github.com/users/vasily-kirichenko/following{/other_user}","gists_url":"https://api.github.com/users/vasily-kirichenko/gists{/gist_id}","starred_url":"https://api.github.com/users/vasily-kirichenko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vasily-kirichenko/subscriptions","organizations_url":"https://api.github.com/users/vasily-kirichenko/orgs","repos_url":"https://api.github.com/users/vasily-kirichenko/repos","events_url":"https://api.github.com/users/vasily-kirichenko/events{/privacy}","received_events_url":"https://api.github.com/users/vasily-kirichenko/received_events","type":"User","site_admin":false},"body":"Have you considered to use a mock library like RhinoMocks or Moq? If we plan to change behavior of these mocks from test to test, it will quickly become tedious to do it with object expressions.","created_at":"2014-07-26T13:12:06Z","updated_at":"2014-07-26T13:12:06Z","html_url":"https://github.com/fsprojects/VisualFSharpPowerTools/pull/593#discussion_r15433777","pull_request_url":"https://api.github.com/repos/fsprojects/VisualFSharpPowerTools/pulls/593","_links":{"self":{"href":"https://api.github.com/repos/fsprojects/VisualFSharpPowerTools/pulls/comments/15433777"},"html":{"href":"https://github.com/fsprojects/VisualFSharpPowerTools/pull/593#discussion_r15433777"},"pull_request":{"href":"https://api.github.com/repos/fsprojects/VisualFSharpPowerTools/pulls/593"}}},"pull_request":{"url":"https://api.github.com/repos/fsprojects/VisualFSharpPowerTools/pulls/593","id":18582020,"html_url":"https://github.com/fsprojects/VisualFSharpPowerTools/pull/593","diff_url":"https://github.com/fsprojects/VisualFSharpPowerTools/pull/593.diff","patch_url":"https://github.com/fsprojects/VisualFSharpPowerTools/pull/593.patch","issue_url":"https://api.github.com/repos/fsprojects/VisualFSharpPowerTools/issues/593","number":593,"state":"open","title":"Initial version of Visual Studio unit tests","user":{"login":"dungpa","id":941060,"avatar_url":"https://avatars.githubusercontent.com/u/941060?","gravatar_id":"8ed97e17be271ab53ada09addc1ef824","url":"https://api.github.com/users/dungpa","html_url":"https://github.com/dungpa","followers_url":"https://api.github.com/users/dungpa/followers","following_url":"https://api.github.com/users/dungpa/following{/other_user}","gists_url":"https://api.github.com/users/dungpa/gists{/gist_id}","starred_url":"https://api.github.com/users/dungpa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dungpa/subscriptions","organizations_url":"https://api.github.com/users/dungpa/orgs","repos_url":"https://api.github.com/users/dungpa/repos","events_url":"https://api.github.com/users/dungpa/events{/privacy}","received_events_url":"https://api.github.com/users/dungpa/received_events","type":"User","site_admin":false},"body":"Open the pull request for dicussion.\r\n\r\nI added the first test using `TestUtilities` project at https://pytools.codeplex.com/SourceControl/latest#Common/Tests/Utilities/Mocks/MockTextBuffer.cs.\r\n\r\nI'm able to construct `SyntaxConstructClassifier` instance for testing, but it requires a lot of stub generation. I hit a problem where I can't use `MockTextBuffer` from `TestUtilities` due to the error message:\r\n\r\n> Test method FSharpVSPowerTools.Tests.ClassifierTests+ClassifierTests.should be able to get classifier spans threw exception: \r\nSystem.InvalidCastException: Unable to cast object of type 'TestUtilities.Mocks.MockTextBuffer' to type 'Microsoft.VisualStudio.Text.ITextBuffer'.\r\n\r\nI had to resort to create a separate `MockTextBuffer` type in `FSharpVSPowerTools.Tests` project, which requires a lot of effort to match the same functionalities of the C# version. The error message is silly since TestUtilities.Mocks.MockTextBuffer implements Microsoft.VisualStudio.Text.ITextBuffer interface. Could it be a problem because I use this C# mock class in F#?\r\n\r\nCan someone take a look?","created_at":"2014-07-18T12:09:01Z","updated_at":"2014-07-26T13:12:06Z","closed_at":null,"merged_at":null,"merge_commit_sha":"26029d2197424e85481f879fd45626c371f1d97c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/fsprojects/VisualFSharpPowerTools/pulls/593/commits","review_comments_url":"https://api.github.com/repos/fsprojects/VisualFSharpPowerTools/pulls/593/comments","review_comment_url":"https://api.github.com/repos/fsprojects/VisualFSharpPowerTools/pulls/comments/{number}","comments_url":"https://api.github.com/repos/fsprojects/VisualFSharpPowerTools/issues/593/comments","statuses_url":"https://api.github.com/repos/fsprojects/VisualFSharpPowerTools/statuses/01957b0ade80a3b3e867f9809643ab718d5feca3","head":{"label":"dungpa:vs-tests","ref":"vs-tests","sha":"01957b0ade80a3b3e867f9809643ab718d5feca3","user":{"login":"dungpa","id":941060,"avatar_url":"https://avatars.githubusercontent.com/u/941060?","gravatar_id":"8ed97e17be271ab53ada09addc1ef824","url":"https://api.github.com/users/dungpa","html_url":"https://github.com/dungpa","followers_url":"https://api.github.com/users/dungpa/followers","following_url":"https://api.github.com/users/dungpa/following{/other_user}","gists_url":"https://api.github.com/users/dungpa/gists{/gist_id}","starred_url":"https://api.github.com/users/dungpa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dungpa/subscriptions","organizations_url":"https://api.github.com/users/dungpa/orgs","repos_url":"https://api.github.com/users/dungpa/repos","events_url":"https://api.github.com/users/dungpa/events{/privacy}","received_events_url":"https://api.github.com/users/dungpa/received_events","type":"User","site_admin":false},"repo":{"id":16625621,"name":"PowerTools","full_name":"dungpa/PowerTools","owner":{"login":"dungpa","id":941060,"avatar_url":"https://avatars.githubusercontent.com/u/941060?","gravatar_id":"8ed97e17be271ab53ada09addc1ef824","url":"https://api.github.com/users/dungpa","html_url":"https://github.com/dungpa","followers_url":"https://api.github.com/users/dungpa/followers","following_url":"https://api.github.com/users/dungpa/following{/other_user}","gists_url":"https://api.github.com/users/dungpa/gists{/gist_id}","starred_url":"https://api.github.com/users/dungpa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dungpa/subscriptions","organizations_url":"https://api.github.com/users/dungpa/orgs","repos_url":"https://api.github.com/users/dungpa/repos","events_url":"https://api.github.com/users/dungpa/events{/privacy}","received_events_url":"https://api.github.com/users/dungpa/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dungpa/PowerTools","description":"F# Community Power Tools (for Visual Studio)","fork":true,"url":"https://api.github.com/repos/dungpa/PowerTools","forks_url":"https://api.github.com/repos/dungpa/PowerTools/forks","keys_url":"https://api.github.com/repos/dungpa/PowerTools/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dungpa/PowerTools/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dungpa/PowerTools/teams","hooks_url":"https://api.github.com/repos/dungpa/PowerTools/hooks","issue_events_url":"https://api.github.com/repos/dungpa/PowerTools/issues/events{/number}","events_url":"https://api.github.com/repos/dungpa/PowerTools/events","assignees_url":"https://api.github.com/repos/dungpa/PowerTools/assignees{/user}","branches_url":"https://api.github.com/repos/dungpa/PowerTools/branches{/branch}","tags_url":"https://api.github.com/repos/dungpa/PowerTools/tags","blobs_url":"https://api.github.com/repos/dungpa/PowerTools/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dungpa/PowerTools/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dungpa/PowerTools/git/refs{/sha}","trees_url":"https://api.github.com/repos/dungpa/PowerTools/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dungpa/PowerTools/statuses/{sha}","languages_url":"https://api.github.com/repos/dungpa/PowerTools/languages","stargazers_url":"https://api.github.com/repos/dungpa/PowerTools/stargazers","contributors_url":"https://api.github.com/repos/dungpa/PowerTools/contributors","subscribers_url":"https://api.github.com/repos/dungpa/PowerTools/subscribers","subscription_url":"https://api.github.com/repos/dungpa/PowerTools/subscription","commits_url":"https://api.github.com/repos/dungpa/PowerTools/commits{/sha}","git_commits_url":"https://api.github.com/repos/dungpa/PowerTools/git/commits{/sha}","comments_url":"https://api.github.com/repos/dungpa/PowerTools/comments{/number}","issue_comment_url":"https://api.github.com/repos/dungpa/PowerTools/issues/comments/{number}","contents_url":"https://api.github.com/repos/dungpa/PowerTools/contents/{+path}","compare_url":"https://api.github.com/repos/dungpa/PowerTools/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dungpa/PowerTools/merges","archive_url":"https://api.github.com/repos/dungpa/PowerTools/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dungpa/PowerTools/downloads","issues_url":"https://api.github.com/repos/dungpa/PowerTools/issues{/number}","pulls_url":"https://api.github.com/repos/dungpa/PowerTools/pulls{/number}","milestones_url":"https://api.github.com/repos/dungpa/PowerTools/milestones{/number}","notifications_url":"https://api.github.com/repos/dungpa/PowerTools/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dungpa/PowerTools/labels{/name}","releases_url":"https://api.github.com/repos/dungpa/PowerTools/releases{/id}","created_at":"2014-02-07T19:51:43Z","updated_at":"2014-07-15T17:45:29Z","pushed_at":"2014-07-26T10:44:20Z","git_url":"git://github.com/dungpa/PowerTools.git","ssh_url":"git@github.com:dungpa/PowerTools.git","clone_url":"https://github.com/dungpa/PowerTools.git","svn_url":"https://github.com/dungpa/PowerTools","homepage":"http://fsprojects.github.io/FSharpVSPowerTools/","size":12114,"stargazers_count":0,"watchers_count":0,"language":"F#","has_issues":false,"has_downloads":true,"has_wiki":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"fsprojects:master","ref":"master","sha":"2b8c260add73b705ea1634a732aee7bd06eb42a9","user":{"login":"fsprojects","id":6001315,"avatar_url":"https://avatars.githubusercontent.com/u/6001315?","gravatar_id":"db0bc7081238324591d7f0d64373f13d","url":"https://api.github.com/users/fsprojects","html_url":"https://github.com/fsprojects","followers_url":"https://api.github.com/users/fsprojects/followers","following_url":"https://api.github.com/users/fsprojects/following{/other_user}","gists_url":"https://api.github.com/users/fsprojects/gists{/gist_id}","starred_url":"https://api.github.com/users/fsprojects/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fsprojects/subscriptions","organizations_url":"https://api.github.com/users/fsprojects/orgs","repos_url":"https://api.github.com/users/fsprojects/repos","events_url":"https://api.github.com/users/fsprojects/events{/privacy}","received_events_url":"https://api.github.com/users/fsprojects/received_events","type":"Organization","site_admin":false},"repo":{"id":16312934,"name":"VisualFSharpPowerTools","full_name":"fsprojects/VisualFSharpPowerTools","owner":{"login":"fsprojects","id":6001315,"avatar_url":"https://avatars.githubusercontent.com/u/6001315?","gravatar_id":"db0bc7081238324591d7f0d64373f13d","url":"https://api.github.com/users/fsprojects","html_url":"https://github.com/fsprojects","followers_url":"https://api.github.com/users/fsprojects/followers","following_url":"https://api.github.com/users/fsprojects/following{/other_user}","gists_url":"https://api.github.com/users/fsprojects/gists{/gist_id}","starred_url":"https://api.github.com/users/fsprojects/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fsprojects/subscriptions","organizations_url":"https://api.github.com/users/fsprojects/orgs","repos_url":"https://api.github.com/users/fsprojects/repos","events_url":"https://api.github.com/users/fsprojects/events{/privacy}","received_events_url":"https://api.github.com/users/fsprojects/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/fsprojects/VisualFSharpPowerTools","description":"Power commands for F# in Visual Studio","fork":false,"url":"https://api.github.com/repos/fsprojects/VisualFSharpPowerTools","forks_url":"https://api.github.com/repos/fsprojects/VisualFSharpPowerTools/forks","keys_url":"https://api.github.com/repos/fsprojects/VisualFSharpPowerTools/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fsprojects/VisualFSharpPowerTools/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fsprojects/VisualFSharpPowerTools/teams","hooks_url":"https://api.github.com/repos/fsprojects/VisualFSharpPowerTools/hooks","issue_events_url":"https://api.github.com/repos/fsprojects/VisualFSharpPowerTools/issues/events{/number}","events_url":"https://api.github.com/repos/fsprojects/VisualFSharpPowerTools/events","assignees_url":"https://api.github.com/repos/fsprojects/VisualFSharpPowerTools/assignees{/user}","branches_url":"https://api.github.com/repos/fsprojects/VisualFSharpPowerTools/branches{/branch}","tags_url":"https://api.github.com/repos/fsprojects/VisualFSharpPowerTools/tags","blobs_url":"https://api.github.com/repos/fsprojects/VisualFSharpPowerTools/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fsprojects/VisualFSharpPowerTools/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fsprojects/VisualFSharpPowerTools/git/refs{/sha}","trees_url":"https://api.github.com/repos/fsprojects/VisualFSharpPowerTools/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fsprojects/VisualFSharpPowerTools/statuses/{sha}","languages_url":"https://api.github.com/repos/fsprojects/VisualFSharpPowerTools/languages","stargazers_url":"https://api.github.com/repos/fsprojects/VisualFSharpPowerTools/stargazers","contributors_url":"https://api.github.com/repos/fsprojects/VisualFSharpPowerTools/contributors","subscribers_url":"https://api.github.com/repos/fsprojects/VisualFSharpPowerTools/subscribers","subscription_url":"https://api.github.com/repos/fsprojects/VisualFSharpPowerTools/subscription","commits_url":"https://api.github.com/repos/fsprojects/VisualFSharpPowerTools/commits{/sha}","git_commits_url":"https://api.github.com/repos/fsprojects/VisualFSharpPowerTools/git/commits{/sha}","comments_url":"https://api.github.com/repos/fsprojects/VisualFSharpPowerTools/comments{/number}","issue_comment_url":"https://api.github.com/repos/fsprojects/VisualFSharpPowerTools/issues/comments/{number}","contents_url":"https://api.github.com/repos/fsprojects/VisualFSharpPowerTools/contents/{+path}","compare_url":"https://api.github.com/repos/fsprojects/VisualFSharpPowerTools/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fsprojects/VisualFSharpPowerTools/merges","archive_url":"https://api.github.com/repos/fsprojects/VisualFSharpPowerTools/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fsprojects/VisualFSharpPowerTools/downloads","issues_url":"https://api.github.com/repos/fsprojects/VisualFSharpPowerTools/issues{/number}","pulls_url":"https://api.github.com/repos/fsprojects/VisualFSharpPowerTools/pulls{/number}","milestones_url":"https://api.github.com/repos/fsprojects/VisualFSharpPowerTools/milestones{/number}","notifications_url":"https://api.github.com/repos/fsprojects/VisualFSharpPowerTools/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fsprojects/VisualFSharpPowerTools/labels{/name}","releases_url":"https://api.github.com/repos/fsprojects/VisualFSharpPowerTools/releases{/id}","created_at":"2014-01-28T13:45:30Z","updated_at":"2014-07-24T19:33:40Z","pushed_at":"2014-07-24T10:08:44Z","git_url":"git://github.com/fsprojects/VisualFSharpPowerTools.git","ssh_url":"git@github.com:fsprojects/VisualFSharpPowerTools.git","clone_url":"https://github.com/fsprojects/VisualFSharpPowerTools.git","svn_url":"https://github.com/fsprojects/VisualFSharpPowerTools","homepage":"http://fsprojects.github.io/VisualFSharpPowerTools/","size":20359,"stargazers_count":97,"watchers_count":97,"language":"F#","has_issues":true,"has_downloads":true,"has_wiki":false,"forks_count":39,"mirror_url":null,"open_issues_count":26,"forks":39,"open_issues":26,"watchers":97,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/fsprojects/VisualFSharpPowerTools/pulls/593"},"html":{"href":"https://github.com/fsprojects/VisualFSharpPowerTools/pull/593"},"issue":{"href":"https://api.github.com/repos/fsprojects/VisualFSharpPowerTools/issues/593"},"comments":{"href":"https://api.github.com/repos/fsprojects/VisualFSharpPowerTools/issues/593/comments"},"review_comments":{"href":"https://api.github.com/repos/fsprojects/VisualFSharpPowerTools/pulls/593/comments"},"review_comment":{"href":"https://api.github.com/repos/fsprojects/VisualFSharpPowerTools/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/fsprojects/VisualFSharpPowerTools/pulls/593/commits"},"statuses":{"href":"https://api.github.com/repos/fsprojects/VisualFSharpPowerTools/statuses/01957b0ade80a3b3e867f9809643ab718d5feca3"}}}}