123456789101112131415161718192021222324252627282930313233343536373839404142 |
- /*
- * Author: Patrick-Christopher Mattulat
- * Company: Lynar Studios
- * E-Mail: webmaster@lynarstudios.com
- * Created: 2023-02-07
- * Changed: 2023-05-22
- *
- * */
- #include <gtest/gtest.h>
- #include <ls-std/ls-std-core.hpp>
- using ls::std::core::ExceptionMessage;
- using std::string;
- using std::string_view;
- using testing::Test;
- namespace
- {
- class ExceptionMessageTest : public Test
- {
- public:
- ExceptionMessageTest() = default;
- ~ExceptionMessageTest() override = default;
- };
- TEST_F(ExceptionMessageTest, toCharacterPointer)
- {
- string text = "hello!";
- ExceptionMessage message{text};
- string_view characterField = message.toCharacterPointer();
- ASSERT_STREQ(text.c_str(), characterField.data());
- }
- TEST_F(ExceptionMessageTest, toCharacterPointer_empty)
- {
- ExceptionMessage message{""};
- ASSERT_TRUE(message.toCharacterPointer() == nullptr);
- }
- }
|