0

我尝试测试一个案例,该案例必须通过使用 xebium 和 fittity 来随机输入一个字符串以在字段中输入。

我尝试使用以下命令,但它不起作用。

| $fname= | is | storeValue | on | var chars = 'ABCDEFGHIJKLMNOPQRSTUVWXTZ'; var fname = ''; for (var i=0; i<6; i++)var rnum = Math.floor(Math.random()*chars.length); fname += chars.substring(rnum,rnum+1); |

感谢您的关注 :)

4

1 回答 1

0

为此,我们使用特殊类型的解析器和模板字符串。

例如,函数:

bool LastLogonTimeLessThan( DateTimeWrapper time)
{
   return time.Value < GetLastAccessTime();
}

然后您可以为这种类型添加自定义解析器,请参阅此处的教程:https ://github.com/imanushin/NetRunner/wiki/Parsing

解析器可以是:

public static void DateTimeWrapper(string inputLine)
{
  if("{today}".Equals(inputLine)
         return new DateTimeWrapper(DateTime.Now)

   return new DateTimeWrapper(DateTime.Parse(inputLine))

}
于 2014-09-29T09:53:01.083 回答