One, character-related matching characters
1, Equalto:
Assertthat (Testedvalue, Equalto (Expectedvalue));
Asserts that the measured testedvalue equals Expectedvalue,equalto can assert the equality between the values, between strings and objects, equivalent to the Equals method of object
2, Equaltoignoringcase:
Assertthat (testedstring, Equaltoignoringcase (expectedstring));
asserts that the string testedstring is measured is equal to expectedstring if the case is ignored
3, Equaltoignoringwhitespace:
Assertthat (testedstring, Equaltoignoringwhitespace (expectedstring);
asserts that the string testedstring is measured is equal to expectedstring if any of the trailing spaces are ignored
(Note: Spaces in a string cannot be ignored)
4, Containsstring:
Assertthat (testedstring, containsstring (subString));
Asserts that the measured string testedstring contains substrings substring
5, EndsWith:
Assertthat (testedstring, endsWith (suffix));
Assertion that the measured string testedstring ends with a substring suffix
6, StartsWith:
Assertthat (testedstring, startswith (prefix));
asserts that the string testedstring being measured starts with a substring prefix
Two, the general match character
1, Nullvalue ():
Assertthat (Object,nullvalue ());
Asserts that the value of the object being measured is null*/
2, Notnullvalue ():
Assertthat (Object,notnullvalue ());
Asserts that the value of the object being measured is not null*/
3, is:
Assertthat (Testedstring, is (Equalto (expectedvalue));
Asserts that the object being measured is equal to the following given matching expression
1 is a matching character shorthand application one:
Assertthat (Testedvalue, is (Expectedvalue));
The shorthand for IS (Equalto (x)), the assertion testedvalue equals Expectedvalue
2 is a matching character shorthand application of the second:
Assertthat (Testedobject, is (Cheddar.class));
Is (instanceof (someclass.class)) shorthand, assertion Testedobject as an instance of Cheddar
4, not:
Assertthat (testedstring, not (expectedstring));
Contrary to an is match, the assertion that the object being measured is not equal to the object given later