From 838916d8e9393b4618ab5245c5f52fc62df0ab3b Mon Sep 17 00:00:00 2001 From: Nandini Anagondi <91892829+naanagon@users.noreply.github.com> Date: Thu, 27 Oct 2022 16:47:38 +0530 Subject: [PATCH] Add test case for hexadecimal to decimal (#3685) --- .../conversions/HexaDecimalToDecimalTest.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 src/test/java/com/thealgorithms/conversions/HexaDecimalToDecimalTest.java diff --git a/src/test/java/com/thealgorithms/conversions/HexaDecimalToDecimalTest.java b/src/test/java/com/thealgorithms/conversions/HexaDecimalToDecimalTest.java new file mode 100644 index 00000000..5a7838e7 --- /dev/null +++ b/src/test/java/com/thealgorithms/conversions/HexaDecimalToDecimalTest.java @@ -0,0 +1,14 @@ +package com.thealgorithms.conversions; + +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +public class HexaDecimalToDecimalTest { + + @Test + public void testhexaDecimalToDecimal(){ + assertEquals(161, HexaDecimalToDecimal.getHexaToDec("A1")); + assertEquals(428, HexaDecimalToDecimal.getHexaToDec("1ac")); + } +}