Calling AUnit test with parameters.
More...Parameter |
Expected | |
Input | |
Register_Routine |
Expected_Maps (generic instantiation) | |
Input_Maps (generic instantiation) |
It's tedious to create a large amount of very similar AUnit tests who only differ in the input and expected data. This package tries to remedies this by aiding you in registering the test procedure multiple and then providing test data for each call. @formal Input_Type type holding the input data. @formal Expected_Type type holding the expected result.
46 | type Parameter is tagged private; |
---|
Collection of input and expected parameter
68 | function Expected |
---|---|
69 | (P : in Parameter; |
70 | Routine_Name : AUnit.Message_String) |
71 | return Expected_Type with |
72 | Pre => Routine_Name /= null; |
get the expected value
the collection of input and expected parameter
the name of the test. Only the first word is used to locate the data.
the expected result
55 | function Input |
---|---|
56 | (P : in Parameter; |
57 | Routine_Name : AUnit.Message_String) |
58 | return Input_Type with |
59 | Pre => Routine_Name /= null; |
get input data to use.
the collection of input and expected parameter
the name of the test. Only the first word is used to locate the data.
the input data
Register a test for given data. Call multiple times with different names to call execute the test with different data
the collection of input and expected parameter
Test case to register the test with.
Routine to call.
Name of the test. Must be unique and one word only.
Additional description. Is appended to the name to create the Routine_Name
Input test data.
Expected test result.
105 | package Expected_Maps is new Ada.Containers.Indefinite_Ordered_Maps (String, Expected_Type); |
---|
Map to hold the expected values
100 | package Input_Maps is new Ada.Containers.Indefinite_Ordered_Maps (String, Input_Type); |
---|
Map to hold the input values