Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Fitnesse uses Series 6

2025-01-30 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/03 Report--

Table table

Basically, this section is a document translation, and I'm not going to write an example. I'll say at the end of the story.

A Table table means that you can write a table of any style. So how is a table of any style recognized and executed by fitnesse? And how to show the results of the implementation? Let's take a look.

The basic idea of the previous tables is that either the method name is determined by the header (decision table), the method name is fixed (dynamic decision table, query table), or the method name is determined in combination with some identifiers (script table). In short, it gives the impression that there are traces to follow, while the Table table needs to change its way of thinking-there is no header, and there is no need to worry about which variable the number was passed to. The only required method name is List doTable (List). You can see that the input parameter is a two-level List, which is actually the content of the table. The inner level List is the element in a certain line, which is passed as a string; the outer level List is multiple lines. The return value is actually a two-level List, but it is abbreviated. It's even more accurate to write like this-- List doTable (List table). The structure of the returned List is the same, each row, each element in the row. The element is also in the form of a string, as follows:

Pass-- means yes.

Pass:-- passes with information

... Do not enumerate one by one, refer to the description of the document

As you can see, in this method, we are fully responsible for the input and output, judge and deal with the content in the input List, and then write it into an output List. This also means that fixture is relatively flexible and complex.

The result is shown as follows: overlay the elements in the returned "table" (secondary list) with the original "table" one by one. When the output character is pass, the "grid" of the input table turns green, if it is pass:message, it turns green and additional message display, if it is fail, it turns red, if it is an empty string, the black original value is displayed, if it is an ordinary string without a tag, replace the original content and red.

What happens if the size and length of the returned "table" is different from that of the input table. Fitnesse has taken this into account-if the result is short, it will be displayed as it is, and if the result will be long, it will be displayed in addition.

To sum up, the Table table is the most flexible representation. But I personally do not recommend using this unless you can't find a suitable one from the table introduced earlier. The reason is that this kind of code will be more complex to write and very poor versatility. I have a natural resistance to complex things. Some people say that programmers are divided into two types, one is to consider simple things very complex, and the other is to consider complex things as simple as possible. There is no doubt that I am the latter one. All my articles are trying to explain things in the simplest way possible.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report