Permalink
Browse files

updated wiki pages with comment examples

  • Loading branch information...
1 parent 7069e43 commit 52c0643f9954daca74fb07dfdf311bcaea597536 @mbarchfe mbarchfe committed Feb 9, 2014
@@ -94,3 +94,19 @@ When exceptions occur in a decision table, they're displayed in line.
| foo | bar | baz? |
| - | | / |
| | * | |
+
+!4 Documentation
+
+If you want to document the data given in a particular row you can just add an extra cell to the right.
+
+| should I buy milk |
+| cash in wallet | credit card | pints of milk remaining | go to store? |
+| 0 | no | 0 | no |
+| 10 | no | 0 | yes | plenty of money but no need for a pint |
+
+For more detailed documentation you can add designated comment columns anywhere. Just prefix the header with a hash symbol.
+
+| should I buy milk |
+| cash in wallet | # comment | credit card | pints of milk remaining | go to store? |
+| -2 | we actually allow negative amounts, meaning debt | no | 0 | no |
+| 1 | must have at least 2 euros | no | 0 | no |
@@ -58,3 +58,10 @@ The first thing to notice is the ''Query:'' in the first cell of the table. Thi
Each row in the table is checked to see if there is a match in the query response. The fields are matched left to right. If the leftmost field matches, then the row is considered to be "found". Fields that don't matche are marked in error as in the 10-Oct-1974 field above. A cell that is left blank in the table will be filled in from the result and counted as ignored. If the first cell of a row cannot be matched, then the row is considered ''missing''. If there is an unmatched row remaining in the query response, it is added to the table and marked ''surplus''. The order of the rows is irrelevant.
If a !style_code(table) method is declared in the fixture it will be called before the !style_code(query) function is called. It will be passed a list of rows which are themselves lists of cells. The rows and cells represent the all but the first row of the table. This is the same format at the !style_code(doTable) method of Table table, and the !style_code(table) method of Decision table.
+
+In analogy to decision tables you can define comment columns by prefixing the header with the hash symbol.
+
+|Query:employees hired before|10-Dec-1980 |
+|last name|hire date|# comment|
+|Grenning | ||
+|Martin | |we hired him first|
@@ -0,0 +1,38 @@
+package fitnesse.slim.test;
+
+//Copyright (C) 2003-2009 by Object Mentor, Inc. All rights reserved.
+//Released under the terms of the CPL Common Public License version 1.0.
+
+import java.util.List;
+
+public class ShouldIBuyMilk {
+ private int dollars;
+ private int pints;
+ private boolean creditCard;
+
+ public void setCashInWallet(int dollars) {
+ this.dollars = dollars;
+ }
+
+ public void setPintsOfMilkRemaining(int pints) {
+ this.pints = pints;
+ }
+
+ public void setCreditCard(String valid) {
+ creditCard = "yes".equals(valid);
+ }
+
+ public String goToStore() {
+ if (pints == 0 && (dollars > 2 || creditCard))
+ return "yes";
+ else
+ return "no";
+ }
+
+ public void execute() {
+
+ }
+
+ public void table(List<List<String>> table) {
+ }
+}

0 comments on commit 52c0643

Please sign in to comment.