...
1 package aipreflect
2
3 import (
4 "testing"
5
6 "gotest.tools/v3/assert"
7 )
8
9 func TestMethodType_IsPlural(t *testing.T) {
10 t.Parallel()
11 for _, tt := range []struct {
12 methodType MethodType
13 expected bool
14 }{
15 {methodType: MethodTypeGet, expected: false},
16 {methodType: MethodTypeCreate, expected: false},
17 {methodType: MethodTypeDelete, expected: false},
18 {methodType: MethodTypeGet, expected: false},
19 {methodType: MethodTypeUndelete, expected: false},
20 {methodType: MethodTypeUpdate, expected: false},
21 {methodType: MethodTypeList, expected: true},
22 {methodType: MethodTypeSearch, expected: true},
23 {methodType: MethodTypeBatchGet, expected: true},
24 {methodType: MethodTypeBatchCreate, expected: true},
25 {methodType: MethodTypeBatchUpdate, expected: true},
26 {methodType: MethodTypeBatchDelete, expected: true},
27 } {
28 assert.Assert(t, tt.methodType.IsPlural() == tt.expected, tt.methodType)
29 }
30 }
31
View as plain text