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

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

using ls::standard::core::NotImplementedException;
using std::string;
using testing::Test;

namespace
{
  class NotImplementedExceptionTest : public Test
  {
    public:

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

  TEST_F(NotImplementedExceptionTest, constructor)
  {
    EXPECT_THROW(
        {
          try
          {
            throw NotImplementedException{};
          }
          catch (const NotImplementedException &_exception)
          {
            const string actual = _exception.what();
            const string expected = _exception.getName() + " thrown - method is not implemented and should not be used!";

            EXPECT_STREQ(expected.c_str(), actual.c_str());
            throw;
          }
        },
        NotImplementedException);
  }

  TEST_F(NotImplementedExceptionTest, constructor_dedicated_message)
  {
    EXPECT_THROW(
        {
          try
          {
            throw NotImplementedException{R"lit(method "marshal" is not implemented!)lit"};
          }
          catch (const NotImplementedException &_exception)
          {
            const string actual = _exception.what();
            const string expected = _exception.getName() + R"lit( thrown - method "marshal" is not implemented!)lit";

            EXPECT_STREQ(expected.c_str(), actual.c_str());
            throw;
          }
        },
        NotImplementedException);
  }

  TEST_F(NotImplementedExceptionTest, getName)
  {
    ASSERT_STREQ("NotImplementedException", NotImplementedException{}.getName().c_str());
  }
}
