/* * Author: Patrick-Christopher Mattulat * Company: Lynar Studios * E-Mail: webmaster@lynarstudios.com * Created: 2023-05-23 * Changed: 2023-05-23 * * */ #include #include using ls::std::core::IllegalArgumentException; using ls::std::core::RawNullPointerArgumentEvaluator; using ls::std::core::type::RawPointer; using std::string; using testing::Test; namespace { class RawNullPointerArgumentEvaluatorTest : public Test { public: RawNullPointerArgumentEvaluatorTest() = default; ~RawNullPointerArgumentEvaluatorTest() override = default; }; TEST_F(RawNullPointerArgumentEvaluatorTest, evaluate_raw_pointer) { EXPECT_THROW( { try { RawNullPointerArgumentEvaluator{RawPointer{nullptr}}.evaluate(); } catch (const IllegalArgumentException &_exception) { string actual = _exception.what(); string expected = _exception.getName() + " thrown - passed argument is null!"; ASSERT_STREQ(expected.c_str(), actual.c_str()); throw; } }, IllegalArgumentException); } }