From 5e7cd8e29b9a26cf03c519d0de439cbceae70a7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Cie=C5=9Blar?= Date: Sat, 12 Oct 2024 10:24:33 +0100 Subject: [PATCH] feat: add missing tests for number module (#955) --- tests/modules/number_test.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/modules/number_test.cpp b/tests/modules/number_test.cpp index c097b9bfa..5de5164e1 100644 --- a/tests/modules/number_test.cpp +++ b/tests/modules/number_test.cpp @@ -208,6 +208,11 @@ TEST_F(NumberTest, shouldGenerateBinary) { return std::string("01").find(binaryNumberCharacter) != std::string::npos; })); } +TEST_F(NumberTest, shouldThrowInvalidArgumentForNegativeLength) +{ + ASSERT_THROW(binary(-1), std::invalid_argument); +} + TEST_F(NumberTest, givenValidArguments_shouldGenerateBinaryNumberInRange) { const std::string generatedBinary = binary(1234, 1236);