diff --git a/src/modules/number/NumberTest.cpp b/src/modules/number/NumberTest.cpp index 35a2c08a0..cf2b3e048 100644 --- a/src/modules/number/NumberTest.cpp +++ b/src/modules/number/NumberTest.cpp @@ -12,19 +12,19 @@ class NumberTest : public Test public: }; -TEST_F(NumberTest, givenInvalidRangeArguments_shouldThrowInvalidArgument) +TEST_F(NumberTest, integer_givenInvalidRangeArguments_shouldThrowInvalidArgument) { ASSERT_THROW(Number::integer(10, 2), std::invalid_argument); } -TEST_F(NumberTest, givenRangeWithSameNumberSection_shouldGenerateThisNumber) +TEST_F(NumberTest, givenRangeWithSameNumbers_shouldGenerateThisNumber) { const int actualRandomNumber = Number::integer(2, 2); ASSERT_EQ(actualRandomNumber, 2); } -TEST_F(NumberTest, givenValidRangeArguments_shouldGenerateNumberThatIsInGivenRange) +TEST_F(NumberTest, givenValidRange_shouldGenerateNumberWithinGivenRange) { const int actualRandomNumber = Number::integer(2, 10); @@ -40,6 +40,11 @@ TEST_F(NumberTest, givenSingleArgument_shouldCorrectlyResolveToTwoArgsOverload) ASSERT_TRUE(randomNumber <= 10); } +TEST_F(NumberTest, decimal_givenInvalidRangeArguments_shouldThrowInvalidArgument) +{ + ASSERT_THROW(Number::decimal(10.f, 2.f), std::invalid_argument); +} + TEST_F(NumberTest, givenValidRangeArguments_shouldGenerateDecimalNumberThatIsInGivenRange) { const std::floating_point auto actualRandomNumber = Number::decimal(2.f, 10.f); @@ -55,9 +60,9 @@ TEST_F(NumberTest, givenRangeWithSameNumberSection_shouldGenerateThisNumberForDe ASSERT_EQ(actualRandomNumber, 2.f); } -TEST_F(NumberTest, HexMethodTest) +TEST_F(NumberTest, shouldGenerateHexNumber) { - std::string result = Number::hex(); + auto result = Number::hex(); ASSERT_EQ(result.size(), 1); ASSERT_TRUE(std::isxdigit(result[0]));