org.jnario.lib
Class Should
java.lang.Object
org.jnario.lib.Should
public class Should
- extends Object
The default should matchers provided by Jnario. These
can be used in Jnario for writing literate assertions.
The name of a should method must conform to the following
convention:
should_xxxx(Type1 actual, Type2 expected).
Then it can be used in a spec in the following way:
fact actual should xxxx expected
- Author:
- Sebastian Benz - Initial contribution and API
|
Method Summary |
static
|
_()
A helper method to mark irrelevant values. |
static
<T> org.hamcrest.Matcher<? super T> |
|
matches(String desc,
org.eclipse.xtext.xbase.lib.Functions.Function1<T,Boolean> matcher)
|
static
<T> org.hamcrest.Matcher<T> |
|
nullValue()
|
static boolean |
operator_doubleArrow(Class<?> actual,
Class<?> expected)
|
static boolean |
operator_doubleArrow(Object actual,
Class<?> expectedType)
|
static
|
operator_doubleArrow(T actual,
boolean result)
|
static
|
operator_doubleArrow(T actual,
org.hamcrest.Matcher<? super T> matcher)
|
static
|
operator_doubleArrow(T actual,
T expected)
|
static boolean |
should_be(Class<?> actual,
Class<?> expectedType)
|
static boolean |
should_be(Object actual,
Class<?> expectedType)
|
static
|
should_be(T actual,
boolean result)
|
static
|
should_be(T obj,
org.eclipse.xtext.xbase.lib.Functions.Function1<T,Boolean> func)
|
static
|
should_be(T actual,
org.hamcrest.Matcher<? super T> matcher)
|
static
|
should_be(T actual,
T expected)
|
static
|
should_contain(CharSequence actual,
CharSequence substring)
|
static
|
should_contain(Iterable<T> collection,
org.hamcrest.Matcher<? super T> matcher)
|
static
|
should_contain(Iterable<T> actual,
T element)
|
static boolean |
should_endWith(CharSequence s,
String substring)
|
static boolean |
should_startWith(CharSequence s,
String substring)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Should
public Should()
operator_doubleArrow
public static boolean operator_doubleArrow(Class<?> actual,
Class<?> expected)
operator_doubleArrow
public static <T> boolean operator_doubleArrow(T actual,
T expected)
operator_doubleArrow
public static boolean operator_doubleArrow(Object actual,
Class<?> expectedType)
operator_doubleArrow
public static <T> boolean operator_doubleArrow(T actual,
org.hamcrest.Matcher<? super T> matcher)
operator_doubleArrow
public static <T> boolean operator_doubleArrow(T actual,
boolean result)
should_be
public static <T> boolean should_be(T obj,
org.eclipse.xtext.xbase.lib.Functions.Function1<T,Boolean> func)
should_be
public static <T> boolean should_be(T actual,
T expected)
should_be
public static boolean should_be(Class<?> actual,
Class<?> expectedType)
should_be
public static boolean should_be(Object actual,
Class<?> expectedType)
should_be
public static <T> boolean should_be(T actual,
org.hamcrest.Matcher<? super T> matcher)
should_contain
public static <T> boolean should_contain(Iterable<T> actual,
T element)
should_contain
public static <T> boolean should_contain(Iterable<T> collection,
org.hamcrest.Matcher<? super T> matcher)
should_contain
public static <T> boolean should_contain(CharSequence actual,
CharSequence substring)
should_be
public static <T> boolean should_be(T actual,
boolean result)
should_startWith
public static boolean should_startWith(CharSequence s,
String substring)
should_endWith
public static boolean should_endWith(CharSequence s,
String substring)
matches
public static <T> org.hamcrest.Matcher<? super T> matches(String desc,
org.eclipse.xtext.xbase.lib.Functions.Function1<T,Boolean> matcher)
_
public static <T> T _()
- A helper method to mark irrelevant values.
- Returns:
- always null
nullValue
public static <T> org.hamcrest.Matcher<T> nullValue()
Copyright © 2012-2013 BMW Car IT. All Rights Reserved.