2

Table example:

!script|SomeTest           |
|Goto  |$Url               |
|check |IsAt|IndexPage|true|
|Index |CheckUserOrder?    |
|0     |Name1              |
|1     |Name2              |

Code example:

public class SomeTest {
 public string index;
 public bool IsAt(string pageTitle){
    //function for checking title of page
 }
 public string CheckUserOrder{
     return username(index); // will get name of user for list which is other class
 }
}

An exception is thrown: method name '0' not found in SomeTest...

I don't know why FitNesse is considering '0' as a method and not a parameter.

4

2 回答 2

0

您正在尝试将脚本和决策表结合起来。如果你正在做一个脚本表,我希望你会有:

!|script|SomeTest|
|Goto|$Url|
|check|IsAt|IndexPage|true|
|check|CheckUserOrder|0|Name1|
|check|CheckUserOrder|1|Name2|
于 2013-11-17T12:06:22.213 回答
0

您在使用 Slim 测试系统吗?ColumnFixture 需要 Fit 测试系统。http://fitnesse.org/FitNesse.UserGuide.TestSystems

使用 Slim 测试系统,使用 DecisionTable http://fitnesse.org/FitNesse.UserGuide.SliM.DecisionTable

所以你的测试看起来像:

!|script|SomeTest|
|Goto|$Url|
|check|IsAt|IndexPage|true|

!|SomeTest|
|Index|CheckUserOrder?|
|0|Name1|
|1|Name2|
于 2013-10-17T15:46:36.873 回答