// // Created by trotfunky on 07/05/19. // #include #include "Circle.h" #include "xmlParser.h" TEST(readXML,initEmptyCircle) { xmlParser::Circle cercle = xmlParser::Circle(); ASSERT_EQ(cercle.x,0); ASSERT_EQ(cercle.y,1); ASSERT_EQ(cercle.r,2); ASSERT_EQ(cercle.label,"Test circle"); } TEST(readXML,initEmptyCirclePugiXML) { xmlParser::Circle cercle = xmlParser::Circle(); pugi::xml_node node; ASSERT_EQ(cercle.x,0); ASSERT_EQ(cercle.y,1); ASSERT_EQ(cercle.r,2); ASSERT_EQ(cercle.label,"Test circle"); } TEST(readXML,parseXMLCircle) { std::string xml = "\n" ""; pugi::xml_document doc; pugi::xml_parse_result result = doc.load_string(xml.c_str()); EXPECT_NE(0,result); pugi::xml_node node = doc.child("Circle"); xmlParser::Circle cercle = xmlParser::Circle(node); ASSERT_EQ(cercle.x,0); ASSERT_EQ(cercle.y,1); ASSERT_EQ(cercle.r,2); ASSERT_EQ(cercle.label,"testCircle"); } int main(int argc, char** argv) { ::testing::InitGoogleTest(&argc,argv); return RUN_ALL_TESTS(); }