Documentation
¶
Overview ¶
Package mapping contains utilities for testing mapping between structs and enums.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckAllEnumValuesAreMapped ¶
func CheckAllEnumValuesAreMapped[T, M comparable](t testingT, from []T, to []M, mapper func(T) M)
CheckAllEnumValuesAreMapped checks if all values from the 'from' enum are mapped to the 'to' enum. It converts the enums to slices and then checks if each value in the 'from' slice is present in the 'to' slice. It uses the 'mapper' function to convert the 'from' enum value to the 'to' enum value.
func CheckAllFieldsAreMapped ¶
CheckAllFieldsAreMapped checks if all fields from the 'from' struct are mapped to the 'to' struct. It uses reflection to iterate over the fields in the 'from' struct and checks if each field is present in the 'to' struct.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.