119 lines
3.0 KiB
Go
119 lines
3.0 KiB
Go
|
// Code generated by counterfeiter. DO NOT EDIT.
|
||
|
package mockdb
|
||
|
|
||
|
import (
|
||
|
"sync"
|
||
|
|
||
|
"github.com/ssb-ngi-pointer/gossb-rooms/admindb"
|
||
|
)
|
||
|
|
||
|
type FakeFallbackAuth struct {
|
||
|
CheckStub func(string, string) (interface{}, error)
|
||
|
checkMutex sync.RWMutex
|
||
|
checkArgsForCall []struct {
|
||
|
arg1 string
|
||
|
arg2 string
|
||
|
}
|
||
|
checkReturns struct {
|
||
|
result1 interface{}
|
||
|
result2 error
|
||
|
}
|
||
|
checkReturnsOnCall map[int]struct {
|
||
|
result1 interface{}
|
||
|
result2 error
|
||
|
}
|
||
|
invocations map[string][][]interface{}
|
||
|
invocationsMutex sync.RWMutex
|
||
|
}
|
||
|
|
||
|
func (fake *FakeFallbackAuth) Check(arg1 string, arg2 string) (interface{}, error) {
|
||
|
fake.checkMutex.Lock()
|
||
|
ret, specificReturn := fake.checkReturnsOnCall[len(fake.checkArgsForCall)]
|
||
|
fake.checkArgsForCall = append(fake.checkArgsForCall, struct {
|
||
|
arg1 string
|
||
|
arg2 string
|
||
|
}{arg1, arg2})
|
||
|
stub := fake.CheckStub
|
||
|
fakeReturns := fake.checkReturns
|
||
|
fake.recordInvocation("Check", []interface{}{arg1, arg2})
|
||
|
fake.checkMutex.Unlock()
|
||
|
if stub != nil {
|
||
|
return stub(arg1, arg2)
|
||
|
}
|
||
|
if specificReturn {
|
||
|
return ret.result1, ret.result2
|
||
|
}
|
||
|
return fakeReturns.result1, fakeReturns.result2
|
||
|
}
|
||
|
|
||
|
func (fake *FakeFallbackAuth) CheckCallCount() int {
|
||
|
fake.checkMutex.RLock()
|
||
|
defer fake.checkMutex.RUnlock()
|
||
|
return len(fake.checkArgsForCall)
|
||
|
}
|
||
|
|
||
|
func (fake *FakeFallbackAuth) CheckCalls(stub func(string, string) (interface{}, error)) {
|
||
|
fake.checkMutex.Lock()
|
||
|
defer fake.checkMutex.Unlock()
|
||
|
fake.CheckStub = stub
|
||
|
}
|
||
|
|
||
|
func (fake *FakeFallbackAuth) CheckArgsForCall(i int) (string, string) {
|
||
|
fake.checkMutex.RLock()
|
||
|
defer fake.checkMutex.RUnlock()
|
||
|
argsForCall := fake.checkArgsForCall[i]
|
||
|
return argsForCall.arg1, argsForCall.arg2
|
||
|
}
|
||
|
|
||
|
func (fake *FakeFallbackAuth) CheckReturns(result1 interface{}, result2 error) {
|
||
|
fake.checkMutex.Lock()
|
||
|
defer fake.checkMutex.Unlock()
|
||
|
fake.CheckStub = nil
|
||
|
fake.checkReturns = struct {
|
||
|
result1 interface{}
|
||
|
result2 error
|
||
|
}{result1, result2}
|
||
|
}
|
||
|
|
||
|
func (fake *FakeFallbackAuth) CheckReturnsOnCall(i int, result1 interface{}, result2 error) {
|
||
|
fake.checkMutex.Lock()
|
||
|
defer fake.checkMutex.Unlock()
|
||
|
fake.CheckStub = nil
|
||
|
if fake.checkReturnsOnCall == nil {
|
||
|
fake.checkReturnsOnCall = make(map[int]struct {
|
||
|
result1 interface{}
|
||
|
result2 error
|
||
|
})
|
||
|
}
|
||
|
fake.checkReturnsOnCall[i] = struct {
|
||
|
result1 interface{}
|
||
|
result2 error
|
||
|
}{result1, result2}
|
||
|
}
|
||
|
|
||
|
func (fake *FakeFallbackAuth) Invocations() map[string][][]interface{} {
|
||
|
fake.invocationsMutex.RLock()
|
||
|
defer fake.invocationsMutex.RUnlock()
|
||
|
fake.checkMutex.RLock()
|
||
|
defer fake.checkMutex.RUnlock()
|
||
|
copiedInvocations := map[string][][]interface{}{}
|
||
|
for key, value := range fake.invocations {
|
||
|
copiedInvocations[key] = value
|
||
|
}
|
||
|
return copiedInvocations
|
||
|
}
|
||
|
|
||
|
func (fake *FakeFallbackAuth) 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)
|
||
|
}
|
||
|
|
||
|
var _ admindb.FallbackAuth = new(FakeFallbackAuth)
|