dougui5419 2019-04-25 01:29
浏览 174
已采纳

Uber Cadence:如何断言对工作流的调用(Sleep()?)?

In my unit tests, I want to assert that workflow.Sleep() was called. How do I do this?

  • 写回答

1条回答 默认 最新

  • doxp30826 2019-04-25 01:29
    关注

    It's possible to access the emulated time using the TestWorkflowEnvironment.Now() function. For example:

    before := testenv.Now()
    testenv.ExecuteWorkflow(...)
    after := testenv.Now()
    

    Then assert on the change between before and after.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?