42 lines
850 B
C++
42 lines
850 B
C++
|
|
#include <iostream>
|
|
#include <string>
|
|
#include "gtest/gtest.h"
|
|
#include "../src/core/Tree.h"
|
|
#include "../src/core/TreeNode.h"
|
|
|
|
class TreeTest: public ::testing::Test {
|
|
protected:
|
|
virtual void SetUp(){
|
|
for(int i = 0; i < 5; ++i) {
|
|
t2.getRoot()->addChildObject(std::make_shared<std::string>("blah"));
|
|
}
|
|
}
|
|
|
|
virtual void TearDown(){}
|
|
|
|
Tree<std::string> t;
|
|
Tree<std::string> t2;
|
|
Tree<std::string> t3;
|
|
};
|
|
|
|
|
|
TEST_F(TreeTest, IsEmptyInitially) {
|
|
EXPECT_EQ(0, t.getRoot()->getDistanceFromRoot());
|
|
EXPECT_EQ(0, t.getRoot()->getChildren().size());
|
|
}
|
|
|
|
TEST_F(TreeTest, blah) {
|
|
EXPECT_EQ(5, t2.getRoot()->getChildren().size());
|
|
auto last = t2.getRoot()->getChildren().back();
|
|
EXPECT_EQ(1, last->getDistanceFromRoot());
|
|
}
|
|
|
|
|
|
|
|
|
|
TEST(sample_test_case, sample_test)
|
|
{
|
|
EXPECT_EQ(1, 1);
|
|
}
|