-
Notifications
You must be signed in to change notification settings - Fork 28
Expand file tree
/
Copy pathmodel_logs_instance_test.go
More file actions
65 lines (58 loc) · 1.11 KB
/
model_logs_instance_test.go
File metadata and controls
65 lines (58 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/*
STACKIT Logs API
This API provides endpoints for managing STACKIT Logs.
API version: 1.0.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package logs
import (
"testing"
)
// isEnum
func TestLogsInstanceStatus_UnmarshalJSON(t *testing.T) {
type args struct {
src []byte
}
tests := []struct {
name string
args args
wantErr bool
}{
{
name: `success - possible enum value no. 1`,
args: args{
src: []byte(`"active"`),
},
wantErr: false,
},
{
name: `success - possible enum value no. 2`,
args: args{
src: []byte(`"deleting"`),
},
wantErr: false,
},
{
name: `success - possible enum value no. 3`,
args: args{
src: []byte(`"reconciling"`),
},
wantErr: false,
},
{
name: "fail",
args: args{
src: []byte("\"FOOBAR\""),
},
wantErr: true,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
v := LogsInstanceStatus("")
if err := v.UnmarshalJSON(tt.args.src); (err != nil) != tt.wantErr {
t.Errorf("UnmarshalJSON() error = %v, wantErr %v", err, tt.wantErr)
}
})
}
}