Class Subject
java.lang.Object
com.qaitsolutions.pframe.core.assertion.subjects.Subject
- Direct Known Subclasses:
BooleanSubject
,ComparableSubject
,IterableSubject
,MapSubject
Wrapper over
Subject
.
- Since:
- 1.0
- Author:
- Iulian Andrei (iulian.andrei@qaitsolutions.com)
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Fails unless the subject is equal to any of the given elements.void
Fails if the subject is not equal to the given object.void
Fails unless the subject is equal to any element in the given iterable.void
isInstanceOf
(Class<?> clazz) Fails if the subject is not an instance of the given class.void
Fails if the subject is equal to any of the given elements.void
isNotEqualTo
(Object unexpected) Fails if the subject is equal to the given object.void
Fails if the subject is equal to any element in the given iterable.void
isNotInstanceOf
(Class<?> clazz) Fails if the subject is an instance of the given class.void
Fails if the subject is null.void
isNotSameInstanceAs
(Object unexpected) Fails if the subject is the same instance as the given object.void
isNull()
Fails if the subject is not null.void
isSameInstanceAs
(Object expected) Fails if the subject is not the same instance as the given object.
-
Field Details
-
message
-
tracker
-
-
Constructor Details
-
Subject
Constructor for regular assertions.- Parameters:
actual
- Current value to be verified.message
- Description of the assertion.
-
Subject
Constructor for soft assertions.- Parameters:
actual
- Current value to be verified.message
- Description of the assertion.tracker
- Entity which allows keeping track of existing errors.
-
-
Method Details
-
isNull
public void isNull()Fails if the subject is not null. Wrapper overSubject.isNull()
. -
isNotNull
public void isNotNull()Fails if the subject is null. Wrapper overSubject.isNotNull()
. -
isEqualTo
Fails if the subject is not equal to the given object. Wrapper overSubject.isEqualTo(Object)
.- Parameters:
expected
- Value to be checked against.
-
isNotEqualTo
Fails if the subject is equal to the given object. The meaning of equality is the same as for theisEqualTo(java.lang.Object)
method. Wrapper overSubject.isNotEqualTo(Object)
.- Parameters:
unexpected
- Value to be checked against.
-
isSameInstanceAs
Fails if the subject is not the same instance as the given object. Wrapper overSubject.isSameInstanceAs(Object)
.- Parameters:
expected
- Value to be checked against.
-
isNotSameInstanceAs
Fails if the subject is the same instance as the given object. Wrapper overSubject.isNotSameInstanceAs(Object)
.- Parameters:
unexpected
- Value to be checked against.
-
isInstanceOf
Fails if the subject is not an instance of the given class. Wrapper overSubject.isInstanceOf(Class)
.- Parameters:
clazz
- Value to be checked against.
-
isNotInstanceOf
Fails if the subject is an instance of the given class. Wrapper overSubject.isNotInstanceOf(Class)
.- Parameters:
clazz
- Value to be checked against.
-
isIn
Fails unless the subject is equal to any element in the given iterable. Wrapper overSubject.isIn(Iterable)
.- Parameters:
iterable
- Value to be checked against.
-
isAnyOf
Fails unless the subject is equal to any of the given elements. Wrapper overSubject.isAnyOf(Object, Object, Object...)
.- Parameters:
first
- Value to be checked against.second
- Value to be checked against.rest
- Value to be checked against.
-
isNotIn
Fails if the subject is equal to any element in the given iterable. Wrapper overSubject.isNotIn(Iterable)
.- Parameters:
iterable
- Value to be checked against.
-
isNoneOf
Fails if the subject is equal to any of the given elements. Wrapper overSubject.isNoneOf(Object, Object, Object...)
.- Parameters:
first
- Value to be checked against.second
- Value to be checked against.rest
- Value to be checked against.
-