public async Task Throws_exception_when_workflow_history_events_are_queried_after_execution()
        {
            var hostedWorkflow  = new WorkflowCompleteOnSignal();
            var hostedWorkflows = new WorkflowHost(_domain, new[] { hostedWorkflow });
            var workflowTasks   = WorkflowTask.CreateFor(DecisionTasksWithSignalEvents("token"), _domain);
            await workflowTasks.ExecuteForAsync(hostedWorkflows);

            Assert.Throws <InvalidOperationException>(() => hostedWorkflow.AccessHistoryEvents());
        }
        public async Task Raise_workflow_closed_event_when_workflow_completed_decision_is_delivered_to_amazon_swf()
        {
            WorkflowClosedEventArgs eventArgs = null;
            var workflow = new WorkflowCompleteOnSignal("result");

            workflow.Closed += (s, e) => { eventArgs = e; };

            await ExecuteWorkflowOnSignalEvent(workflow, "wid", "runid");

            Assert.That(eventArgs, Is.Not.Null);
            Assert.That(eventArgs.WorkflowId, Is.EqualTo("wid"));
            Assert.That(eventArgs.WorkflowRunId, Is.EqualTo("runid"));
        }