-
Notifications
You must be signed in to change notification settings - Fork 7
/
config_mock.go
67 lines (60 loc) · 1.98 KB
/
config_mock.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
// Code generated by moq; DO NOT EDIT.
// github.com/matryer/moq
package actions
import (
"github.com/lunarway/release-manager/internal/git"
"sync"
)
// Ensure, that GitConfigAPIMock does implement GitConfigAPI.
// If this is not the case, regenerate this file with moq.
var _ GitConfigAPI = &GitConfigAPIMock{}
// GitConfigAPIMock is a mock implementation of GitConfigAPI.
//
// func TestSomethingThatUsesGitConfigAPI(t *testing.T) {
//
// // make and configure a mocked GitConfigAPI
// mockedGitConfigAPI := &GitConfigAPIMock{
// CommitterDetailsFunc: func() (*git.CommitterDetails, error) {
// panic("mock out the CommitterDetails method")
// },
// }
//
// // use mockedGitConfigAPI in code that requires GitConfigAPI
// // and then make assertions.
//
// }
type GitConfigAPIMock struct {
// CommitterDetailsFunc mocks the CommitterDetails method.
CommitterDetailsFunc func() (*git.CommitterDetails, error)
// calls tracks calls to the methods.
calls struct {
// CommitterDetails holds details about calls to the CommitterDetails method.
CommitterDetails []struct {
}
}
lockCommitterDetails sync.RWMutex
}
// CommitterDetails calls CommitterDetailsFunc.
func (mock *GitConfigAPIMock) CommitterDetails() (*git.CommitterDetails, error) {
if mock.CommitterDetailsFunc == nil {
panic("GitConfigAPIMock.CommitterDetailsFunc: method is nil but GitConfigAPI.CommitterDetails was just called")
}
callInfo := struct {
}{}
mock.lockCommitterDetails.Lock()
mock.calls.CommitterDetails = append(mock.calls.CommitterDetails, callInfo)
mock.lockCommitterDetails.Unlock()
return mock.CommitterDetailsFunc()
}
// CommitterDetailsCalls gets all the calls that were made to CommitterDetails.
// Check the length with:
// len(mockedGitConfigAPI.CommitterDetailsCalls())
func (mock *GitConfigAPIMock) CommitterDetailsCalls() []struct {
} {
var calls []struct {
}
mock.lockCommitterDetails.RLock()
calls = mock.calls.CommitterDetails
mock.lockCommitterDetails.RUnlock()
return calls
}