func TestUserAges_Get(t *testing.T) {????type fields struct {????????ages ?map[string]int????????Mutex sync.Mutex????}????type args struct {????????name string????}????tests := []struct {????????name ? string????????fields fields????????args ? args????????want ? int????}{????????// TODO 以上結(jié)構(gòu)體中的參數(shù)寫法????}????for _, tt := range tests {????????t.Run(tt.name, func(t *testing.T) {????????????ua := &UserAges{????????????????ages: ?tt.fields.ages,????????????????Mutex: tt.fields.Mutex,????????????}????????????if got := ua.Get(tt.args.name); got != tt.want {????????????????t.Errorf("UserAges.Get() = %v, want %v", got, tt.want)????????????}????????})????}}
- 3 回答
- 0 關(guān)注
- 1224 瀏覽
添加回答
舉報(bào)
0/150
提交
取消