Class FactorialTest

java.lang.Object
topics.divideconquer.factorial.FactorialTest

@DisplayName("Factorial Paradigms") class FactorialTest extends Object

Validation Suite for Factorial

Ensures mathematical parity across iterative and recursive approaches, validates base cases, and confirms execution stability up to the 64-bit long ceiling (20!).

Author:
vicegd
  • Constructor Details

    • FactorialTest

      FactorialTest()
  • Method Details

    • setup

      @BeforeAll static void setup()
    • shouldCalculateIterativeFactorial

      @Test @DisplayName("Iterative: Calculate standard factorial (6!)") void shouldCalculateIterativeFactorial()
    • shouldHandleIterativeBaseCase

      @Test @DisplayName("Iterative: Handle mathematical base case (0!)") void shouldHandleIterativeBaseCase()
    • shouldCalculateRecursiveFactorial

      @Test @DisplayName("Recursive: Calculate standard factorial (6!)") void shouldCalculateRecursiveFactorial()
    • shouldHandleRecursiveBaseCase

      @Test @DisplayName("Recursive: Handle mathematical base case (0!)") void shouldHandleRecursiveBaseCase()
    • shouldHandleLongCeiling

      @Test @DisplayName("Both: Safely calculate maximum 64-bit bounds (20!)") void shouldHandleLongCeiling()
    • shouldRejectNegativeInputs

      @Test @DisplayName("Both: Reject negative inputs safely") void shouldRejectNegativeInputs()