Package com.guinetik.hexafun.testing
Class HexaTest
java.lang.Object
com.guinetik.hexafun.testing.HexaTest
Entry point for the HexaFun testing DSL.
Provides a fluent API for testing use cases in a HexaApp.
-
Method Summary
Modifier and TypeMethodDescriptiondoesNotHaveUseCase(String useCaseName) Verify that a use case does not exist in the app.static HexaTestCreate a new HexaTest for the given app.hasUseCase(String useCaseName) Verify that a use case exists in the app.<I,O> UseCaseTest<I, O> Start a test for the specified use case.<I,O> UseCaseTest<I, O> Start testing a use case.
-
Method Details
-
forApp
Create a new HexaTest for the given app.- Parameters:
app- The HexaApp to test- Returns:
- A new HexaTest instance
-
useCase
Start testing a use case.- Type Parameters:
I- Input type of the use caseO- Output type of the use case- Parameters:
useCaseName- Name of the use case to test- Returns:
- A new UseCaseTest instance
-
test
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 caseO- Output type of the use case- Parameters:
useCaseName- Name of the use case to test- Returns:
- A new UseCaseTest instance
-
hasUseCase
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
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
-