diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 843c8e9..562b049 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -3,6 +3,7 @@ project("libaura_test") enable_testing() add_executable(${PROJECT_NAME} + main.cpp stringtests.cpp versiontests.cpp webtests.cpp) diff --git a/tests/main.cpp b/tests/main.cpp new file mode 100644 index 0000000..b25ddfc --- /dev/null +++ b/tests/main.cpp @@ -0,0 +1,7 @@ +#include + +int main(int argc, char* argv[]) +{ + testing::InitGoogleTest(&argc, argv); + return RUN_ALL_TESTS(); +} \ No newline at end of file diff --git a/tests/webtests.cpp b/tests/webtests.cpp index 0ad8bfd..fe0d8cf 100644 --- a/tests/webtests.cpp +++ b/tests/webtests.cpp @@ -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()); } \ No newline at end of file