com.tngtech.jgiven.format
Class NotFormatter
java.lang.Object
com.tngtech.jgiven.format.BooleanFormatter
com.tngtech.jgiven.format.NotFormatter
- All Implemented Interfaces:
- ArgumentFormatter<Boolean>
public class NotFormatter
- extends BooleanFormatter
Translates false
to the word "not" and true
to the empty word "".
true: ""
false: "not"
Example:
then().the_coffee_should_$$not_be_served( coffeeServed )
Result:
coffeeServed == false
then the coffee should not be served
coffeeServed == true
then the coffee should be served
Method Summary |
String |
format(Boolean b,
String... args)
Format a single argument by taking optional formatter arguments into account. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
NotFormatter
public NotFormatter()
format
public String format(Boolean b,
String... args)
- Description copied from interface:
ArgumentFormatter
- Format a single argument by taking optional formatter arguments into account.
- Specified by:
format
in interface ArgumentFormatter<Boolean>
- Overrides:
format
in class BooleanFormatter
- Parameters:
b
- the object to formatargs
- optional arguments for the formatter to control the formatting.
- Returns:
- a formatted string
Copyright © 2014 TNG Technology Consulting. All rights reserved.