eia-api-go/pkg/eia/eia_reflection_test.go

41 lines
635 B
Go
Raw Normal View History

2024-12-05 17:59:02 +00:00
package eia
import (
"reflect"
"testing"
)
func TestGetRoutes(t *testing.T) {
type args struct {
suffixes []string
}
tests := []struct {
name string
args args
want []string
}{
{
name: "List known routes",
args: args{
suffixes: []string{
"Aeo",
"Electricity",
"Gas",
},
},
want: []string{
"GetV2Aeo",
"GetV2Electricity",
"GetV2NaturalGas",
},
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
if got := GetRoutes(tt.args.suffixes...); !reflect.DeepEqual(got, tt.want) {
t.Errorf("GetRoutes() = %v, want %v", got, tt.want)
}
})
}
}