Skip to content

Commit

Permalink
added unit tests for isBetween() function
Browse files Browse the repository at this point in the history
  • Loading branch information
JoelGunawan committed Oct 14, 2024
1 parent 0553e06 commit d9ad11a
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions test/unit/tcframe/validator/NumberValidatorTests.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#include "gmock/gmock.h"

#include "tcframe/validator/number.hpp"

using ::testing::Eq;
using ::testing::Test;

namespace tcframe {

class NumberValidatorTests : public Test {};

TEST_F(NumberValidatorTests, isBetween) {
EXPECT_FALSE(isBetween(5, 1, 4));
EXPECT_FALSE(isBetween(5, 6, 10));
EXPECT_FALSE(isBetween(5, 100, -100));
EXPECT_TRUE(isBetween(5, 1, 5));
EXPECT_TRUE(isBetween(5, 5, 10));
EXPECT_TRUE(isBetween(5, 0, 10));
}

}

0 comments on commit d9ad11a

Please sign in to comment.