mirror of
https://github.com/ttroy50/cmake-examples.git
synced 2025-12-18 12:14:36 +03:00
40 lines
580 B
C++
40 lines
580 B
C++
#include <string>
|
|
#include "Reverse.h"
|
|
#include "Palindrome.h"
|
|
|
|
#include <gtest/gtest.h>
|
|
|
|
class ReverseTests : public ::testing::Test
|
|
{
|
|
};
|
|
|
|
TEST_F(ReverseTests, simple )
|
|
{
|
|
std::string toRev = "Hello";
|
|
|
|
Reverse rev;
|
|
std::string res = rev.reverse(toRev);
|
|
|
|
EXPECT_EQ(res, "olleH" );
|
|
|
|
}
|
|
|
|
TEST_F(ReverseTests, empty )
|
|
{
|
|
std::string toRev;
|
|
|
|
Reverse rev;
|
|
std::string res = rev.reverse(toRev);
|
|
|
|
EXPECT_EQ(res, "" );
|
|
}
|
|
|
|
TEST_F(ReverseTests, is_palindrome )
|
|
{
|
|
std::string pal = "mom";
|
|
Palindrome pally;
|
|
|
|
EXPECT_TRUE(pally.isPalindrome(pal));
|
|
|
|
}
|