package sentio import "testing" func TestParseTimeInForce(t *testing.T) { tests := []struct { name string arg string want TimeInForce wantErr bool }{ { name: "DAY", arg: "day", want: TIFDay, wantErr: false, }, { name: "DAY", arg: "Day", want: TIFDay, wantErr: false, }, { name: "DAY", arg: " day", want: TIFDay, wantErr: false, }, { name: "Unknown", arg: "D ay", want: -1, wantErr: true, }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { got, err := ParseTimeInForce(tt.arg) if (err != nil) != tt.wantErr { t.Errorf("ParseTimeInForce() error = %v, wantErr %v", err, tt.wantErr) return } if got != tt.want { t.Errorf("ParseTimeInForce() got = %v, want %v", got, tt.want) } }) } }