/*
* Author:          Patrick-Christopher Mattulat
* Co-Author:       Claude Sonnet 4.6 (LLM)
* Company:         Lynar Studios
* E-Mail:          webmaster@lynarstudios.com
* Created:         2023-05-24
* Changed:         2026-06-23
*
* */

#include <gtest/gtest.h>
#include <ls-std/ls-std-core.hpp>

using ls::standard::core::NullPointerException;
using ls::standard::core::RawNullPointerEvaluator;
using ls::standard::core::type::RawPointer;
using std::string;
using testing::Test;

namespace
{
  class RawNullPointerEvaluatorTest : public Test
  {
    public:

      RawNullPointerEvaluatorTest() = default;
      ~RawNullPointerEvaluatorTest() override = default;
  };

  TEST_F(RawNullPointerEvaluatorTest, evaluate_raw_pointer)
  {
    EXPECT_THROW(
        {
          try
          {
            RawNullPointerEvaluator<void>{RawPointer<void>{nullptr}}.evaluate();
          }
          catch (const NullPointerException &_exception)
          {
            const string actual = _exception.what();
            const string expected = _exception.getName() + " thrown - reference in use is null!";

            ASSERT_STREQ(expected.c_str(), actual.c_str());
            throw;
          }
        },
        NullPointerException);
  }
}
