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

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

using ls::standard::time::IClock;
#if defined(unix) || defined(__APPLE__)
using ls::standard::time::PosixClock;
#endif
using ls::standard::time::SystemTimeParameter;
#ifdef _WIN32
using ls::standard::time::WindowsClock;
#endif
using std::make_shared;
using std::shared_ptr;
using testing::Test;

namespace
{
  class SystemTimeParameterTest : public Test
  {
    public:

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

  TEST_F(SystemTimeParameterTest, getClock)
  {
    ASSERT_TRUE(SystemTimeParameter{}.getClock() == nullptr);
  }

  TEST_F(SystemTimeParameterTest, setClock)
  {
    SystemTimeParameter parameter{};
    shared_ptr<IClock> clock{};

#if defined(unix) || defined(__APPLE__)
    clock = make_shared<PosixClock>();
#endif
#ifdef _WIN32
    clock = make_shared<WindowsClock>();
#endif

    parameter.setClock(clock);

    ASSERT_TRUE(parameter.getClock() == clock);
  }
}
