public class ValueAssert extends org.assertj.core.api.AbstractCharSequenceAssert<ValueAssert,String>
String
result of XPath evaluation.
Simple Example
import static org.xmlunit.assertj.XmlAssert.assertThat; final String xml = "<a><b attr=\"abc\"></b></a>"; assertThat(xml).valueByXPath("count(//a/b)").isEqualTo(3);
Modifier and Type | Method and Description |
---|---|
org.assertj.core.api.AbstractBooleanAssert<?> |
asBoolean()
Returns an
Assert object that allows performing assertions on boolean value of the String under test. |
org.assertj.core.api.AbstractDoubleAssert<?> |
asDouble()
Returns an
Assert object that allows performing assertions on integer value of the String under test. |
org.assertj.core.api.AbstractIntegerAssert<?> |
asInt()
Returns an
Assert object that allows performing assertions on integer value of the String under test. |
XmlAssert |
asXml()
Returns an
XmlAssert object that allows performing assertions on XML value of the String under test. |
ValueAssert |
isEqualTo(boolean expected)
Try convert the
String under test to boolean using asBoolean() and compare with given value. |
ValueAssert |
isEqualTo(double expected)
Try convert the
String under test to double using asDouble() and compare with given value. |
ValueAssert |
isEqualTo(int expected)
|
contains, contains, containsIgnoringCase, containsOnlyDigits, containsOnlyOnce, containsOnlyWhitespaces, containsPattern, containsPattern, containsSequence, containsSequence, containsSubsequence, containsSubsequence, doesNotContain, doesNotContain, doesNotContainOnlyWhitespaces, doesNotContainPattern, doesNotContainPattern, doesNotEndWith, doesNotMatch, doesNotMatch, doesNotStartWith, endsWith, hasLineCount, hasSameSizeAs, hasSameSizeAs, hasSameSizeAs, hasSize, inHexadecimal, inUnicode, isBlank, isEmpty, isEqualToIgnoringCase, isEqualToIgnoringNewLines, isEqualToIgnoringWhitespace, isEqualToNormalizingNewlines, isEqualToNormalizingWhitespace, isJavaBlank, isNotBlank, isNotEmpty, isNotEqualToIgnoringCase, isNotEqualToIgnoringWhitespace, isNotEqualToNormalizingWhitespace, isNotJavaBlank, isNullOrEmpty, isSubstringOf, isXmlEqualTo, isXmlEqualToContentOf, matches, matches, startsWith, usingComparator, usingDefaultComparator, usingDefaultElementComparator, usingElementComparator
as, as, asList, asString, describedAs, describedAs, descriptionText, doesNotHave, doesNotHaveSameClassAs, equals, failWithMessage, getWritableAssertionInfo, has, hashCode, hasSameClassAs, hasSameHashCodeAs, hasToString, inBinary, is, isEqualTo, isExactlyInstanceOf, isIn, isIn, isInstanceOf, isInstanceOfAny, isNot, isNotEqualTo, isNotExactlyInstanceOf, isNotIn, isNotIn, isNotInstanceOf, isNotInstanceOfAny, isNotNull, isNotOfAnyClassIn, isNotSameAs, isNull, isOfAnyClassIn, isSameAs, overridingErrorMessage, setCustomRepresentation, throwAssertionError, withFailMessage, withRepresentation, withThreadDumpOnError
public org.assertj.core.api.AbstractIntegerAssert<?> asInt()
Assert
object that allows performing assertions on integer value of the String
under test.AssertionError
- if the actual value is null
.AssertionError
- if the actual value does not contain a parsable integerpublic org.assertj.core.api.AbstractDoubleAssert<?> asDouble()
Assert
object that allows performing assertions on integer value of the String
under test.AssertionError
- if the actual value is null
.AssertionError
- if the actual value does not contain a parsable doublepublic org.assertj.core.api.AbstractBooleanAssert<?> asBoolean()
Assert
object that allows performing assertions on boolean value of the String
under test.
If actual value after lowercasing is one of the following "true", "false", then it can be parsed to boolean.
AssertionError
- if the actual value is null
.AssertionError
- if the actual value does not contain a parsable booleanpublic XmlAssert asXml()
XmlAssert
object that allows performing assertions on XML value of the String
under test.AssertionError
- if the actual value is null
.public ValueAssert isEqualTo(int expected)
public ValueAssert isEqualTo(double expected)
String
under test to double using asDouble()
and compare with given value.public ValueAssert isEqualTo(boolean expected)
String
under test to boolean using asBoolean()
and compare with given value.Copyright © 2001–2019 XMLUnit. All rights reserved.