-
Notifications
You must be signed in to change notification settings - Fork 0
/
double.go
131 lines (109 loc) · 6.13 KB
/
double.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
// Code generated by go doublegen; DO NOT EDIT.
// This file was generated at 2020-02-14T22:13:33+11:00
// Package kinesisvideosignalingchannelsdouble provides a TestDouble implementation of kinesisvideosignalingchannelsiface.KinesisVideoSignalingChannelsAPI
package kinesisvideosignalingchannelsdouble
import (
"context"
"github.com/aws/aws-sdk-go/aws/awserr"
"github.com/aws/aws-sdk-go/aws/request"
"github.com/aws/aws-sdk-go/service/kinesisvideosignalingchannels"
"github.com/aws/aws-sdk-go/service/kinesisvideosignalingchannels/kinesisvideosignalingchannelsiface"
"github.com/lwoggardner/awsdouble"
"github.com/lwoggardner/godouble/godouble"
)
// KinesisVideoSignalingChannelsDouble is TestDouble for kinesisvideosignalingchannelsiface.KinesisVideoSignalingChannelsAPI
type KinesisVideoSignalingChannelsDouble struct {
kinesisvideosignalingchannelsiface.KinesisVideoSignalingChannelsAPI
*awsdouble.AWSTestDouble
}
// Constructor for KinesisVideoSignalingChannelsDouble
// Default configuration will ensure
// * API operations not explicitly stubbed will return an empty output struct pointer, and nil error.
// To simulate long polling, "Poll" operations will return these values after a random delay of up to 100ms.
// * WithContext methods implement a 'Fake' method that returns a cancellation error if the context is cancelled
// before the method is called.
// * Pages and PagesWithContext methods similarly implement a 'Fake' method that paginates over the underlying method.
//
// This allows tests to only stub the simple api methods and be generally unconcerned whether the SUT is using the
// Context or Pagination forms of the API.
//
func NewDouble(t godouble.T, configurators ...func(*awsdouble.AWSTestDouble)) *KinesisVideoSignalingChannelsDouble {
result := &KinesisVideoSignalingChannelsDouble{}
configurators = append([]func(configurator *awsdouble.AWSTestDouble){func(d *awsdouble.AWSTestDouble) {
d.SetDefaultCall(result.defaultMethodCall)
d.SetDefaultReturnValues(result.defaultReturnValues)
}}, configurators...)
result.AWSTestDouble = awsdouble.NewDouble(t, (*kinesisvideosignalingchannelsiface.KinesisVideoSignalingChannelsAPI)(nil), configurators...)
return result
}
func (d *KinesisVideoSignalingChannelsDouble) defaultReturnValues(m godouble.Method) godouble.ReturnValues {
return d.DefaultReturnValues(m)
}
func (d *KinesisVideoSignalingChannelsDouble) defaultMethodCall(m godouble.Method) godouble.MethodCall {
switch m.Reflect().Name {
case "GetIceServerConfigWithContext":
return m.Fake(d.fakeGetIceServerConfigWithContext)
case "SendAlexaOfferToMasterWithContext":
return m.Fake(d.fakeSendAlexaOfferToMasterWithContext)
default:
return nil
}
}
func (d *KinesisVideoSignalingChannelsDouble) GetIceServerConfig(i0 *kinesisvideosignalingchannels.GetIceServerConfigInput) (r0 *kinesisvideosignalingchannels.GetIceServerConfigOutput, r1 error) {
d.TestDouble.T().Helper()
returns := d.TestDouble.Invoke("GetIceServerConfig", i0)
r0, _ = returns[0].(*kinesisvideosignalingchannels.GetIceServerConfigOutput)
r1, _ = returns[1].(error)
return
}
func (d *KinesisVideoSignalingChannelsDouble) GetIceServerConfigRequest(i0 *kinesisvideosignalingchannels.GetIceServerConfigInput) (r0 *request.Request, r1 *kinesisvideosignalingchannels.GetIceServerConfigOutput) {
d.TestDouble.T().Helper()
returns := d.TestDouble.Invoke("GetIceServerConfigRequest", i0)
r0, _ = returns[0].(*request.Request)
r1, _ = returns[1].(*kinesisvideosignalingchannels.GetIceServerConfigOutput)
return
}
func (d *KinesisVideoSignalingChannelsDouble) GetIceServerConfigWithContext(i0 context.Context, i1 *kinesisvideosignalingchannels.GetIceServerConfigInput, i2 ...request.Option) (r0 *kinesisvideosignalingchannels.GetIceServerConfigOutput, r1 error) {
d.TestDouble.T().Helper()
returns := d.TestDouble.Invoke("GetIceServerConfigWithContext", i0, i1, i2)
r0, _ = returns[0].(*kinesisvideosignalingchannels.GetIceServerConfigOutput)
r1, _ = returns[1].(error)
return
}
func (d *KinesisVideoSignalingChannelsDouble) fakeGetIceServerConfigWithContext(ctx context.Context, in *kinesisvideosignalingchannels.GetIceServerConfigInput, _ ...request.Option) (*kinesisvideosignalingchannels.GetIceServerConfigOutput, error) {
select {
case <-ctx.Done():
return nil, awserr.New(request.CanceledErrorCode, "GetIceServerConfig cancelled", ctx.Err())
default:
return d.GetIceServerConfig(in)
}
}
func (d *KinesisVideoSignalingChannelsDouble) SendAlexaOfferToMaster(i0 *kinesisvideosignalingchannels.SendAlexaOfferToMasterInput) (r0 *kinesisvideosignalingchannels.SendAlexaOfferToMasterOutput, r1 error) {
d.TestDouble.T().Helper()
returns := d.TestDouble.Invoke("SendAlexaOfferToMaster", i0)
r0, _ = returns[0].(*kinesisvideosignalingchannels.SendAlexaOfferToMasterOutput)
r1, _ = returns[1].(error)
return
}
func (d *KinesisVideoSignalingChannelsDouble) SendAlexaOfferToMasterRequest(i0 *kinesisvideosignalingchannels.SendAlexaOfferToMasterInput) (r0 *request.Request, r1 *kinesisvideosignalingchannels.SendAlexaOfferToMasterOutput) {
d.TestDouble.T().Helper()
returns := d.TestDouble.Invoke("SendAlexaOfferToMasterRequest", i0)
r0, _ = returns[0].(*request.Request)
r1, _ = returns[1].(*kinesisvideosignalingchannels.SendAlexaOfferToMasterOutput)
return
}
func (d *KinesisVideoSignalingChannelsDouble) SendAlexaOfferToMasterWithContext(i0 context.Context, i1 *kinesisvideosignalingchannels.SendAlexaOfferToMasterInput, i2 ...request.Option) (r0 *kinesisvideosignalingchannels.SendAlexaOfferToMasterOutput, r1 error) {
d.TestDouble.T().Helper()
returns := d.TestDouble.Invoke("SendAlexaOfferToMasterWithContext", i0, i1, i2)
r0, _ = returns[0].(*kinesisvideosignalingchannels.SendAlexaOfferToMasterOutput)
r1, _ = returns[1].(error)
return
}
func (d *KinesisVideoSignalingChannelsDouble) fakeSendAlexaOfferToMasterWithContext(ctx context.Context, in *kinesisvideosignalingchannels.SendAlexaOfferToMasterInput, _ ...request.Option) (*kinesisvideosignalingchannels.SendAlexaOfferToMasterOutput, error) {
select {
case <-ctx.Done():
return nil, awserr.New(request.CanceledErrorCode, "SendAlexaOfferToMaster cancelled", ctx.Err())
default:
return d.SendAlexaOfferToMaster(in)
}
}