我如何最好地处理我的许多步骤应该将 0、1 甚至 2 个日期作为“第一个参数”的事实?例如,我如何最好地支持 Specflow 中的可选参数
最简单的情况是日期无关紧要,只要步骤相继发生
Given Peter was born 23-06-1973
And Peter created an account
And Peter deposited $200
但通常,很多步骤是时间相关的,例如
Given Peter was born 23-06-1973
And at 1-4-2012 Peter created an account
And at 13-4-2012 Peter deposited $200
在其他时候,有两个日期,例如实时日期和发生某事的日期。例如。Peter 填写了一份 14-4-2012 的打印表格进行汇款,但表格丢失了几天,我们今天需要记录表格是几天前填写的。
Given Peter was born 23-06-1973
...
And at 16-4-2012 really at 14-4-2012 Completed a transfer form to transfer $100 to account 12345