#include <HwmonTempSensor.hpp>
#include <dbus/connection.hpp>
#include <nlohmann/json.hpp>

#include <fstream>

#include <gtest/gtest.h>

TEST(HwmonTempSensor, TestTMP75)
{
    boost::asio::io_service io;
    auto system_bus =
        std::make_shared<dbus::connection>(io, dbus::bus::session);
    dbus::DbusObjectServer object_server(system_bus);

    std::vector<thresholds::Threshold> sensor_thresholds;
    auto t = thresholds::Threshold(thresholds::Level::CRITICAL,
                                   thresholds::Direction::LOW, 80);
    sensor_thresholds.emplace_back(t);

    std::ofstream test_file("test0.txt");
    test_file << "28\n";
    test_file.close();
    auto filename = std::string("test0.txt");
    auto tempsensname = std::string("test sensor");
    HwmonTempSensor test(filename, object_server, io, tempsensname,
                         std::move(sensor_thresholds));

    std::remove("test0.txt");
}

TEST(HwmonTempSensor, TestTMP421)
{
    boost::asio::io_service io;
    auto system_bus =
        std::make_shared<dbus::connection>(io, dbus::bus::session);
    dbus::DbusObjectServer object_server(system_bus);

    std::vector<thresholds::Threshold> sensor_thresholds;
    auto t = thresholds::Threshold(thresholds::Level::WARNING,
                                   thresholds::Direction::HIGH, 80);
    sensor_thresholds.emplace_back(t);

    std::ofstream test_file("test1.txt");
    test_file << "28\n";
    test_file.close();
    auto filename = std::string("test1.txt");
    auto tempsensname = std::string("test sensor");
    HwmonTempSensor test(filename, object_server, io, tempsensname,
                         std::move(sensor_thresholds));

    std::remove("test1.txt");
}
