{"action":"created","comment":{"url":"https://api.github.com/repos/pinkeyyy/monogamelib/pulls/comments/48679718","id":48679718,"diff_hunk":"@@ -0,0 +1,145 @@\n+﻿using Microsoft.VisualStudio.TestTools.UnitTesting;\n+using Microsoft.Xna.Framework;\n+using monogamelib;\n+using monogamelib.SceneManager;\n+using monogamelib.SceneManager.Object;\n+using monogamelib.SceneManager.Object.Fakes;\n+using System;\n+using System.Collections.Generic;\n+using System.Linq;\n+using System.Text;\n+using System.Threading.Tasks;\n+\n+namespace monogamelib_test\n+{\n+    [TestClass]\n+    public class SceneManagerServiceTest\n+    {\n+        [TestInitialize]\n+        public void setupTest()\n+        {\n+            ExtendedGame game = new ExtendedGame();\n+        }\n+\n+        [TestCleanup]\n+        public void cleanUpTest()\n+        {\n+            ExtendedGame.Instance.Clear();\n+        }\n+\n+        [TestMethod]\n+        public void canSetScene()\n+        {\n+            Scene scene = new StubScene();\n+\n+            SceneManagerService.setScene(scene);\n+\n+            Assert.AreEqual(scene, SceneManagerService.getScene());\n+        }\n+\n+        [TestMethod]\n+        public void willCallSceneLoadWhenSetForTheFirstTimeUsingTheSameScene()\n+        {\n+            int calledLoadCount = 0;\n+\n+            Scene scene = new StubScene()\n+            {\n+                OnLoad01 = () => { calledLoadCount++; }\n+            };\n+\n+            SceneManagerService.setScene(scene);\n+            SceneManagerService.setScene(scene);\n+\n+            Assert.AreEqual(1, calledLoadCount);\n+        }\n+\n+        [TestMethod]\n+        public void willCallSceneLoadWhenSetForTheFirstTimeUsingDifferentScenes()\n+        {\n+            int calledScene1LoadCount = 0;\n+            int calledScene2LoadCount = 0;\n+\n+            Scene scene1 = new StubScene()\n+            {\n+                OnLoad01 = () => { calledScene1LoadCount++; }\n+            };\n+\n+            Scene scene2 = new StubScene()\n+            {\n+                OnLoad01 = () => { calledScene2LoadCount++; }\n+            };\n+\n+            SceneManagerService.setScene(scene1);\n+            SceneManagerService.setScene(scene2);\n+            SceneManagerService.setScene(scene1);\n+            SceneManagerService.setScene(scene2);\n+\n+            Assert.AreEqual(1, calledScene1LoadCount);\n+            Assert.AreEqual(1, calledScene2LoadCount);\n+        }\n+\n+        [TestMethod]\n+        public void willCallSceneShowEachTimeSet()\n+        {\n+            int calledShowCount = 0;\n+\n+            Scene scene = new StubScene()\n+            {\n+                OnShow01 = () => { calledShowCount++; }\n+            };\n+\n+            SceneManagerService.setScene(scene);\n+            SceneManagerService.setScene(scene);\n+\n+            Assert.AreEqual(2, calledShowCount);\n+        }\n+\n+        [TestMethod]\n+        public void willCallSceneHideIfOneAlreadySet()\n+        {\n+            int calledHideCount = 0;\n+\n+            Scene scene = new StubScene()\n+            {\n+                OnHide01 = () => { calledHideCount++; }\n+            };\n+\n+            SceneManagerService.setScene(scene);\n+            SceneManagerService.setScene(null);\n+\n+            Assert.AreEqual(1, calledHideCount);\n+        }\n+\n+        [TestMethod]\n+        public void willCallUpdateOnSceneWhenActive()\n+        {\n+            Boolean calledUpdate = false;\n+\n+            Scene scene = new StubScene()\n+            {\n+                UpdateGameTime = (gameTime) => { calledUpdate = true; }\n+            };\n+\n+            SceneManagerService.setScene(scene);\n+            SceneManagerService.Update(null);\n+\n+            Assert.AreEqual(true, calledUpdate);\n+        }\n+\n+        [TestMethod]\n+        public void willCallDrawOnSceneWhenActive()","path":"src/monogamelib_test/SceneManagerServiceTest.cs","position":130,"original_position":130,"commit_id":"a5aab5c5667b5840d8c95263317a1e7f459ef15b","original_commit_id":"a5aab5c5667b5840d8c95263317a1e7f459ef15b","user":{"login":"pinkeyyy","id":11392208,"avatar_url":"https://avatars.githubusercontent.com/u/11392208?v=3","gravatar_id":"","url":"https://api.github.com/users/pinkeyyy","html_url":"https://github.com/pinkeyyy","followers_url":"https://api.github.com/users/pinkeyyy/followers","following_url":"https://api.github.com/users/pinkeyyy/following{/other_user}","gists_url":"https://api.github.com/users/pinkeyyy/gists{/gist_id}","starred_url":"https://api.github.com/users/pinkeyyy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pinkeyyy/subscriptions","organizations_url":"https://api.github.com/users/pinkeyyy/orgs","repos_url":"https://api.github.com/users/pinkeyyy/repos","events_url":"https://api.github.com/users/pinkeyyy/events{/privacy}","received_events_url":"https://api.github.com/users/pinkeyyy/received_events","type":"User","site_admin":false},"body":"Add two more tests for these scenarios to make sure that update and draw are called for the correct scenes and not just the first one we give it. i.e stub out update/draw, set the scene to another and make sure that update/draw are not called for that scene.","created_at":"2016-01-01T19:18:29Z","updated_at":"2016-01-01T19:18:29Z","html_url":"https://github.com/pinkeyyy/monogamelib/pull/2#discussion_r48679718","pull_request_url":"https://api.github.com/repos/pinkeyyy/monogamelib/pulls/2","_links":{"self":{"href":"https://api.github.com/repos/pinkeyyy/monogamelib/pulls/comments/48679718"},"html":{"href":"https://github.com/pinkeyyy/monogamelib/pull/2#discussion_r48679718"},"pull_request":{"href":"https://api.github.com/repos/pinkeyyy/monogamelib/pulls/2"}}},"pull_request":{"url":"https://api.github.com/repos/pinkeyyy/monogamelib/pulls/2","id":54895136,"html_url":"https://github.com/pinkeyyy/monogamelib/pull/2","diff_url":"https://github.com/pinkeyyy/monogamelib/pull/2.diff","patch_url":"https://github.com/pinkeyyy/monogamelib/pull/2.patch","issue_url":"https://api.github.com/repos/pinkeyyy/monogamelib/issues/2","number":2,"state":"open","locked":false,"title":"Feature/scene manager","user":{"login":"pinkeyyy","id":11392208,"avatar_url":"https://avatars.githubusercontent.com/u/11392208?v=3","gravatar_id":"","url":"https://api.github.com/users/pinkeyyy","html_url":"https://github.com/pinkeyyy","followers_url":"https://api.github.com/users/pinkeyyy/followers","following_url":"https://api.github.com/users/pinkeyyy/following{/other_user}","gists_url":"https://api.github.com/users/pinkeyyy/gists{/gist_id}","starred_url":"https://api.github.com/users/pinkeyyy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pinkeyyy/subscriptions","organizations_url":"https://api.github.com/users/pinkeyyy/orgs","repos_url":"https://api.github.com/users/pinkeyyy/repos","events_url":"https://api.github.com/users/pinkeyyy/events{/privacy}","received_events_url":"https://api.github.com/users/pinkeyyy/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-01-01T19:16:29Z","updated_at":"2016-01-01T19:18:29Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c7f5d63fe745fcc1f19da0c8eaf44fe7cd781a3f","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/pinkeyyy/monogamelib/pulls/2/commits","review_comments_url":"https://api.github.com/repos/pinkeyyy/monogamelib/pulls/2/comments","review_comment_url":"https://api.github.com/repos/pinkeyyy/monogamelib/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pinkeyyy/monogamelib/issues/2/comments","statuses_url":"https://api.github.com/repos/pinkeyyy/monogamelib/statuses/a5aab5c5667b5840d8c95263317a1e7f459ef15b","head":{"label":"pinkeyyy:feature/scene-manager","ref":"feature/scene-manager","sha":"a5aab5c5667b5840d8c95263317a1e7f459ef15b","user":{"login":"pinkeyyy","id":11392208,"avatar_url":"https://avatars.githubusercontent.com/u/11392208?v=3","gravatar_id":"","url":"https://api.github.com/users/pinkeyyy","html_url":"https://github.com/pinkeyyy","followers_url":"https://api.github.com/users/pinkeyyy/followers","following_url":"https://api.github.com/users/pinkeyyy/following{/other_user}","gists_url":"https://api.github.com/users/pinkeyyy/gists{/gist_id}","starred_url":"https://api.github.com/users/pinkeyyy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pinkeyyy/subscriptions","organizations_url":"https://api.github.com/users/pinkeyyy/orgs","repos_url":"https://api.github.com/users/pinkeyyy/repos","events_url":"https://api.github.com/users/pinkeyyy/events{/privacy}","received_events_url":"https://api.github.com/users/pinkeyyy/received_events","type":"User","site_admin":false},"repo":{"id":48846161,"name":"monogamelib","full_name":"pinkeyyy/monogamelib","owner":{"login":"pinkeyyy","id":11392208,"avatar_url":"https://avatars.githubusercontent.com/u/11392208?v=3","gravatar_id":"","url":"https://api.github.com/users/pinkeyyy","html_url":"https://github.com/pinkeyyy","followers_url":"https://api.github.com/users/pinkeyyy/followers","following_url":"https://api.github.com/users/pinkeyyy/following{/other_user}","gists_url":"https://api.github.com/users/pinkeyyy/gists{/gist_id}","starred_url":"https://api.github.com/users/pinkeyyy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pinkeyyy/subscriptions","organizations_url":"https://api.github.com/users/pinkeyyy/orgs","repos_url":"https://api.github.com/users/pinkeyyy/repos","events_url":"https://api.github.com/users/pinkeyyy/events{/privacy}","received_events_url":"https://api.github.com/users/pinkeyyy/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/pinkeyyy/monogamelib","description":"","fork":false,"url":"https://api.github.com/repos/pinkeyyy/monogamelib","forks_url":"https://api.github.com/repos/pinkeyyy/monogamelib/forks","keys_url":"https://api.github.com/repos/pinkeyyy/monogamelib/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pinkeyyy/monogamelib/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pinkeyyy/monogamelib/teams","hooks_url":"https://api.github.com/repos/pinkeyyy/monogamelib/hooks","issue_events_url":"https://api.github.com/repos/pinkeyyy/monogamelib/issues/events{/number}","events_url":"https://api.github.com/repos/pinkeyyy/monogamelib/events","assignees_url":"https://api.github.com/repos/pinkeyyy/monogamelib/assignees{/user}","branches_url":"https://api.github.com/repos/pinkeyyy/monogamelib/branches{/branch}","tags_url":"https://api.github.com/repos/pinkeyyy/monogamelib/tags","blobs_url":"https://api.github.com/repos/pinkeyyy/monogamelib/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pinkeyyy/monogamelib/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pinkeyyy/monogamelib/git/refs{/sha}","trees_url":"https://api.github.com/repos/pinkeyyy/monogamelib/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pinkeyyy/monogamelib/statuses/{sha}","languages_url":"https://api.github.com/repos/pinkeyyy/monogamelib/languages","stargazers_url":"https://api.github.com/repos/pinkeyyy/monogamelib/stargazers","contributors_url":"https://api.github.com/repos/pinkeyyy/monogamelib/contributors","subscribers_url":"https://api.github.com/repos/pinkeyyy/monogamelib/subscribers","subscription_url":"https://api.github.com/repos/pinkeyyy/monogamelib/subscription","commits_url":"https://api.github.com/repos/pinkeyyy/monogamelib/commits{/sha}","git_commits_url":"https://api.github.com/repos/pinkeyyy/monogamelib/git/commits{/sha}","comments_url":"https://api.github.com/repos/pinkeyyy/monogamelib/comments{/number}","issue_comment_url":"https://api.github.com/repos/pinkeyyy/monogamelib/issues/comments{/number}","contents_url":"https://api.github.com/repos/pinkeyyy/monogamelib/contents/{+path}","compare_url":"https://api.github.com/repos/pinkeyyy/monogamelib/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pinkeyyy/monogamelib/merges","archive_url":"https://api.github.com/repos/pinkeyyy/monogamelib/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pinkeyyy/monogamelib/downloads","issues_url":"https://api.github.com/repos/pinkeyyy/monogamelib/issues{/number}","pulls_url":"https://api.github.com/repos/pinkeyyy/monogamelib/pulls{/number}","milestones_url":"https://api.github.com/repos/pinkeyyy/monogamelib/milestones{/number}","notifications_url":"https://api.github.com/repos/pinkeyyy/monogamelib/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pinkeyyy/monogamelib/labels{/name}","releases_url":"https://api.github.com/repos/pinkeyyy/monogamelib/releases{/id}","created_at":"2015-12-31T10:41:28Z","updated_at":"2015-12-31T16:12:28Z","pushed_at":"2016-01-01T19:16:29Z","git_url":"git://github.com/pinkeyyy/monogamelib.git","ssh_url":"git@github.com:pinkeyyy/monogamelib.git","clone_url":"https://github.com/pinkeyyy/monogamelib.git","svn_url":"https://github.com/pinkeyyy/monogamelib","homepage":null,"size":27,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"develop"}},"base":{"label":"pinkeyyy:develop","ref":"develop","sha":"6d660e441ed0353fe00fec28c68e12be2f2e900f","user":{"login":"pinkeyyy","id":11392208,"avatar_url":"https://avatars.githubusercontent.com/u/11392208?v=3","gravatar_id":"","url":"https://api.github.com/users/pinkeyyy","html_url":"https://github.com/pinkeyyy","followers_url":"https://api.github.com/users/pinkeyyy/followers","following_url":"https://api.github.com/users/pinkeyyy/following{/other_user}","gists_url":"https://api.github.com/users/pinkeyyy/gists{/gist_id}","starred_url":"https://api.github.com/users/pinkeyyy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pinkeyyy/subscriptions","organizations_url":"https://api.github.com/users/pinkeyyy/orgs","repos_url":"https://api.github.com/users/pinkeyyy/repos","events_url":"https://api.github.com/users/pinkeyyy/events{/privacy}","received_events_url":"https://api.github.com/users/pinkeyyy/received_events","type":"User","site_admin":false},"repo":{"id":48846161,"name":"monogamelib","full_name":"pinkeyyy/monogamelib","owner":{"login":"pinkeyyy","id":11392208,"avatar_url":"https://avatars.githubusercontent.com/u/11392208?v=3","gravatar_id":"","url":"https://api.github.com/users/pinkeyyy","html_url":"https://github.com/pinkeyyy","followers_url":"https://api.github.com/users/pinkeyyy/followers","following_url":"https://api.github.com/users/pinkeyyy/following{/other_user}","gists_url":"https://api.github.com/users/pinkeyyy/gists{/gist_id}","starred_url":"https://api.github.com/users/pinkeyyy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pinkeyyy/subscriptions","organizations_url":"https://api.github.com/users/pinkeyyy/orgs","repos_url":"https://api.github.com/users/pinkeyyy/repos","events_url":"https://api.github.com/users/pinkeyyy/events{/privacy}","received_events_url":"https://api.github.com/users/pinkeyyy/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/pinkeyyy/monogamelib","description":"","fork":false,"url":"https://api.github.com/repos/pinkeyyy/monogamelib","forks_url":"https://api.github.com/repos/pinkeyyy/monogamelib/forks","keys_url":"https://api.github.com/repos/pinkeyyy/monogamelib/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pinkeyyy/monogamelib/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pinkeyyy/monogamelib/teams","hooks_url":"https://api.github.com/repos/pinkeyyy/monogamelib/hooks","issue_events_url":"https://api.github.com/repos/pinkeyyy/monogamelib/issues/events{/number}","events_url":"https://api.github.com/repos/pinkeyyy/monogamelib/events","assignees_url":"https://api.github.com/repos/pinkeyyy/monogamelib/assignees{/user}","branches_url":"https://api.github.com/repos/pinkeyyy/monogamelib/branches{/branch}","tags_url":"https://api.github.com/repos/pinkeyyy/monogamelib/tags","blobs_url":"https://api.github.com/repos/pinkeyyy/monogamelib/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pinkeyyy/monogamelib/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pinkeyyy/monogamelib/git/refs{/sha}","trees_url":"https://api.github.com/repos/pinkeyyy/monogamelib/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pinkeyyy/monogamelib/statuses/{sha}","languages_url":"https://api.github.com/repos/pinkeyyy/monogamelib/languages","stargazers_url":"https://api.github.com/repos/pinkeyyy/monogamelib/stargazers","contributors_url":"https://api.github.com/repos/pinkeyyy/monogamelib/contributors","subscribers_url":"https://api.github.com/repos/pinkeyyy/monogamelib/subscribers","subscription_url":"https://api.github.com/repos/pinkeyyy/monogamelib/subscription","commits_url":"https://api.github.com/repos/pinkeyyy/monogamelib/commits{/sha}","git_commits_url":"https://api.github.com/repos/pinkeyyy/monogamelib/git/commits{/sha}","comments_url":"https://api.github.com/repos/pinkeyyy/monogamelib/comments{/number}","issue_comment_url":"https://api.github.com/repos/pinkeyyy/monogamelib/issues/comments{/number}","contents_url":"https://api.github.com/repos/pinkeyyy/monogamelib/contents/{+path}","compare_url":"https://api.github.com/repos/pinkeyyy/monogamelib/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pinkeyyy/monogamelib/merges","archive_url":"https://api.github.com/repos/pinkeyyy/monogamelib/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pinkeyyy/monogamelib/downloads","issues_url":"https://api.github.com/repos/pinkeyyy/monogamelib/issues{/number}","pulls_url":"https://api.github.com/repos/pinkeyyy/monogamelib/pulls{/number}","milestones_url":"https://api.github.com/repos/pinkeyyy/monogamelib/milestones{/number}","notifications_url":"https://api.github.com/repos/pinkeyyy/monogamelib/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pinkeyyy/monogamelib/labels{/name}","releases_url":"https://api.github.com/repos/pinkeyyy/monogamelib/releases{/id}","created_at":"2015-12-31T10:41:28Z","updated_at":"2015-12-31T16:12:28Z","pushed_at":"2016-01-01T19:16:29Z","git_url":"git://github.com/pinkeyyy/monogamelib.git","ssh_url":"git@github.com:pinkeyyy/monogamelib.git","clone_url":"https://github.com/pinkeyyy/monogamelib.git","svn_url":"https://github.com/pinkeyyy/monogamelib","homepage":null,"size":27,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/pinkeyyy/monogamelib/pulls/2"},"html":{"href":"https://github.com/pinkeyyy/monogamelib/pull/2"},"issue":{"href":"https://api.github.com/repos/pinkeyyy/monogamelib/issues/2"},"comments":{"href":"https://api.github.com/repos/pinkeyyy/monogamelib/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/pinkeyyy/monogamelib/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/pinkeyyy/monogamelib/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pinkeyyy/monogamelib/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/pinkeyyy/monogamelib/statuses/a5aab5c5667b5840d8c95263317a1e7f459ef15b"}}}}