Older/UnitTest/DatabaseTest.cpp
2024-01-03 22:44:36 +08:00

18 lines
506 B
C++

#include "Database.h"
#include "BoostLog.h"
#include <boost/test/unit_test.hpp>
static constexpr auto path = "build/database.sqlite";
using namespace std::chrono;
BOOST_AUTO_TEST_CASE(DatabaseTest) {
Database database;
BOOST_TEST(database.open(path));
database.addTask(1234, "Hello");
database.addTask(1234, "这是一个测试","", true);
auto now = duration_cast<seconds>(std::chrono::system_clock::now().time_since_epoch()).count();
database.setTaskFinished(1, true, now);
}