Fitnesse Slim:如何连接符号 [英] Fitnesse Slim: How to concatenate symbol

查看:93
本文介绍了Fitnesse Slim:如何连接符号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何将符号与两侧的文字连接起来?
例如:

How would one concatenate a symbol with text on either side? For example:


  • 前缀: GAR _

  • 变量: $ todayDate

  • 后缀: _ 1

  • Prefix: "GAR_"
  • Variable: $todayDate
  • Suffix: "_1"

GAR_ $ todayDate_1

评估为:
GAR_07202012_1

运行测试时在fitnesse中,似乎串联正在工作( GAR_ $ todayDate-> [07202012] _1 )。但是,我将此值作为参数传递给Visual Studio,而是以以下文本结尾: GAR_ $ todayDate_1

When running the test in fitnesse, it seems as though the concatenation is working (GAR_$todayDate->[07202012]_1). However, I am passing this value as a parameter to visual studio and I instead end up with the following text: GAR_$todayDate_1.

当我删除后缀或在 $ todayDate _ 1 之间放置空格时,一切正常

When I remove the suffix or put a space between $todayDate and "_1", everything works as expected.

任何帮助将不胜感激。

我尝试过的事情:


  • GAR _!-$ todayDate-!_ 1

  • GAR_ $ todayDate!-_ 1-!

  • GAR_ $ todayDate $ {SUFFIX} -定义了静态变量

  • GAR_!-$todayDate-!_1
  • GAR_$todayDate!-_1-!
  • GAR_$todayDate${SUFFIX} - static variable defined

谢谢,
迈克

推荐答案

我目前仍然遇到相同的问题。
我发现的唯一方法是:

I am stuck with the same problem currently. The only way I found was to:


  1. 创建 StringSupport 带有 String concatenate(String s1,String s2)方法

  2. import FitNesse测试中该类的软件包

  3. StringSupport 放入FitNesse测试中可用库中的

  4. 在您的脚本中,您现在可以执行以下操作: | $ result = | concatenate; | $ s1 | $ s2 |

  1. create a StringSupport class with a String concatenate(String s1, String s2) method
  2. import the package of that class in your FitNesse test
  3. put StringSupport in the available libraries in your FitNesse test with the Library table
  4. in your Script, you can now do: |$result=|concatenate;|$s1|$s2|

适合您的确切用例,则只需使用3个字符串而不是一个字符串来执行相同的concatenate()。

To fit your exact use case, you just have to do the same concatenate() with 3 strings instead of just one.

这篇关于Fitnesse Slim:如何连接符号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