gitlab.com/evatix-go/core@v1.3.55/tests/integratedtests/enumimpltests/enumTestCases.go (about)

     1  package enumimpltests
     2  
     3  import (
     4  	"gitlab.com/evatix-go/core/coredata/corerange"
     5  	"gitlab.com/evatix-go/core/coreimpl/enumimpl/enumtype"
     6  )
     7  
     8  var enumTestCases = []TestWrapper{
     9  	{
    10  		Header: "Byte enum example min 0, max 10",
    11  		ExpectedMinMax: corerange.MinMaxInt64{
    12  			Min: 0,
    13  			Max: 10,
    14  		},
    15  		EnumMap: map[string]interface{}{
    16  			"Invalid":   0,
    17  			"A":         -2,
    18  			"B":         8,
    19  			"C":         5,
    20  			"Something": 10,
    21  		},
    22  		EnumType: enumtype.Byte,
    23  	},
    24  	{
    25  		Header: "Integer8 enum example min -2, max 12",
    26  		ExpectedMinMax: corerange.MinMaxInt64{
    27  			Min: -2,
    28  			Max: 12,
    29  		},
    30  		EnumMap: map[string]interface{}{
    31  			"Invalid":   -2,
    32  			"A":         -2,
    33  			"B":         8,
    34  			"C":         5,
    35  			"Something": 12,
    36  		},
    37  		EnumType: enumtype.Integer8,
    38  	},
    39  	{
    40  		Header: "Integer16 enum example min -3, max 14",
    41  		ExpectedMinMax: corerange.MinMaxInt64{
    42  			Min: -3,
    43  			Max: 14,
    44  		},
    45  		EnumMap: map[string]interface{}{
    46  			"Invalid":   -3,
    47  			"A":         -2,
    48  			"B":         -3,
    49  			"C":         5,
    50  			"Something": 14,
    51  		},
    52  		EnumType: enumtype.Integer16,
    53  	},
    54  	{
    55  		Header: "Integer32 enum example min -4, max 15",
    56  		ExpectedMinMax: corerange.MinMaxInt64{
    57  			Min: -4,
    58  
    59  			Max: 15,
    60  		},
    61  		EnumMap: map[string]interface{}{
    62  			"Invalid":   -4,
    63  			"A":         -2,
    64  			"B":         -3,
    65  			"C":         5,
    66  			"Something": 15,
    67  		},
    68  		EnumType: enumtype.Integer16,
    69  	},
    70  
    71  	{
    72  		Header: "UnsignedInteger16 enum example min 0, max 20",
    73  		ExpectedMinMax: corerange.MinMaxInt64{
    74  			Min: 0,
    75  			Max: 20,
    76  		},
    77  		EnumMap: map[string]interface{}{
    78  			"Invalid":    0,
    79  			"Something2": 15,
    80  			"B":          15,
    81  			"Something":  20,
    82  		},
    83  		EnumType: enumtype.UnsignedInteger16,
    84  	},
    85  	{
    86  		Header: "String enum example min 0, max 20",
    87  		ExpectedMinMax: corerange.MinMaxInt64{
    88  			Min: 0,
    89  			Max: 20,
    90  		},
    91  		EnumMap: map[string]interface{}{
    92  			"Invalid":    0,
    93  			"Something2": 15,
    94  			"B":          15,
    95  			"Something":  20,
    96  		},
    97  		EnumType: enumtype.String,
    98  	},
    99  }