Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在我的单元测试中,我想断言它workflow.Sleep()被调用了。我该怎么做呢?
workflow.Sleep()
可以使用该TestWorkflowEnvironment.Now()功能访问模拟时间。例如:
TestWorkflowEnvironment.Now()
before := testenv.Now() testenv.ExecuteWorkflow(...) after := testenv.Now()
before然后断言和之间的变化after。
before
after