(structValidation *StructValidation, configData interface{}, expected interface{}, t *testing.T)
| 1020 | } |
| 1021 | |
| 1022 | func testConfig(structValidation *StructValidation, configData interface{}, expected interface{}, t *testing.T) { |
| 1023 | config := reflect.New(reflect.TypeOf(expected).Elem()).Interface() |
| 1024 | |
| 1025 | errs := Struct(config, configData, structValidation) |
| 1026 | |
| 1027 | if errs != nil { |
| 1028 | for _, err := range errs { |
| 1029 | fmt.Println("ERROR: " + errors.Message(err)) |
| 1030 | } |
| 1031 | } |
| 1032 | require.Empty(t, errs) |
| 1033 | |
| 1034 | require.Equal(t, expected, config) |
| 1035 | } |
| 1036 | |
| 1037 | func testConfigError(structValidation *StructValidation, configData interface{}, expectedTypeInstance interface{}, t *testing.T) { |
| 1038 | config := reflect.New(reflect.TypeOf(expectedTypeInstance).Elem()).Interface() |
no test coverage detected