Test helper method in workflow code

I have a use case similar to the example above. How can I unit test such a method?
The main issue is the inability to create a workflow context of my own

Use TestWorkflowEnvironment to test workflows or any part of the workflow.

@maxim, Do you mean by invoking it using the ExecuteWorkflow method? Would it work if it was a struct method instead?

Yes, it will work with the struct method as well. Another approach is to create an anonymous lambda which is registered with the TestWorkflowEnvironment and add all unit test-specific workflow code there.

	wFn := func(ctx workflow.Context) error {
        	// Any unit test specific initialization code
            return SendErrorResponse(...);
	}
	wfEnv = s.NewTestWorkflowEnvironment()
	wfEnv.RegisterWorkflow(wFn)
	wfEnv.ExecuteWorkflow(wFn)