Separated tests into different files, added ResetInstance() method to EventManager

This commit is contained in:
EricLiu2000
2019-06-26 11:30:24 -04:00
parent 1dd68eb0d0
commit 4923218d35
6 changed files with 44 additions and 21 deletions
-17
View File
@@ -1,22 +1,5 @@
#include "icsneo/api/eventmanager.h"
#include "gtest/gtest.h"
using namespace icsneo;
class EventManagerTest : public ::testing::Test {
};
TEST_F(EventManagerTest, GetLastErrorTest) {
EventManager::GetInstance().add(APIEvent(APIEvent::Type::OutputTruncated, APIEvent::Severity::Error));
EXPECT_EQ(EventManager::GetInstance().getLastError().getType(), APIEvent::Type::OutputTruncated);
}
TEST_F(EventManagerTest, CountTest) {
EventManager::GetInstance().add(APIEvent(APIEvent::Type::OutputTruncated, APIEvent::Severity::Error));
EXPECT_EQ(EventManager::GetInstance().count(), 1);
}
int main(int argc, char** argv) {
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();