// Code generated by counterfeiter. DO NOT EDIT.
package clisshfakes

import (
	"sync"

	"code.cloudfoundry.org/cli/util/clissh"
	"golang.org/x/crypto/ssh"
)

type FakeSecureDialer struct {
	DialStub        func(string, string, *ssh.ClientConfig) (clissh.SecureClient, error)
	dialMutex       sync.RWMutex
	dialArgsForCall []struct {
		arg1 string
		arg2 string
		arg3 *ssh.ClientConfig
	}
	dialReturns struct {
		result1 clissh.SecureClient
		result2 error
	}
	dialReturnsOnCall map[int]struct {
		result1 clissh.SecureClient
		result2 error
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *FakeSecureDialer) Dial(arg1 string, arg2 string, arg3 *ssh.ClientConfig) (clissh.SecureClient, error) {
	fake.dialMutex.Lock()
	ret, specificReturn := fake.dialReturnsOnCall[len(fake.dialArgsForCall)]
	fake.dialArgsForCall = append(fake.dialArgsForCall, struct {
		arg1 string
		arg2 string
		arg3 *ssh.ClientConfig
	}{arg1, arg2, arg3})
	fake.recordInvocation("Dial", []interface{}{arg1, arg2, arg3})
	fake.dialMutex.Unlock()
	if fake.DialStub != nil {
		return fake.DialStub(arg1, arg2, arg3)
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	fakeReturns := fake.dialReturns
	return fakeReturns.result1, fakeReturns.result2
}

func (fake *FakeSecureDialer) DialCallCount() int {
	fake.dialMutex.RLock()
	defer fake.dialMutex.RUnlock()
	return len(fake.dialArgsForCall)
}

func (fake *FakeSecureDialer) DialCalls(stub func(string, string, *ssh.ClientConfig) (clissh.SecureClient, error)) {
	fake.dialMutex.Lock()
	defer fake.dialMutex.Unlock()
	fake.DialStub = stub
}

func (fake *FakeSecureDialer) DialArgsForCall(i int) (string, string, *ssh.ClientConfig) {
	fake.dialMutex.RLock()
	defer fake.dialMutex.RUnlock()
	argsForCall := fake.dialArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3
}

func (fake *FakeSecureDialer) DialReturns(result1 clissh.SecureClient, result2 error) {
	fake.dialMutex.Lock()
	defer fake.dialMutex.Unlock()
	fake.DialStub = nil
	fake.dialReturns = struct {
		result1 clissh.SecureClient
		result2 error
	}{result1, result2}
}

func (fake *FakeSecureDialer) DialReturnsOnCall(i int, result1 clissh.SecureClient, result2 error) {
	fake.dialMutex.Lock()
	defer fake.dialMutex.Unlock()
	fake.DialStub = nil
	if fake.dialReturnsOnCall == nil {
		fake.dialReturnsOnCall = make(map[int]struct {
			result1 clissh.SecureClient
			result2 error
		})
	}
	fake.dialReturnsOnCall[i] = struct {
		result1 clissh.SecureClient
		result2 error
	}{result1, result2}
}

func (fake *FakeSecureDialer) Invocations() map[string][][]interface{} {
	fake.invocationsMutex.RLock()
	defer fake.invocationsMutex.RUnlock()
	fake.dialMutex.RLock()
	defer fake.dialMutex.RUnlock()
	copiedInvocations := map[string][][]interface{}{}
	for key, value := range fake.invocations {
		copiedInvocations[key] = value
	}
	return copiedInvocations
}

func (fake *FakeSecureDialer) 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 _ clissh.SecureDialer = new(FakeSecureDialer)
