-
Notifications
You must be signed in to change notification settings - Fork 1
/
client_fake.go
47 lines (37 loc) · 1.17 KB
/
client_fake.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
package modzy
// ClientFake is meant to help in mocking the Client interface easily for unit testing.
type ClientFake struct {
WithAPIKeyFunc func(apiKey string) Client
WithTeamKeyFunc func(teamID string, token string) Client
WithOptionsFunc func(opts ...ClientOption) Client
AccountingFunc func() AccountingClient
JobsFunc func() JobsClient
ModelsFunc func() ModelsClient
DashboardFunc func() DashboardClient
ResourcesFunc func() ResourcesClient
}
var _ Client = &ClientFake{}
func (c *ClientFake) WithAPIKey(apiKey string) Client {
return c.WithAPIKeyFunc(apiKey)
}
func (c *ClientFake) WithTeamKey(teamID string, token string) Client {
return c.WithTeamKeyFunc(teamID, token)
}
func (c *ClientFake) WithOptions(opts ...ClientOption) Client {
return c.WithOptionsFunc(opts...)
}
func (c *ClientFake) Accounting() AccountingClient {
return c.AccountingFunc()
}
func (c *ClientFake) Jobs() JobsClient {
return c.JobsFunc()
}
func (c *ClientFake) Models() ModelsClient {
return c.ModelsFunc()
}
func (c *ClientFake) Dashboard() DashboardClient {
return c.DashboardFunc()
}
func (c *ClientFake) Resources() ResourcesClient {
return c.ResourcesFunc()
}