{"action":"closed","issue":{"url":"https://api.github.com/repos/urasandesu/Prig/issues/40","labels_url":"https://api.github.com/repos/urasandesu/Prig/issues/40/labels{/name}","comments_url":"https://api.github.com/repos/urasandesu/Prig/issues/40/comments","events_url":"https://api.github.com/repos/urasandesu/Prig/issues/40/events","html_url":"https://github.com/urasandesu/Prig/issues/40","id":68947903,"number":40,"title":"Test engine crashes while trying to execute a unit test without indirections context even when it doesn't use any stubs","user":{"login":"korzenikov","id":3964122,"avatar_url":"https://avatars.githubusercontent.com/u/3964122?v=3","gravatar_id":"","url":"https://api.github.com/users/korzenikov","html_url":"https://github.com/korzenikov","followers_url":"https://api.github.com/users/korzenikov/followers","following_url":"https://api.github.com/users/korzenikov/following{/other_user}","gists_url":"https://api.github.com/users/korzenikov/gists{/gist_id}","starred_url":"https://api.github.com/users/korzenikov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/korzenikov/subscriptions","organizations_url":"https://api.github.com/users/korzenikov/orgs","repos_url":"https://api.github.com/users/korzenikov/repos","events_url":"https://api.github.com/users/korzenikov/events{/privacy}","received_events_url":"https://api.github.com/users/korzenikov/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/urasandesu/Prig/labels/bug","name":"bug","color":"e11d21"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-04-16T15:25:16Z","updated_at":"2015-05-27T21:19:17Z","closed_at":"2015-05-27T21:19:17Z","body":"Hi,\r\nI have a project with two unit tests - one of them uses a stub for DateTime.Now, the other one uses unstubbed DateTime.Now:\r\n\r\n    [TestClass]\r\n    public class UnitTest1\r\n    {\r\n        [TestMethod]\r\n        public void UseDateTimeWithoutStubs()\r\n        {\r\n            var dateTime = DateTime.Now;\r\n        }\r\n\r\n\r\n        [TestMethod]\r\n        public void UseDateTimeWithStubs()\r\n        {\r\n            using (new IndirectionsContext())\r\n            {\r\n                PDateTime.NowGet().Body = () => new DateTime(2013, 12, 13, 11, 00, 00);\r\n                var dateTime = DateTime.Now;\r\n            }\r\n        }\r\n    }\r\n\r\nSurprisingly,while the first test doesn't use any stubs at all, it makes execution engine crash. The issue is resolved if I use IndirectionsContext in this test, but it looks a little bit strange why a test that doesn't use Prig Stubs should use IndirectionsContext."}}