Name
NotEqualException
Description
The class
NotEqualException
(see Figure C-8) is a
subclass of Exception
. A
NotEqualException
is thrown when an equality
assertion fails. Its Type
is
CppUnit::NotEqualException
.
NotEqualException
belongs to the namespace
CppUnit
. It is declared in
NotEqualException.h and implemented in
NotEqualException.cpp.
Declaration
class NotEqualException : public Exception
Constructors/Destructors
-
NotEqualException(string expected, string actual, SourceLine sourceLine =
SourceLine( ), string additionalMessage = "")
A constructor for
NotEqualException
. Thestring
argumentsexpected
andactual
represent the values that fail the equality test and cause theNotEqualException
. ThesourceLine
andadditionalMessage
arguments have default empty values.-
NotEqualException(const NotEqualException& other)
A copy constructor.
-
virtual ~NotEqualException( ) throw( )
A destructor.
Public Methods
-
NotEqualException& operator=(const NotEqualException& other)
A copy operator.
-
string actualValue( ) const
Returns the
actual
value.-
string additionalMessage( ) const
Returns the
additionalMessage
.-
virtual Exception *clone( ) const
Returns a copy of the
NotEqualException
.-
string expectedValue( ) const
Returns the
expected
value.-
virtual bool isInstanceOf(const Type& type) const
Returns
TRUE
if theNotEqualException
is of the givenType
. Used for runtime ...
Get Unit Test Frameworks now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.