{"action":"opened","issue":{"url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/issues/703","repository_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk","labels_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/issues/703/labels{/name}","comments_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/issues/703/comments","events_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/issues/703/events","html_url":"https://github.com/Azure/azure-webjobs-sdk/issues/703","id":151690378,"number":703,"title":"Unit test BrokeredMessage","user":{"login":"arthuronoszko","id":5484329,"avatar_url":"https://avatars.githubusercontent.com/u/5484329?v=3","gravatar_id":"","url":"https://api.github.com/users/arthuronoszko","html_url":"https://github.com/arthuronoszko","followers_url":"https://api.github.com/users/arthuronoszko/followers","following_url":"https://api.github.com/users/arthuronoszko/following{/other_user}","gists_url":"https://api.github.com/users/arthuronoszko/gists{/gist_id}","starred_url":"https://api.github.com/users/arthuronoszko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arthuronoszko/subscriptions","organizations_url":"https://api.github.com/users/arthuronoszko/orgs","repos_url":"https://api.github.com/users/arthuronoszko/repos","events_url":"https://api.github.com/users/arthuronoszko/events{/privacy}","received_events_url":"https://api.github.com/users/arthuronoszko/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-04-28T16:44:38Z","updated_at":"2016-04-28T16:44:38Z","closed_at":null,"body":"Hi!\r\n\r\nI have troubles writing unit tests of methods that uses BrokeredMessage, since I do not know how to set the state of the message. For example, I have message.Complete() inside a method that I want to test, but it  throws exceptions since the message is not in the correct state. Any ideas of how to fix this?\r\n\r\nThis is the exception I get: System.InvalidOperationException : Operation is not valid due to the current state of the object.\r\n\r\nBR\r\nArthur"}}