-
Notifications
You must be signed in to change notification settings - Fork 0
/
client_test.go
64 lines (58 loc) · 1.9 KB
/
client_test.go
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
59
60
61
62
63
64
package vpic
import (
"context"
"testing"
. "github.com/smartystreets/goconvey/convey"
)
func TestModelsByMakeIDAndYearVehicleType(t *testing.T) {
Convey("ModelsByMakeIDAndYearVehicleType method", t, func() {
Convey("should return "+ErrArgsInvalid.Error(), func() {
c := Client{}
resp, err := c.ModelsByMakeIDAndYearVehicleType(context.Background(), 0, 474, "")
So(err, ShouldEqual, ErrArgsInvalid)
So(resp, ShouldBeNil)
})
Convey("should return "+ErrYearInvalid.Error(), func() {
c := Client{}
resp, err := c.ModelsByMakeIDAndYearVehicleType(context.Background(), 1994, 474, "")
So(err, ShouldEqual, ErrYearInvalid)
So(resp, ShouldBeNil)
})
})
}
func TestModelsByMakeAndYearVehicleType(t *testing.T) {
Convey("ModelsByMakeAndYearVehicleType method", t, func() {
Convey("Should return "+ErrArgsInvalid.Error(), func() {
c := Client{}
resp, err := c.ModelsByMakeAndYearVehicleType(context.Background(), 0, "honda", "")
So(err, ShouldEqual, ErrArgsInvalid)
So(resp, ShouldBeNil)
})
Convey("Should return "+ErrYearInvalid.Error(), func() {
c := Client{}
resp, err := c.ModelsByMakeAndYearVehicleType(context.Background(), 1994, "honda", "")
So(err, ShouldEqual, ErrYearInvalid)
So(resp, ShouldBeNil)
})
})
}
func TestCanadianSpecs(t *testing.T) {
Convey("CanadianSpecs method", t, func() {
Convey("should return "+ErrYearInvalid.Error(), func() {
c := Client{}
resp, err := c.CanadianVehicleSpecs(context.Background(), 1960, "Acura", "", nil)
So(err, ShouldEqual, ErrYearInvalid)
So(resp, ShouldBeNil)
})
})
}
func TestEquipmentPlantCodes(t *testing.T) {
Convey("EquipmentPlantCodes method", t, func() {
Convey("should return "+ErrYearInvalid.Error(), func() {
c := Client{}
resp, err := c.EquipmentPlantCodes(context.Background(), 2017, EquipmentTypeTires, ReportTypeAll)
So(err, ShouldEqual, ErrYearInvalid)
So(resp, ShouldBeNil)
})
})
}