Class HexaTest

java.lang.Object
com.guinetik.hexafun.testing.HexaTest

public class HexaTest extends Object
Entry point for the HexaFun testing DSL. Provides a fluent API for testing use cases in a HexaApp.
  • Method Details

    • forApp

      public static HexaTest forApp(HexaApp app)
      Create a new HexaTest for the given app.
      Parameters:
      app - The HexaApp to test
      Returns:
      A new HexaTest instance
    • useCase

      public <I, O> UseCaseTest<I,O> useCase(String useCaseName)
      Start testing a use case.
      Type Parameters:
      I - Input type of the use case
      O - Output type of the use case
      Parameters:
      useCaseName - Name of the use case to test
      Returns:
      A new UseCaseTest instance
    • test

      public <I, O> UseCaseTest<I,O> test(String useCaseName)
      Start a test for the specified use case. Simply a shorter method name for useCase() to better match the example in the README.
      Type Parameters:
      I - Input type of the use case
      O - Output type of the use case
      Parameters:
      useCaseName - Name of the use case to test
      Returns:
      A new UseCaseTest instance
    • hasUseCase

      public HexaTest hasUseCase(String useCaseName)
      Verify that a use case exists in the app.
      Parameters:
      useCaseName - Name of the use case to check
      Returns:
      This HexaTest instance
      Throws:
      AssertionError - if the use case doesn't exist
    • doesNotHaveUseCase

      public HexaTest doesNotHaveUseCase(String useCaseName)
      Verify that a use case does not exist in the app.
      Parameters:
      useCaseName - Name of the use case to check
      Returns:
      This HexaTest instance
      Throws:
      AssertionError - if the use case exists