TaggedStrings allow you retain tags (HTML or XML) in Fit table cells.
For example, in the following tests, the tags are included in the comparison between the expected and actual values:
These fail because the tags differ:
In order for the tags to be retained, the underlying type needs to be a TaggedString, as shown in the following fixture class:
Because the argument to the method tagText() is a TaggedString, the FitLibrary fixtures retain the tags in the string. The same applies to the return type of the method.
For example, in the following tests, the tags are included in the comparison between the expected and actual values:
fitlibrary.specify.DoWithTags |
check | tag text | bold | bold |
check | tag text |
|
|
check | tag text |
|
|
These fail because the tags differ:
check | tag text | bold | bold |
check | tag text | bold | bold |
In order for the tags to be retained, the underlying type needs to be a TaggedString, as shown in the following fixture class:
public class DoWithTags extends DoFixture {
public TaggedString tagText(TaggedString s) {
return s;
}
}
Because the argument to the method tagText() is a TaggedString, the FitLibrary fixtures retain the tags in the string. The same applies to the return type of the method.
- Copyright (c) 2004, 2005, 2006 Rick Mugridge, http://www.rimuresearch.com
- Released under the terms of the GNU General Public License version 2 or later.
Add Child Page to TaggedStrings