System::TestPredicates::Details Namespace Reference

namespace TypeTraits More...

Namespaces

 SharedPtrAsserts
 

Functions

template<typename T >
std::string PrintToString (const T &value)
 
template<typename T >
std::enable_if< System::Details::HasToString< T >::value, std::string >::type PrintToStringImpl (const SharedPtr< T > &value, long long s)
 
template<typename T >
std::enable_if< System::Details::HasToString< T >::value, std::string >::type PrintToStringImpl (const WeakPtr< T > &value, long long s)
 
template<typename T >
std::enable_if<!TypeTraits::has_print_to_method< T >::value &&System::Details::HasToString< T >::value, std::string >::type PrintToStringImpl (const T &value, long long s)
 
template<typename T >
std::enable_if< TypeTraits::has_print_to_method< T >::value, std::string >::type PrintToStringImpl (const T &value, long long s)
 
template<typename T >
std::enable_if< TypeTraits::has_data_method< T >::value &&!TypeTraits::IsCppContainer< T >::value, std::string >::type PrintToStringImpl (const T &value, long long s)
 
template<typename T1 , typename T2 >
std::string PrintToStringImpl (const std::pair< T1, T2 > &value, long long s)
 
template<typename T >
std::enable_if< TypeTraits::IsCppContainer< T >::value, std::string >::type PrintToStringImpl (const T &container, long long s)
 
template<typename T >
std::string PrintToStringImpl (const T &value, int s)
 
std::string PrintToString (std::nullptr_t)
 
template<typename T >
std::string PrintToString (System::Collections::Generic::ICollection< T > &value)
 
template<typename T1 , typename T2 >
testing::AssertionResult EqFailure (const char *lhs_expr, const char *rhs_expr, T1 &lhs, T2 &rhs)
 
template<typename T1 , typename T2 >
testing::AssertionResult NotEqFailure (const char *lhs_expr, const char *rhs_expr, T1 &lhs, T2 &rhs)
 
template<typename T1 , typename T2 >
testing::AssertionResult SameFailure (const char *lhs_expr, const char *rhs_expr, T1 &lhs, T2 &rhs)
 
template<typename T1 , typename T2 >
testing::AssertionResult NotSameFailure (const char *lhs_expr, const char *rhs_expr, T1 &lhs, T2 &rhs)
 

Detailed Description

namespace TypeTraits

Function Documentation

◆ EqFailure()

template<typename T1 , typename T2 >
testing::AssertionResult System::TestPredicates::Details::EqFailure ( const char *  lhs_expr,
const char *  rhs_expr,
T1 &  lhs,
T2 &  rhs 
)

Formats == assertion failure for output.

Template Parameters
T1LHS value type.
T2RHS value type.
Parameters
lhs_exprLHS expression.
rhs_exprRHS expression.
lhsLHS value.
rhsRHS value.
Returns
Object wrapping failure text.

◆ NotEqFailure()

template<typename T1 , typename T2 >
testing::AssertionResult System::TestPredicates::Details::NotEqFailure ( const char *  lhs_expr,
const char *  rhs_expr,
T1 &  lhs,
T2 &  rhs 
)

Formats != assertion failure for output.

Template Parameters
T1LHS value type.
T2RHS value type.
Parameters
lhs_exprLHS expression.
rhs_exprRHS expression.
lhsLHS value.
rhsRHS value.
Returns
Object wrapping failure text.

◆ NotSameFailure()

template<typename T1 , typename T2 >
testing::AssertionResult System::TestPredicates::Details::NotSameFailure ( const char *  lhs_expr,
const char *  rhs_expr,
T1 &  lhs,
T2 &  rhs 
)

Formats 'not same' assertion failure for output.

Template Parameters
T1LHS value type.
T2RHS value type.
Parameters
lhs_exprLHS expression.
rhs_exprRHS expression.
lhsLHS value.
rhsRHS value.
Returns
Object wrapping failure text.

◆ PrintToString() [1/3]

template<typename T >
std::string System::TestPredicates::Details::PrintToString ( const T &  value)

Prints value to std::string.

Template Parameters
TType to print.
Parameters
valueValue to print.
Returns
String equivalent of value passed.

Prints object to string by selecting proper serializer function.

Template Parameters
TObject type.
Parameters
valueObject to print.
Returns
String representations of object passed.

◆ PrintToString() [2/3]

std::string System::TestPredicates::Details::PrintToString ( std::nullptr_t  )
inline

Prints nullptr to string.

Returns
"nullptr" string.

◆ PrintToString() [3/3]

template<typename T >
std::string System::TestPredicates::Details::PrintToString ( System::Collections::Generic::ICollection< T > &  value)

Prints ICollection-style containers to string by printing their elements (not more than 32).

