Skip to content

Instantly share code, notes, and snippets.

@zerokol zerokol/person-test.cpp
Last active Feb 12, 2019

Embed
What would you like to do?
// Tests file: person-test.cpp
#include "Person.h"
#include "gtest/gtest.h"
#include "string"
using std::string;
TEST(Person, testNameMethods)
{
string name = "AJ O. Alves";
Person *person = new Person();
person->setName(name);
EXPECT_EQ(person->getName(), name);
}
TEST(Person, testAgeMethods)
{
int age = 24;
Person *person = new Person();
person->setAge(age);
EXPECT_EQ(person->getAge(), age);
}
int main(int argc, char **argv)
{
testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.