Template Function husarion_ugv_utils::test_utils::IsMessageThrown

Function Documentation

template<typename ExceptionType, typename Func>
bool husarion_ugv_utils::test_utils::IsMessageThrown(const Func &func, const std::string &error_msg)

Check if a method throws an exception of a given type and the error message contains the provided message.

Parameters:
  • func – The method that will be tested

  • error_msg – The error message that has to be contained within the thrown message

Returns:

True if method throws an exception of a given type and the error message contains the provided message, false otherwise