From da8a9758727b14e626954d1cd9f0dc9457bfab31 Mon Sep 17 00:00:00 2001 From: Nguyen Quang Huy <78330758+Dev789-del@users.noreply.github.com> Date: Wed, 8 Jun 2022 09:12:37 +0700 Subject: [PATCH] Update BitsCounterTest.java Add 4 test cases from line 69 to 78 --- .../github/pedrovgs/problem1/BitsCounterTest.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/test/java/com/github/pedrovgs/problem1/BitsCounterTest.java b/src/test/java/com/github/pedrovgs/problem1/BitsCounterTest.java index 7ff406d3..d2bac59e 100644 --- a/src/test/java/com/github/pedrovgs/problem1/BitsCounterTest.java +++ b/src/test/java/com/github/pedrovgs/problem1/BitsCounterTest.java @@ -66,7 +66,18 @@ public class BitsCounterTest { @Test public void numberOfBitsInSevenIsThreeBasedOnBinaryOperator() { assertEquals(3, bitsCounter.countBitsToOneBasedOnBinaryOperators(7)); } - + @Test public void numberOfBitsInTenIsFourBasedOnBinaryOperator() { + assertEquals(4, bitsCounter.countBitsToOneBasedOnBinaryOperators(10)); + } + @Test public void numberOfBitsInTwentyIsFiveBasedOnBinaryOperator() { + assertEquals(5, bitsCounter.countBitsToOneBasedOnBinaryOperators(20)); + } + @Test public void numberOfBitsInFortyIsSixBasedOnBinaryOperator() { + assertEquals(6, bitsCounter.countBitsToOneBasedOnBinaryOperators(40)); + } + @Test public void numberOfBitsInThirtyIsFiveBasedOnBinaryOperator() { + assertEquals(5, bitsCounter.countBitsToOneBasedOnBinaryOperators(30)); + } /** * A negative number is represented by calculating its complement and adding 1 to * the result (Two's complement).