Fitnesse Series 5

Source: Internet
Author: User
Tags types of tables

Script table

If the tables described above are single-step and single-method tables. Script table is a series of multi-step operations, as the name represents.

The first entry in the header is followed by a script: prefix, or a script, followed by a cell as the class name. The following is the construction parameter. Each row of the following rows represents an operation. The following operation types are allowed: Execution method, check result, and display output.

The execution method includes the method name and parameters. The amazing design is that the method name and parameters can be staggered into the table. In my example below, this is a method in code is combined from columns 1, 3, and 5, and columns 2, 4, and 6 are parameters. Another method is better suited to the normal habits-put the method name (followed by one;) in the first column, and put parameters in sequence.

The check result uses four phrases as the content of the first column: Check, check not, ensure, reject, the returned results are the same as the table content, different from the table content, true returned, and false returned.

Show words are used for display output. In the first column, the method name and parameters are followed. This line only shows that the output is not verified. Therefore, an extra column is displayed in the result table.

Example:

Script: script.zjc.com. scriptdemo

Zjc

20

This is

10

A Method

20

In code

30

Check

Get age

80

This is a method in code;

15

25

35

Check not

Get age

200

Show

Get name

5

Reject

Reject Method

5

Fixture:

package script.zjc.com;public class ScriptDemo {private String name;private int age;public ScriptDemo(String name,int age){this.name=name;this.age=age;}public void thisIsAMethodInCode(int a,int b,int c){age=age+a+b+c;}public int getAge(){return age;}public String getName(int a){return name;}public boolean rejectMethod(int a){return false;}}

In my opinion, script table and demo-table are the two most important types of tables. demo-table can implement most data verification, while script table can be used together with other tools, implement many amazing functions that exceed expectations.

Fitnesse Series 5

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.