Skip to content

Commit

Permalink
Tests - Add All WebTests
Browse files Browse the repository at this point in the history
  • Loading branch information
nlogozzo committed Dec 5, 2023
1 parent 2d78d2a commit 8354a38
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
1 change: 1 addition & 0 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ project("libaura_test")
enable_testing()

add_executable(${PROJECT_NAME}
main.cpp
stringtests.cpp
versiontests.cpp
webtests.cpp)
Expand Down
7 changes: 7 additions & 0 deletions tests/main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#include <gtest/gtest.h>

int main(int argc, char* argv[])
{
testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}
9 changes: 8 additions & 1 deletion tests/webtests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,12 @@ TEST(WebTests, ValidWebsite2)

TEST(WebTests, DownloadFile1)
{
EXPECT_TRUE(WebHelpers::downloadFile("https://www.w3.org/TR/2003/REC-PNG-20031110/iso_8859-1.txt", "test.txt"));
EXPECT_TRUE(WebHelpers::downloadFile("https://raw.githubusercontent.com/nlogozzo/nlogozzo/main/README.md", "readme.md"));
}

TEST(WebTests, FetchJsonString1)
{
std::string s{ WebHelpers::fetchJsonString("https://api.github.com/repos/nickvisionapps/denaro/tags") };
std::cout << s << std::endl;
EXPECT_TRUE(!s.empty());
}

0 comments on commit 8354a38

Please sign in to comment.