Template Parameters
TObject type.
Parameters
valueObject to print.
Returns
Joint string representations of contained elements.

◆ PrintToStringImpl() [1/8]

template<typename T >
std::enable_if<System::Details::HasToString<T>::value, std::string>::type System::TestPredicates::Details::PrintToStringImpl ( const SharedPtr< T > &  value,
long long  s 
)

Prints System::Object subclass to string using ToString() method.

Template Parameters
TFinal class type.
Parameters
valuePointer to object to print.
sA service parameter which serves as a selector of function overload based on the type of this parameter; the value of the parameter is ignored
Returns
String representation of object passed or "nullptr", if value is null.

◆ PrintToStringImpl() [2/8]

template<typename T >
std::enable_if<System::Details::HasToString<T>::value, std::string>::type System::TestPredicates::Details::PrintToStringImpl ( const WeakPtr< T > &  value,
long long  s 
)

Prints System::Object subclass to string using ToString() method.

Template Parameters
TFinal class type.
Parameters
valuePointer to object to print.
sA service parameter which serves as a selector of function overload based on the type of this parameter; the value of the parameter is ignored
Returns
String representation of object passed or "nullptr", if value is null.

◆ PrintToStringImpl() [3/8]

template<typename T >
std::enable_if<!TypeTraits::has_print_to_method<T>::value && System::Details::HasToString<T>::value, std::string>::type System::TestPredicates::Details::PrintToStringImpl ( const T &  value,
long long  s 
)

Prints object to string using ToString() method.

Template Parameters
TObject type.
Parameters
valueObject to print.
sA service parameter which serves as a selector of function overload based on the type of this parameter; the value of the parameter is ignored
Returns
String representation of object passed.

◆ PrintToStringImpl() [4/8]

template<typename T >
std::enable_if<TypeTraits::has_print_to_method<T>::value, std::string>::type System::TestPredicates::Details::PrintToStringImpl ( const T &  value,
long long  s 
)

Prints object to string using PrintTo method.

Template Parameters
TObject type.
Parameters
valueObject to print.
sA service parameter which serves as a selector of function overload based on the type of this parameter; the value of the parameter is ignored
Returns
String representation of object passed.

◆ PrintToStringImpl() [5/8]

template<typename T >
std::enable_if<TypeTraits::has_data_method<T>::value && !TypeTraits::IsCppContainer<T>::value, std::string>::type System::TestPredicates::Details::PrintToStringImpl ( const T &  value,
long long  s 
)

Prints object to string using data() method. Handles wrappers set around STL-styled containers.

Template Parameters
TObject type.
Parameters
valueObject to print.
sA service parameter which serves as a selector of function overload based on the type of this parameter; the value of the parameter is ignored
Returns
String representation of data() method return value.

◆ PrintToStringImpl() [6/8]

template<typename T1 , typename T2 >
std::string System::TestPredicates::Details::PrintToStringImpl ( const std::pair< T1, T2 > &  value,
long long  s 
)

Prints pair to string.

Template Parameters
T1First pair type argument.
T2Second pair type argument.
Parameters
valueObject to print.
sA service parameter which serves as a selector of function overload based on the type of this parameter; the value of the parameter is ignored
Returns
Joint string representations of both first and second pair components.

◆ PrintToStringImpl() [7/8]

template<typename T >
std::enable_if<TypeTraits::IsCppContainer<T>::value, std::string>::type System::TestPredicates::Details::PrintToStringImpl ( const T &  container,
long long  s 
)

Prints STL-style containers to string by printing their elements (not more than 32).

Template Parameters
TObject type.
Parameters
containerObject to print.
sA service parameter which serves as a selector of function overload based on the type of this parameter; the value of the parameter is ignored
Returns
Joint string representations of contained elements.

◆ PrintToStringImpl() [8/8]

template<typename T >
std::string System::TestPredicates::Details::PrintToStringImpl ( const T &  value,
int  s 
)

Prints other types to string by using gtest-provided functions.

Template Parameters
TObject type.
Parameters
valueObject to print.
sA service parameter which serves as a selector of function overload based on the type of this parameter; the value of the parameter is ignored
Returns
String representations of object passed.

◆ SameFailure()

template<typename T1 , typename T2 >
testing::AssertionResult System::TestPredicates::Details::SameFailure ( const char *  lhs_expr,
const char *  rhs_expr,
T1 &  lhs,
T2 &  rhs 
)

Formats 'same' assertion failure for output.

Template Parameters
T1LHS value type.
T2RHS value type.
Parameters
lhs_exprLHS expression.
rhs_exprRHS expression.
lhsLHS value.
rhsRHS value.
Returns
Object wrapping failure text.