Skip to content

Commit

Permalink
[Add] Handshake / More test cases ;)
Browse files Browse the repository at this point in the history
  • Loading branch information
iJotape4 committed Feb 20, 2025
1 parent 8fb0993 commit d2e337d
Showing 1 changed file with 89 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class Test_HandShake : public ::testing::Test
}
};

TEST_F(Test_HandShake, test01)
TEST_F(Test_HandShake, Line)
{
int setsAmount = 2;
std::vector<std::string> sets
Expand All @@ -21,4 +21,92 @@ TEST_F(Test_HandShake, test01)
};
std::string result = classFile.compute_input(setsAmount, sets);
EXPECT_EQ(result, "0 \n 1");
}

TEST_F(Test_HandShake, Triangle)
{
int setsAmount = 3;
std::vector<std::string> sets
{
"1","2","3"
};
std::string result = classFile.compute_input(setsAmount, sets);
EXPECT_EQ(result, "0 \n 1 \n 3");
}

TEST_F(Test_HandShake, Square)
{
int setsAmount = 4;
std::vector<std::string> sets
{
"1","2","3","4"
};
std::string result = classFile.compute_input(setsAmount, sets);
EXPECT_EQ(result, "0 \n 1 \n 3 \n 6");
}

TEST_F(Test_HandShake, Pentagon)
{
int setsAmount = 5;
std::vector<std::string> sets
{
"1","2","3","4","5"
};
std::string result = classFile.compute_input(setsAmount, sets);
EXPECT_EQ(result, "0 \n 1 \n 3 \n 6 \n 10");
}

TEST_F(Test_HandShake, Hexagon)
{
int setsAmount = 6;
std::vector<std::string> sets
{
"1","2","3","4","5","6"
};
std::string result = classFile.compute_input(setsAmount, sets);
EXPECT_EQ(result, "0 \n 1 \n 3 \n 6 \n 10 \n 15");
}

TEST_F(Test_HandShake, Heptagon)
{
int setsAmount = 7;
std::vector<std::string> sets
{
"1","2","3","4","5","6","7"
};
std::string result = classFile.compute_input(setsAmount, sets);
EXPECT_EQ(result, "0 \n 1 \n 3 \n 6 \n 10 \n 15 \n 21");
}

TEST_F(Test_HandShake, Octagon)
{
int setsAmount = 8;
std::vector<std::string> sets
{
"1","2","3","4","5","6","7","8"
};
std::string result = classFile.compute_input(setsAmount, sets);
EXPECT_EQ(result, "0 \n 1 \n 3 \n 6 \n 10 \n 15 \n 21 \n 28");
}

TEST_F(Test_HandShake, Nonagon)
{
int setsAmount = 9;
std::vector<std::string> sets
{
"1","2","3","4","5","6","7","8","9"
};
std::string result = classFile.compute_input(setsAmount, sets);
EXPECT_EQ(result, "0 \n 1 \n 3 \n 6 \n 10 \n 15 \n 21 \n 28 \n 36");
}

TEST_F(Test_HandShake, Decagon)
{
int setsAmount = 10;
std::vector<std::string> sets
{
"1","2","3","4","5","6","7","8","9","10"
};
std::string result = classFile.compute_input(setsAmount, sets);
EXPECT_EQ(result, "0 \n 1 \n 3 \n 6 \n 10 \n 15 \n 21 \n 28 \n 36 \n 45");
}

0 comments on commit d2e337d

Please sign in to comment.