mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-10-30 07:50: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
|
||||
Loading…
Add table
Add a link
Reference in a new issue