HelloWorldTest.cpp 453 B

1234567891011121314151617181920212223
  1. #include "gtest/gtest.h"
  2. #include "HelloWorld.h"
  3. #include <string>
  4. using namespace std;
  5. TEST(HelloWorldTest, test0)
  6. {
  7. HelloWorld hello;
  8. string expected("Hello World");
  9. ASSERT_EQ(expected, hello.message());
  10. }
  11. TEST(HelloWorldTest, test1)
  12. {
  13. string expected("Hola Mundo");
  14. HelloWorld hello(expected);
  15. ASSERT_EQ(expected, hello.message());
  16. expected = "Hello, world!";
  17. hello.setMessage(expected);
  18. ASSERT_EQ(expected, hello.message());
  19. }