mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-10-30 14:30:04 +00:00
Update manager and test
This commit is contained in:
parent
6412c77a9d
commit
08654bb7b0
5 changed files with 345 additions and 3 deletions
40
test/source/scwx/qt/manager/update_manager.test.cpp
Normal file
40
test/source/scwx/qt/manager/update_manager.test.cpp
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
#include <scwx/qt/manager/update_manager.hpp>
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
namespace scwx
|
||||
{
|
||||
namespace qt
|
||||
{
|
||||
namespace manager
|
||||
{
|
||||
|
||||
TEST(UpdateManagerTest, CheckForUpdates)
|
||||
{
|
||||
auto updateManager = UpdateManager::Instance();
|
||||
bool updateFound;
|
||||
types::gh::Release latestRelease;
|
||||
std::string latestVersion;
|
||||
|
||||
// Check for updates, and expect an update to be found
|
||||
updateFound = updateManager->CheckForUpdates("0.0.0");
|
||||
latestRelease = updateManager->latest_release();
|
||||
latestVersion = updateManager->latest_version();
|
||||
|
||||
EXPECT_EQ(updateFound, true);
|
||||
EXPECT_GT(latestRelease.name_.size(), 0);
|
||||
EXPECT_GT(latestRelease.htmlUrl_.size(), 0);
|
||||
EXPECT_GT(latestRelease.body_.size(), 0);
|
||||
EXPECT_EQ(latestRelease.draft_, false);
|
||||
EXPECT_EQ(latestRelease.prerelease_, false);
|
||||
EXPECT_GT(latestVersion, "0.0.0");
|
||||
|
||||
// Check for updates, and expect no updates to be found
|
||||
updateFound = updateManager->CheckForUpdates("9999.99.99");
|
||||
|
||||
EXPECT_EQ(updateFound, false);
|
||||
}
|
||||
|
||||
} // namespace manager
|
||||
} // namespace qt
|
||||
} // namespace scwx
|
||||
|
|
@ -21,7 +21,8 @@ set(SRC_PROVIDER_TESTS source/scwx/provider/aws_level2_data_provider.test.cpp
|
|||
source/scwx/provider/warnings_provider.test.cpp)
|
||||
set(SRC_QT_CONFIG_TESTS source/scwx/qt/config/county_database.test.cpp
|
||||
source/scwx/qt/config/radar_site.test.cpp)
|
||||
set(SRC_QT_MANAGER_TESTS source/scwx/qt/manager/settings_manager.test.cpp)
|
||||
set(SRC_QT_MANAGER_TESTS source/scwx/qt/manager/settings_manager.test.cpp
|
||||
source/scwx/qt/manager/update_manager.test.cpp)
|
||||
set(SRC_QT_MODEL_TESTS source/scwx/qt/model/imgui_context_model.test.cpp)
|
||||
set(SRC_QT_SETTINGS_TESTS source/scwx/qt/settings/settings_container.test.cpp
|
||||
source/scwx/qt/settings/settings_variable.test.cpp)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue