This commit is contained in:
31
tests/s0007_reverse_integer.cpp
Normal file
31
tests/s0007_reverse_integer.cpp
Normal file
@@ -0,0 +1,31 @@
|
||||
#include "s0007_reverse_integer.hpp"
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
TEST(Problem7, Case1) {
|
||||
int i = 123;
|
||||
int o = 321;
|
||||
Solution solution;
|
||||
EXPECT_EQ(solution.reverse(i), o);
|
||||
}
|
||||
|
||||
TEST(Problem7, Case2) {
|
||||
int i = -123;
|
||||
int o = -321;
|
||||
Solution solution;
|
||||
EXPECT_EQ(solution.reverse(i), o);
|
||||
}
|
||||
|
||||
TEST(Problem7, Case3) {
|
||||
int i = 120;
|
||||
int o = 21;
|
||||
Solution solution;
|
||||
EXPECT_EQ(solution.reverse(i), o);
|
||||
}
|
||||
|
||||
TEST(Problem7, Case4) {
|
||||
int i = -2147483648;
|
||||
int o = 0;
|
||||
Solution solution;
|
||||
EXPECT_EQ(solution.reverse(i), o);
|
||||
}
|
Reference in New Issue
Block a user