summaryrefslogtreecommitdiffstats
path: root/Godeps/_workspace/src/github.com/anachronistic/apns/client_mock.go
blob: 29a1f4b237949be5ed80209117a646ec4d832026 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
package apns

import "github.com/stretchr/testify/mock"

type MockClient struct {
	mock.Mock
}

func (m *MockClient) ConnectAndWrite(resp *PushNotificationResponse, payload []byte) (err error) {
	return m.Called(resp, payload).Error(0)
}

func (m *MockClient) Send(pn *PushNotification) (resp *PushNotificationResponse) {
	r := m.Called(pn).Get(0)
	if r != nil {
		if r, ok := r.(*PushNotificationResponse); ok {
			return r
		}
	}
	return nil
}