本文整理汇总了C++中Students::numberOfNames方法的典型用法代码示例。如果您正苦于以下问题:C++ Students::numberOfNames方法的具体用法?C++ Students::numberOfNames怎么用?C++ Students::numberOfNames使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Students
的用法示例。
在下文中一共展示了Students::numberOfNames方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Students
TEST(RemoveListTest, RemoveListTest1){
Students* students = new Students();
std::vector<std::string> names;
names.push_back("Andre");
names.push_back("Jim");
names.push_back("Quinn");
//students->addUser("Andre", 0);
//students->addUser("Jim", 1);
//students->addUser("Quinn", 2);
for(int i = 0; i < 3; i++){
students->addUser(names[i], i);
}
students->addUser("Joe", 4);
students->addUser("Billy", 5);
students->addUser("Bob", 6);
EXPECT_EQ(6, students->numberOfNames());
EXPECT_TRUE(students->nameExists("Quinn"));
EXPECT_TRUE(students->nameExists("Andre"));
EXPECT_TRUE(students->nameExists("Jim"));
students->removeList(names);
EXPECT_FALSE(students->nameExists("Quinn"));
EXPECT_FALSE(students->nameExists("Andre"));
EXPECT_FALSE(students->nameExists("Jim"));
EXPECT_EQ(3, students->numberOfNames());
delete students;
}