1 Star 0 Fork 0

小庄 / fabric

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
transaction_registry.go 3.69 KB
一键复制 编辑 原始数据 按行查看 历史
// Code generated by counterfeiter. DO NOT EDIT.
package mock
import (
"sync"
)
type TransactionRegistry struct {
AddStub func(string, string) bool
addMutex sync.RWMutex
addArgsForCall []struct {
arg1 string
arg2 string
}
addReturns struct {
result1 bool
}
addReturnsOnCall map[int]struct {
result1 bool
}
RemoveStub func(string, string)
removeMutex sync.RWMutex
removeArgsForCall []struct {
arg1 string
arg2 string
}
invocations map[string][][]interface{}
invocationsMutex sync.RWMutex
}
func (fake *TransactionRegistry) Add(arg1 string, arg2 string) bool {
fake.addMutex.Lock()
ret, specificReturn := fake.addReturnsOnCall[len(fake.addArgsForCall)]
fake.addArgsForCall = append(fake.addArgsForCall, struct {
arg1 string
arg2 string
}{arg1, arg2})
fake.recordInvocation("Add", []interface{}{arg1, arg2})
fake.addMutex.Unlock()
if fake.AddStub != nil {
return fake.AddStub(arg1, arg2)
}
if specificReturn {
return ret.result1
}
fakeReturns := fake.addReturns
return fakeReturns.result1
}
func (fake *TransactionRegistry) AddCallCount() int {
fake.addMutex.RLock()
defer fake.addMutex.RUnlock()
return len(fake.addArgsForCall)
}
func (fake *TransactionRegistry) AddCalls(stub func(string, string) bool) {
fake.addMutex.Lock()
defer fake.addMutex.Unlock()
fake.AddStub = stub
}
func (fake *TransactionRegistry) AddArgsForCall(i int) (string, string) {
fake.addMutex.RLock()
defer fake.addMutex.RUnlock()
argsForCall := fake.addArgsForCall[i]
return argsForCall.arg1, argsForCall.arg2
}
func (fake *TransactionRegistry) AddReturns(result1 bool) {
fake.addMutex.Lock()
defer fake.addMutex.Unlock()
fake.AddStub = nil
fake.addReturns = struct {
result1 bool
}{result1}
}
func (fake *TransactionRegistry) AddReturnsOnCall(i int, result1 bool) {
fake.addMutex.Lock()
defer fake.addMutex.Unlock()
fake.AddStub = nil
if fake.addReturnsOnCall == nil {
fake.addReturnsOnCall = make(map[int]struct {
result1 bool
})
}
fake.addReturnsOnCall[i] = struct {
result1 bool
}{result1}
}
func (fake *TransactionRegistry) Remove(arg1 string, arg2 string) {
fake.removeMutex.Lock()
fake.removeArgsForCall = append(fake.removeArgsForCall, struct {
arg1 string
arg2 string
}{arg1, arg2})
fake.recordInvocation("Remove", []interface{}{arg1, arg2})
fake.removeMutex.Unlock()
if fake.RemoveStub != nil {
fake.RemoveStub(arg1, arg2)
}
}
func (fake *TransactionRegistry) RemoveCallCount() int {
fake.removeMutex.RLock()
defer fake.removeMutex.RUnlock()
return len(fake.removeArgsForCall)
}
func (fake *TransactionRegistry) RemoveCalls(stub func(string, string)) {
fake.removeMutex.Lock()
defer fake.removeMutex.Unlock()
fake.RemoveStub = stub
}
func (fake *TransactionRegistry) RemoveArgsForCall(i int) (string, string) {
fake.removeMutex.RLock()
defer fake.removeMutex.RUnlock()
argsForCall := fake.removeArgsForCall[i]
return argsForCall.arg1, argsForCall.arg2
}
func (fake *TransactionRegistry) Invocations() map[string][][]interface{} {
fake.invocationsMutex.RLock()
defer fake.invocationsMutex.RUnlock()
fake.addMutex.RLock()
defer fake.addMutex.RUnlock()
fake.removeMutex.RLock()
defer fake.removeMutex.RUnlock()
copiedInvocations := map[string][][]interface{}{}
for key, value := range fake.invocations {
copiedInvocations[key] = value
}
return copiedInvocations
}
func (fake *TransactionRegistry) recordInvocation(key string, args []interface{}) {
fake.invocationsMutex.Lock()
defer fake.invocationsMutex.Unlock()
if fake.invocations == nil {
fake.invocations = map[string][][]interface{}{}
}
if fake.invocations[key] == nil {
fake.invocations[key] = [][]interface{}{}
}
fake.invocations[key] = append(fake.invocations[key], args)
}
1
https://gitee.com/zhuanglicheng/fabric.git
git@gitee.com:zhuanglicheng/fabric.git
zhuanglicheng
fabric
fabric
v2.1.1

搜索帮助

53164aa7 5694891 3bd8fe86 5694891