core-jgi/fitnesse/FitNesseRoot/FitLibrary/UserGuide/ExtendedCamelCase/content.txt

28 lines
1.8 KiB
Plaintext

Consider the names of ''enter'', ''press'' and ''check'' "fields" in ''!-ActionFixture-!'', and the column header labels in ''!-ColumnFixture-!'' and ''!-RowFixture-!''. In the original Fit, these needed to conform to the lexical form of programming language identifiers. In some cases, camel casing was used to provide some flexibility.
Camel casing takes a string like "the first one" and converts it into a camel form of identifier, "theFirstOne".
But this had some problems when non-programmers are creating Fit tables:
* A valid identifier in one language would not be in another
* Certain identifiers can't be used, such as "case", "for", "do", etc in Java.
In addition, unicode can't be used for such names, because in general there is little support for unicode in development tools.
Extended camel is used with all the !-FitLibrary-! fixtures and takes camel casing one step further. It converts a name into a valid identifier in the language concerned. For example, in Java the name "% discount" is translated into "percent discount", which is then camel-cased into "percentDiscount".
This can result in some weird and/or long identifiers. There's no need to work out such identifiers, however, as an unknown identifier is displayed in a error messages in a Fit table. These weird identifiers don't need to "pollute" the application, as they only need to appear in fixture code.
Here's some examples:
|!-fitlibrary.specify.TestCamelCase-!|
|name || identifier |
|" hi " || quoteHiQuote |
|^`{}~ || caretBackquoteLeftBraceRightBraceTilde |
|two words || twoWords |
|2 words || twoWords |
|cost $ || costDollar |
|!! || bangBang |
|meet @ || meetAt |
|rick@rimuResearch.com || rickAtRimuResearchDotCom |
| || blank |
|case || case_ |