-
Notifications
You must be signed in to change notification settings - Fork 28
Expand file tree
/
Copy pathmodel_access_token_test.go
More file actions
58 lines (51 loc) · 1007 Bytes
/
model_access_token_test.go
File metadata and controls
58 lines (51 loc) · 1007 Bytes
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
/*
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 TestAccessTokenStatus_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(`"expired"`),
},
wantErr: false,
},
{
name: "fail",
args: args{
src: []byte("\"FOOBAR\""),
},
wantErr: true,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
v := AccessTokenStatus("")
if err := v.UnmarshalJSON(tt.args.src); (err != nil) != tt.wantErr {
t.Errorf("UnmarshalJSON() error = %v, wantErr %v", err, tt.wantErr)
}
})
}
}