{"action":"created","comment":{"url":"https://api.github.com/repos/DynamoDS/Dynamo/pulls/comments/34009189","id":34009189,"diff_hunk":"@@ -879,4 +880,147 @@ private void SelectAll(IEnumerable<NodeModel> nodes)\n             nodes.ToList().ForEach((ele) => DynamoSelection.Instance.Selection.Add(ele));\n         }\n     }\n+\n+    [Category(\"NodeToCode\")]\n+    class NodeToCodeSystemTest : DynamoModelTestBase\n+    {\n+        protected override void GetLibrariesToPreload(List<string> libraries)\n+        {\n+            libraries.Add(\"ProtoGeometry.dll\");\n+            base.GetLibrariesToPreload(libraries);\n+        }\n+\n+        private void SelectAll()\n+        {\n+            DynamoSelection.Instance.ClearSelection();\n+            foreach (var node in CurrentDynamoModel.CurrentWorkspace.Nodes)\n+            {\n+                DynamoSelection.Instance.Selection.Add(node); \n+            }\n+        }\n+\n+        private void SelectAllExcept(Guid excludedNode)\n+        {\n+            DynamoSelection.Instance.ClearSelection();\n+            foreach (var node in CurrentDynamoModel.CurrentWorkspace.Nodes)\n+            {\n+                if (node.GUID != excludedNode)\n+                    DynamoSelection.Instance.Selection.Add(node);\n+            }\n+        }\n+\n+        private string GetStringData(Guid guid)\n+        {\n+            var varName = GetVarName(guid);\n+            var mirror = GetRuntimeMirror(varName);\n+            Assert.IsNotNull(mirror);\n+            return mirror.GetStringData();\n+        }\n+\n+        private static string[] GetDynFiles(string folder)\n+        {\n+            var execDirectory = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);","path":"test/DynamoCoreTests/NodeToCodeTest.cs","position":51,"original_position":51,"commit_id":"0f455e2d690e2550f8e8d9cc1ddb29cd42c60af7","original_commit_id":"0f455e2d690e2550f8e8d9cc1ddb29cd42c60af7","user":{"login":"sharadkjaiswal","id":1754137,"avatar_url":"https://avatars.githubusercontent.com/u/1754137?v=3","gravatar_id":"","url":"https://api.github.com/users/sharadkjaiswal","html_url":"https://github.com/sharadkjaiswal","followers_url":"https://api.github.com/users/sharadkjaiswal/followers","following_url":"https://api.github.com/users/sharadkjaiswal/following{/other_user}","gists_url":"https://api.github.com/users/sharadkjaiswal/gists{/gist_id}","starred_url":"https://api.github.com/users/sharadkjaiswal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sharadkjaiswal/subscriptions","organizations_url":"https://api.github.com/users/sharadkjaiswal/orgs","repos_url":"https://api.github.com/users/sharadkjaiswal/repos","events_url":"https://api.github.com/users/sharadkjaiswal/events{/privacy}","received_events_url":"https://api.github.com/users/sharadkjaiswal/received_events","type":"User","site_admin":false},"body":"The base class should have TestDirectory property, you can use that.","created_at":"2015-07-07T05:44:02Z","updated_at":"2015-07-07T05:44:02Z","html_url":"https://github.com/DynamoDS/Dynamo/pull/4861#discussion_r34009189","pull_request_url":"https://api.github.com/repos/DynamoDS/Dynamo/pulls/4861","_links":{"self":{"href":"https://api.github.com/repos/DynamoDS/Dynamo/pulls/comments/34009189"},"html":{"href":"https://github.com/DynamoDS/Dynamo/pull/4861#discussion_r34009189"},"pull_request":{"href":"https://api.github.com/repos/DynamoDS/Dynamo/pulls/4861"}}},"pull_request":{"url":"https://api.github.com/repos/DynamoDS/Dynamo/pulls/4861","id":39333969,"html_url":"https://github.com/DynamoDS/Dynamo/pull/4861","diff_url":"https://github.com/DynamoDS/Dynamo/pull/4861.diff","patch_url":"https://github.com/DynamoDS/Dynamo/pull/4861.patch","issue_url":"https://api.github.com/repos/DynamoDS/Dynamo/issues/4861","number":4861,"state":"open","locked":false,"title":"Node to code test framework","user":{"login":"ke-yu","id":2600379,"avatar_url":"https://avatars.githubusercontent.com/u/2600379?v=3","gravatar_id":"","url":"https://api.github.com/users/ke-yu","html_url":"https://github.com/ke-yu","followers_url":"https://api.github.com/users/ke-yu/followers","following_url":"https://api.github.com/users/ke-yu/following{/other_user}","gists_url":"https://api.github.com/users/ke-yu/gists{/gist_id}","starred_url":"https://api.github.com/users/ke-yu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ke-yu/subscriptions","organizations_url":"https://api.github.com/users/ke-yu/orgs","repos_url":"https://api.github.com/users/ke-yu/repos","events_url":"https://api.github.com/users/ke-yu/events{/privacy}","received_events_url":"https://api.github.com/users/ke-yu/received_events","type":"User","site_admin":false},"body":"### Purpose\r\n\r\nThis PR adds node to code test framework.\r\n\r\nIt adds two kinds of tests: undo test and mutation test:\r\n  * For undo test, the test framework will iterate all .dyn files in test folder, and for each .dyn file, it will firstly run the graph to get all nodes' preview values (in string representation). Next step is to convert all nodes to code, run the graph and undo node to code operation, and re-run the graph. Then the test framework collects all nodes' current preview values and compare them with the previous values. This is to make sure undo operation will always bring the graph back to original state.\r\n  * Mutation test does the similar thing. But for each .dyn file, it will iterate all nodes. For each iteration, it converts all nodes to code except the one that it chooses, and compares the preview value of this one with its original preview value. This is to make sure node to code generate same result.\r\n\r\nTo add test cases, just drop some .dyn files either in `test\\core\\node2code\\undo` or in `test\\core\\node2code\\mutation`. Test framework will pick it up, see the picture below:\r\n\r\n![temp](https://cloud.githubusercontent.com/assets/2600379/8538747/df4c0ce6-24a3-11e5-83b3-068ffc461d7b.png)\r\n\r\n### Declarations\r\n\r\nCheck these if you believe they are true\r\n\r\n- [x] The code base is in a better state after this PR\r\n- [x] The level of testing this PR includes is appropriate\r\n- [x] User facing strings, if any, are extracted into `*.resx` files\r\n\r\n### Reviewers\r\n\r\n@monikaprabhu, @riteshchandawar \r\n","created_at":"2015-07-07T04:21:07Z","updated_at":"2015-07-07T05:44:02Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e6c959d50be110a36ac89be94b5aceb65f5e89f7","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/DynamoDS/Dynamo/pulls/4861/commits","review_comments_url":"https://api.github.com/repos/DynamoDS/Dynamo/pulls/4861/comments","review_comment_url":"https://api.github.com/repos/DynamoDS/Dynamo/pulls/comments{/number}","comments_url":"https://api.github.com/repos/DynamoDS/Dynamo/issues/4861/comments","statuses_url":"https://api.github.com/repos/DynamoDS/Dynamo/statuses/0f455e2d690e2550f8e8d9cc1ddb29cd42c60af7","head":{"label":"ke-yu:n2c-testframework","ref":"n2c-testframework","sha":"0f455e2d690e2550f8e8d9cc1ddb29cd42c60af7","user":{"login":"ke-yu","id":2600379,"avatar_url":"https://avatars.githubusercontent.com/u/2600379?v=3","gravatar_id":"","url":"https://api.github.com/users/ke-yu","html_url":"https://github.com/ke-yu","followers_url":"https://api.github.com/users/ke-yu/followers","following_url":"https://api.github.com/users/ke-yu/following{/other_user}","gists_url":"https://api.github.com/users/ke-yu/gists{/gist_id}","starred_url":"https://api.github.com/users/ke-yu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ke-yu/subscriptions","organizations_url":"https://api.github.com/users/ke-yu/orgs","repos_url":"https://api.github.com/users/ke-yu/repos","events_url":"https://api.github.com/users/ke-yu/events{/privacy}","received_events_url":"https://api.github.com/users/ke-yu/received_events","type":"User","site_admin":false},"repo":{"id":18300645,"name":"Dynamo","full_name":"ke-yu/Dynamo","owner":{"login":"ke-yu","id":2600379,"avatar_url":"https://avatars.githubusercontent.com/u/2600379?v=3","gravatar_id":"","url":"https://api.github.com/users/ke-yu","html_url":"https://github.com/ke-yu","followers_url":"https://api.github.com/users/ke-yu/followers","following_url":"https://api.github.com/users/ke-yu/following{/other_user}","gists_url":"https://api.github.com/users/ke-yu/gists{/gist_id}","starred_url":"https://api.github.com/users/ke-yu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ke-yu/subscriptions","organizations_url":"https://api.github.com/users/ke-yu/orgs","repos_url":"https://api.github.com/users/ke-yu/repos","events_url":"https://api.github.com/users/ke-yu/events{/privacy}","received_events_url":"https://api.github.com/users/ke-yu/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ke-yu/Dynamo","description":"Visual Programming For Revit","fork":true,"url":"https://api.github.com/repos/ke-yu/Dynamo","forks_url":"https://api.github.com/repos/ke-yu/Dynamo/forks","keys_url":"https://api.github.com/repos/ke-yu/Dynamo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ke-yu/Dynamo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ke-yu/Dynamo/teams","hooks_url":"https://api.github.com/repos/ke-yu/Dynamo/hooks","issue_events_url":"https://api.github.com/repos/ke-yu/Dynamo/issues/events{/number}","events_url":"https://api.github.com/repos/ke-yu/Dynamo/events","assignees_url":"https://api.github.com/repos/ke-yu/Dynamo/assignees{/user}","branches_url":"https://api.github.com/repos/ke-yu/Dynamo/branches{/branch}","tags_url":"https://api.github.com/repos/ke-yu/Dynamo/tags","blobs_url":"https://api.github.com/repos/ke-yu/Dynamo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ke-yu/Dynamo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ke-yu/Dynamo/git/refs{/sha}","trees_url":"https://api.github.com/repos/ke-yu/Dynamo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ke-yu/Dynamo/statuses/{sha}","languages_url":"https://api.github.com/repos/ke-yu/Dynamo/languages","stargazers_url":"https://api.github.com/repos/ke-yu/Dynamo/stargazers","contributors_url":"https://api.github.com/repos/ke-yu/Dynamo/contributors","subscribers_url":"https://api.github.com/repos/ke-yu/Dynamo/subscribers","subscription_url":"https://api.github.com/repos/ke-yu/Dynamo/subscription","commits_url":"https://api.github.com/repos/ke-yu/Dynamo/commits{/sha}","git_commits_url":"https://api.github.com/repos/ke-yu/Dynamo/git/commits{/sha}","comments_url":"https://api.github.com/repos/ke-yu/Dynamo/comments{/number}","issue_comment_url":"https://api.github.com/repos/ke-yu/Dynamo/issues/comments{/number}","contents_url":"https://api.github.com/repos/ke-yu/Dynamo/contents/{+path}","compare_url":"https://api.github.com/repos/ke-yu/Dynamo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ke-yu/Dynamo/merges","archive_url":"https://api.github.com/repos/ke-yu/Dynamo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ke-yu/Dynamo/downloads","issues_url":"https://api.github.com/repos/ke-yu/Dynamo/issues{/number}","pulls_url":"https://api.github.com/repos/ke-yu/Dynamo/pulls{/number}","milestones_url":"https://api.github.com/repos/ke-yu/Dynamo/milestones{/number}","notifications_url":"https://api.github.com/repos/ke-yu/Dynamo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ke-yu/Dynamo/labels{/name}","releases_url":"https://api.github.com/repos/ke-yu/Dynamo/releases{/id}","created_at":"2014-03-31T16:53:50Z","updated_at":"2014-06-26T05:45:55Z","pushed_at":"2015-07-07T04:12:15Z","git_url":"git://github.com/ke-yu/Dynamo.git","ssh_url":"git@github.com:ke-yu/Dynamo.git","clone_url":"https://github.com/ke-yu/Dynamo.git","svn_url":"https://github.com/ke-yu/Dynamo","homepage":"http://dynamobim.org","size":711173,"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":"DynamoDS:master","ref":"master","sha":"cbda4d7b73d0db021dffecb3164d2cf4a0c0e7b5","user":{"login":"DynamoDS","id":6528209,"avatar_url":"https://avatars.githubusercontent.com/u/6528209?v=3","gravatar_id":"","url":"https://api.github.com/users/DynamoDS","html_url":"https://github.com/DynamoDS","followers_url":"https://api.github.com/users/DynamoDS/followers","following_url":"https://api.github.com/users/DynamoDS/following{/other_user}","gists_url":"https://api.github.com/users/DynamoDS/gists{/gist_id}","starred_url":"https://api.github.com/users/DynamoDS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DynamoDS/subscriptions","organizations_url":"https://api.github.com/users/DynamoDS/orgs","repos_url":"https://api.github.com/users/DynamoDS/repos","events_url":"https://api.github.com/users/DynamoDS/events{/privacy}","received_events_url":"https://api.github.com/users/DynamoDS/received_events","type":"Organization","site_admin":false},"repo":{"id":3395179,"name":"Dynamo","full_name":"DynamoDS/Dynamo","owner":{"login":"DynamoDS","id":6528209,"avatar_url":"https://avatars.githubusercontent.com/u/6528209?v=3","gravatar_id":"","url":"https://api.github.com/users/DynamoDS","html_url":"https://github.com/DynamoDS","followers_url":"https://api.github.com/users/DynamoDS/followers","following_url":"https://api.github.com/users/DynamoDS/following{/other_user}","gists_url":"https://api.github.com/users/DynamoDS/gists{/gist_id}","starred_url":"https://api.github.com/users/DynamoDS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DynamoDS/subscriptions","organizations_url":"https://api.github.com/users/DynamoDS/orgs","repos_url":"https://api.github.com/users/DynamoDS/repos","events_url":"https://api.github.com/users/DynamoDS/events{/privacy}","received_events_url":"https://api.github.com/users/DynamoDS/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/DynamoDS/Dynamo","description":"Visual Programming","fork":false,"url":"https://api.github.com/repos/DynamoDS/Dynamo","forks_url":"https://api.github.com/repos/DynamoDS/Dynamo/forks","keys_url":"https://api.github.com/repos/DynamoDS/Dynamo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DynamoDS/Dynamo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DynamoDS/Dynamo/teams","hooks_url":"https://api.github.com/repos/DynamoDS/Dynamo/hooks","issue_events_url":"https://api.github.com/repos/DynamoDS/Dynamo/issues/events{/number}","events_url":"https://api.github.com/repos/DynamoDS/Dynamo/events","assignees_url":"https://api.github.com/repos/DynamoDS/Dynamo/assignees{/user}","branches_url":"https://api.github.com/repos/DynamoDS/Dynamo/branches{/branch}","tags_url":"https://api.github.com/repos/DynamoDS/Dynamo/tags","blobs_url":"https://api.github.com/repos/DynamoDS/Dynamo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DynamoDS/Dynamo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DynamoDS/Dynamo/git/refs{/sha}","trees_url":"https://api.github.com/repos/DynamoDS/Dynamo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DynamoDS/Dynamo/statuses/{sha}","languages_url":"https://api.github.com/repos/DynamoDS/Dynamo/languages","stargazers_url":"https://api.github.com/repos/DynamoDS/Dynamo/stargazers","contributors_url":"https://api.github.com/repos/DynamoDS/Dynamo/contributors","subscribers_url":"https://api.github.com/repos/DynamoDS/Dynamo/subscribers","subscription_url":"https://api.github.com/repos/DynamoDS/Dynamo/subscription","commits_url":"https://api.github.com/repos/DynamoDS/Dynamo/commits{/sha}","git_commits_url":"https://api.github.com/repos/DynamoDS/Dynamo/git/commits{/sha}","comments_url":"https://api.github.com/repos/DynamoDS/Dynamo/comments{/number}","issue_comment_url":"https://api.github.com/repos/DynamoDS/Dynamo/issues/comments{/number}","contents_url":"https://api.github.com/repos/DynamoDS/Dynamo/contents/{+path}","compare_url":"https://api.github.com/repos/DynamoDS/Dynamo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DynamoDS/Dynamo/merges","archive_url":"https://api.github.com/repos/DynamoDS/Dynamo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DynamoDS/Dynamo/downloads","issues_url":"https://api.github.com/repos/DynamoDS/Dynamo/issues{/number}","pulls_url":"https://api.github.com/repos/DynamoDS/Dynamo/pulls{/number}","milestones_url":"https://api.github.com/repos/DynamoDS/Dynamo/milestones{/number}","notifications_url":"https://api.github.com/repos/DynamoDS/Dynamo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DynamoDS/Dynamo/labels{/name}","releases_url":"https://api.github.com/repos/DynamoDS/Dynamo/releases{/id}","created_at":"2012-02-09T07:35:33Z","updated_at":"2015-07-05T07:51:41Z","pushed_at":"2015-07-07T04:22:00Z","git_url":"git://github.com/DynamoDS/Dynamo.git","ssh_url":"git@github.com:DynamoDS/Dynamo.git","clone_url":"https://github.com/DynamoDS/Dynamo.git","svn_url":"https://github.com/DynamoDS/Dynamo","homepage":"http://dynamobim.org","size":985699,"stargazers_count":238,"watchers_count":238,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":180,"mirror_url":null,"open_issues_count":654,"forks":180,"open_issues":654,"watchers":238,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/DynamoDS/Dynamo/pulls/4861"},"html":{"href":"https://github.com/DynamoDS/Dynamo/pull/4861"},"issue":{"href":"https://api.github.com/repos/DynamoDS/Dynamo/issues/4861"},"comments":{"href":"https://api.github.com/repos/DynamoDS/Dynamo/issues/4861/comments"},"review_comments":{"href":"https://api.github.com/repos/DynamoDS/Dynamo/pulls/4861/comments"},"review_comment":{"href":"https://api.github.com/repos/DynamoDS/Dynamo/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/DynamoDS/Dynamo/pulls/4861/commits"},"statuses":{"href":"https://api.github.com/repos/DynamoDS/Dynamo/statuses/0f455e2d690e2550f8e8d9cc1ddb29cd42c60af7"}}}}