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

import (
	"io"
	"sync"

	"code.cloudfoundry.org/cli/cf/ssh/terminal"
	"github.com/moby/term"
)

type FakeTerminalHelper struct {
	GetFdInfoStub        func(interface{}) (uintptr, bool)
	getFdInfoMutex       sync.RWMutex
	getFdInfoArgsForCall []struct {
		arg1 interface{}
	}
	getFdInfoReturns struct {
		result1 uintptr
		result2 bool
	}
	getFdInfoReturnsOnCall map[int]struct {
		result1 uintptr
		result2 bool
	}
	GetWinsizeStub        func(uintptr) (*term.Winsize, error)
	getWinsizeMutex       sync.RWMutex
	getWinsizeArgsForCall []struct {
		arg1 uintptr
	}
	getWinsizeReturns struct {
		result1 *term.Winsize
		result2 error
	}
	getWinsizeReturnsOnCall map[int]struct {
		result1 *term.Winsize
		result2 error
	}
	IsTerminalStub        func(uintptr) bool
	isTerminalMutex       sync.RWMutex
	isTerminalArgsForCall []struct {
		arg1 uintptr
	}
	isTerminalReturns struct {
		result1 bool
	}
	isTerminalReturnsOnCall map[int]struct {
		result1 bool
	}
	RestoreTerminalStub        func(uintptr, *term.State) error
	restoreTerminalMutex       sync.RWMutex
	restoreTerminalArgsForCall []struct {
		arg1 uintptr
		arg2 *term.State
	}
	restoreTerminalReturns struct {
		result1 error
	}
	restoreTerminalReturnsOnCall map[int]struct {
		result1 error
	}
	SetRawTerminalStub        func(uintptr) (*term.State, error)
	setRawTerminalMutex       sync.RWMutex
	setRawTerminalArgsForCall []struct {
		arg1 uintptr
	}
	setRawTerminalReturns struct {
		result1 *term.State
		result2 error
	}
	setRawTerminalReturnsOnCall map[int]struct {
		result1 *term.State
		result2 error
	}
	StdStreamsStub        func() (io.ReadCloser, io.Writer, io.Writer)
	stdStreamsMutex       sync.RWMutex
	stdStreamsArgsForCall []struct {
	}
	stdStreamsReturns struct {
		result1 io.ReadCloser
		result2 io.Writer
		result3 io.Writer
	}
	stdStreamsReturnsOnCall map[int]struct {
		result1 io.ReadCloser
		result2 io.Writer
		result3 io.Writer
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *FakeTerminalHelper) GetFdInfo(arg1 interface{}) (uintptr, bool) {
	fake.getFdInfoMutex.Lock()
	ret, specificReturn := fake.getFdInfoReturnsOnCall[len(fake.getFdInfoArgsForCall)]
	fake.getFdInfoArgsForCall = append(fake.getFdInfoArgsForCall, struct {
		arg1 interface{}
	}{arg1})
	fake.recordInvocation("GetFdInfo", []interface{}{arg1})
	fake.getFdInfoMutex.Unlock()
	if fake.GetFdInfoStub != nil {
		return fake.GetFdInfoStub(arg1)
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	fakeReturns := fake.getFdInfoReturns
	return fakeReturns.result1, fakeReturns.result2
}

func (fake *FakeTerminalHelper) GetFdInfoCallCount() int {
	fake.getFdInfoMutex.RLock()
	defer fake.getFdInfoMutex.RUnlock()
	return len(fake.getFdInfoArgsForCall)
}

func (fake *FakeTerminalHelper) GetFdInfoCalls(stub func(interface{}) (uintptr, bool)) {
	fake.getFdInfoMutex.Lock()
	defer fake.getFdInfoMutex.Unlock()
	fake.GetFdInfoStub = stub
}

func (fake *FakeTerminalHelper) GetFdInfoArgsForCall(i int) interface{} {
	fake.getFdInfoMutex.RLock()
	defer fake.getFdInfoMutex.RUnlock()
	argsForCall := fake.getFdInfoArgsForCall[i]
	return argsForCall.arg1
}

func (fake *FakeTerminalHelper) GetFdInfoReturns(result1 uintptr, result2 bool) {
	fake.getFdInfoMutex.Lock()
	defer fake.getFdInfoMutex.Unlock()
	fake.GetFdInfoStub = nil
	fake.getFdInfoReturns = struct {
		result1 uintptr
		result2 bool
	}{result1, result2}
}

func (fake *FakeTerminalHelper) GetFdInfoReturnsOnCall(i int, result1 uintptr, result2 bool) {
	fake.getFdInfoMutex.Lock()
	defer fake.getFdInfoMutex.Unlock()
	fake.GetFdInfoStub = nil
	if fake.getFdInfoReturnsOnCall == nil {
		fake.getFdInfoReturnsOnCall = make(map[int]struct {
			result1 uintptr
			result2 bool
		})
	}
	fake.getFdInfoReturnsOnCall[i] = struct {
		result1 uintptr
		result2 bool
	}{result1, result2}
}

func (fake *FakeTerminalHelper) GetWinsize(arg1 uintptr) (*term.Winsize, error) {
	fake.getWinsizeMutex.Lock()
	ret, specificReturn := fake.getWinsizeReturnsOnCall[len(fake.getWinsizeArgsForCall)]
	fake.getWinsizeArgsForCall = append(fake.getWinsizeArgsForCall, struct {
		arg1 uintptr
	}{arg1})
	fake.recordInvocation("GetWinsize", []interface{}{arg1})
	fake.getWinsizeMutex.Unlock()
	if fake.GetWinsizeStub != nil {
		return fake.GetWinsizeStub(arg1)
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	fakeReturns := fake.getWinsizeReturns
	return fakeReturns.result1, fakeReturns.result2
}

func (fake *FakeTerminalHelper) GetWinsizeCallCount() int {
	fake.getWinsizeMutex.RLock()
	defer fake.getWinsizeMutex.RUnlock()
	return len(fake.getWinsizeArgsForCall)
}

func (fake *FakeTerminalHelper) GetWinsizeCalls(stub func(uintptr) (*term.Winsize, error)) {
	fake.getWinsizeMutex.Lock()
	defer fake.getWinsizeMutex.Unlock()
	fake.GetWinsizeStub = stub
}

func (fake *FakeTerminalHelper) GetWinsizeArgsForCall(i int) uintptr {
	fake.getWinsizeMutex.RLock()
	defer fake.getWinsizeMutex.RUnlock()
	argsForCall := fake.getWinsizeArgsForCall[i]
	return argsForCall.arg1
}

func (fake *FakeTerminalHelper) GetWinsizeReturns(result1 *term.Winsize, result2 error) {
	fake.getWinsizeMutex.Lock()
	defer fake.getWinsizeMutex.Unlock()
	fake.GetWinsizeStub = nil
	fake.getWinsizeReturns = struct {
		result1 *term.Winsize
		result2 error
	}{result1, result2}
}

func (fake *FakeTerminalHelper) GetWinsizeReturnsOnCall(i int, result1 *term.Winsize, result2 error) {
	fake.getWinsizeMutex.Lock()
	defer fake.getWinsizeMutex.Unlock()
	fake.GetWinsizeStub = nil
	if fake.getWinsizeReturnsOnCall == nil {
		fake.getWinsizeReturnsOnCall = make(map[int]struct {
			result1 *term.Winsize
			result2 error
		})
	}
	fake.getWinsizeReturnsOnCall[i] = struct {
		result1 *term.Winsize
		result2 error
	}{result1, result2}
}

func (fake *FakeTerminalHelper) IsTerminal(arg1 uintptr) bool {
	fake.isTerminalMutex.Lock()
	ret, specificReturn := fake.isTerminalReturnsOnCall[len(fake.isTerminalArgsForCall)]
	fake.isTerminalArgsForCall = append(fake.isTerminalArgsForCall, struct {
		arg1 uintptr
	}{arg1})
	fake.recordInvocation("IsTerminal", []interface{}{arg1})
	fake.isTerminalMutex.Unlock()
	if fake.IsTerminalStub != nil {
		return fake.IsTerminalStub(arg1)
	}
	if specificReturn {
		return ret.result1
	}
	fakeReturns := fake.isTerminalReturns
	return fakeReturns.result1
}

func (fake *FakeTerminalHelper) IsTerminalCallCount() int {
	fake.isTerminalMutex.RLock()
	defer fake.isTerminalMutex.RUnlock()
	return len(fake.isTerminalArgsForCall)
}

func (fake *FakeTerminalHelper) IsTerminalCalls(stub func(uintptr) bool) {
	fake.isTerminalMutex.Lock()
	defer fake.isTerminalMutex.Unlock()
	fake.IsTerminalStub = stub
}

func (fake *FakeTerminalHelper) IsTerminalArgsForCall(i int) uintptr {
	fake.isTerminalMutex.RLock()
	defer fake.isTerminalMutex.RUnlock()
	argsForCall := fake.isTerminalArgsForCall[i]
	return argsForCall.arg1
}

func (fake *FakeTerminalHelper) IsTerminalReturns(result1 bool) {
	fake.isTerminalMutex.Lock()
	defer fake.isTerminalMutex.Unlock()
	fake.IsTerminalStub = nil
	fake.isTerminalReturns = struct {
		result1 bool
	}{result1}
}

func (fake *FakeTerminalHelper) IsTerminalReturnsOnCall(i int, result1 bool) {
	fake.isTerminalMutex.Lock()
	defer fake.isTerminalMutex.Unlock()
	fake.IsTerminalStub = nil
	if fake.isTerminalReturnsOnCall == nil {
		fake.isTerminalReturnsOnCall = make(map[int]struct {
			result1 bool
		})
	}
	fake.isTerminalReturnsOnCall[i] = struct {
		result1 bool
	}{result1}
}

func (fake *FakeTerminalHelper) RestoreTerminal(arg1 uintptr, arg2 *term.State) error {
	fake.restoreTerminalMutex.Lock()
	ret, specificReturn := fake.restoreTerminalReturnsOnCall[len(fake.restoreTerminalArgsForCall)]
	fake.restoreTerminalArgsForCall = append(fake.restoreTerminalArgsForCall, struct {
		arg1 uintptr
		arg2 *term.State
	}{arg1, arg2})
	fake.recordInvocation("RestoreTerminal", []interface{}{arg1, arg2})
	fake.restoreTerminalMutex.Unlock()
	if fake.RestoreTerminalStub != nil {
		return fake.RestoreTerminalStub(arg1, arg2)
	}
	if specificReturn {
		return ret.result1
	}
	fakeReturns := fake.restoreTerminalReturns
	return fakeReturns.result1
}

func (fake *FakeTerminalHelper) RestoreTerminalCallCount() int {
	fake.restoreTerminalMutex.RLock()
	defer fake.restoreTerminalMutex.RUnlock()
	return len(fake.restoreTerminalArgsForCall)
}

func (fake *FakeTerminalHelper) RestoreTerminalCalls(stub func(uintptr, *term.State) error) {
	fake.restoreTerminalMutex.Lock()
	defer fake.restoreTerminalMutex.Unlock()
	fake.RestoreTerminalStub = stub
}

func (fake *FakeTerminalHelper) RestoreTerminalArgsForCall(i int) (uintptr, *term.State) {
	fake.restoreTerminalMutex.RLock()
	defer fake.restoreTerminalMutex.RUnlock()
	argsForCall := fake.restoreTerminalArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2
}

func (fake *FakeTerminalHelper) RestoreTerminalReturns(result1 error) {
	fake.restoreTerminalMutex.Lock()
	defer fake.restoreTerminalMutex.Unlock()
	fake.RestoreTerminalStub = nil
	fake.restoreTerminalReturns = struct {
		result1 error
	}{result1}
}

func (fake *FakeTerminalHelper) RestoreTerminalReturnsOnCall(i int, result1 error) {
	fake.restoreTerminalMutex.Lock()
	defer fake.restoreTerminalMutex.Unlock()
	fake.RestoreTerminalStub = nil
	if fake.restoreTerminalReturnsOnCall == nil {
		fake.restoreTerminalReturnsOnCall = make(map[int]struct {
			result1 error
		})
	}
	fake.restoreTerminalReturnsOnCall[i] = struct {
		result1 error
	}{result1}
}

func (fake *FakeTerminalHelper) SetRawTerminal(arg1 uintptr) (*term.State, error) {
	fake.setRawTerminalMutex.Lock()
	ret, specificReturn := fake.setRawTerminalReturnsOnCall[len(fake.setRawTerminalArgsForCall)]
	fake.setRawTerminalArgsForCall = append(fake.setRawTerminalArgsForCall, struct {
		arg1 uintptr
	}{arg1})
	fake.recordInvocation("SetRawTerminal", []interface{}{arg1})
	fake.setRawTerminalMutex.Unlock()
	if fake.SetRawTerminalStub != nil {
		return fake.SetRawTerminalStub(arg1)
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	fakeReturns := fake.setRawTerminalReturns
	return fakeReturns.result1, fakeReturns.result2
}

func (fake *FakeTerminalHelper) SetRawTerminalCallCount() int {
	fake.setRawTerminalMutex.RLock()
	defer fake.setRawTerminalMutex.RUnlock()
	return len(fake.setRawTerminalArgsForCall)
}

func (fake *FakeTerminalHelper) SetRawTerminalCalls(stub func(uintptr) (*term.State, error)) {
	fake.setRawTerminalMutex.Lock()
	defer fake.setRawTerminalMutex.Unlock()
	fake.SetRawTerminalStub = stub
}

func (fake *FakeTerminalHelper) SetRawTerminalArgsForCall(i int) uintptr {
	fake.setRawTerminalMutex.RLock()
	defer fake.setRawTerminalMutex.RUnlock()
	argsForCall := fake.setRawTerminalArgsForCall[i]
	return argsForCall.arg1
}

func (fake *FakeTerminalHelper) SetRawTerminalReturns(result1 *term.State, result2 error) {
	fake.setRawTerminalMutex.Lock()
	defer fake.setRawTerminalMutex.Unlock()
	fake.SetRawTerminalStub = nil
	fake.setRawTerminalReturns = struct {
		result1 *term.State
		result2 error
	}{result1, result2}
}

func (fake *FakeTerminalHelper) SetRawTerminalReturnsOnCall(i int, result1 *term.State, result2 error) {
	fake.setRawTerminalMutex.Lock()
	defer fake.setRawTerminalMutex.Unlock()
	fake.SetRawTerminalStub = nil
	if fake.setRawTerminalReturnsOnCall == nil {
		fake.setRawTerminalReturnsOnCall = make(map[int]struct {
			result1 *term.State
			result2 error
		})
	}
	fake.setRawTerminalReturnsOnCall[i] = struct {
		result1 *term.State
		result2 error
	}{result1, result2}
}

func (fake *FakeTerminalHelper) StdStreams() (io.ReadCloser, io.Writer, io.Writer) {
	fake.stdStreamsMutex.Lock()
	ret, specificReturn := fake.stdStreamsReturnsOnCall[len(fake.stdStreamsArgsForCall)]
	fake.stdStreamsArgsForCall = append(fake.stdStreamsArgsForCall, struct {
	}{})
	fake.recordInvocation("StdStreams", []interface{}{})
	fake.stdStreamsMutex.Unlock()
	if fake.StdStreamsStub != nil {
		return fake.StdStreamsStub()
	}
	if specificReturn {
		return ret.result1, ret.result2, ret.result3
	}
	fakeReturns := fake.stdStreamsReturns
	return fakeReturns.result1, fakeReturns.result2, fakeReturns.result3
}

func (fake *FakeTerminalHelper) StdStreamsCallCount() int {
	fake.stdStreamsMutex.RLock()
	defer fake.stdStreamsMutex.RUnlock()
	return len(fake.stdStreamsArgsForCall)
}

func (fake *FakeTerminalHelper) StdStreamsCalls(stub func() (io.ReadCloser, io.Writer, io.Writer)) {
	fake.stdStreamsMutex.Lock()
	defer fake.stdStreamsMutex.Unlock()
	fake.StdStreamsStub = stub
}

func (fake *FakeTerminalHelper) StdStreamsReturns(result1 io.ReadCloser, result2 io.Writer, result3 io.Writer) {
	fake.stdStreamsMutex.Lock()
	defer fake.stdStreamsMutex.Unlock()
	fake.StdStreamsStub = nil
	fake.stdStreamsReturns = struct {
		result1 io.ReadCloser
		result2 io.Writer
		result3 io.Writer
	}{result1, result2, result3}
}

func (fake *FakeTerminalHelper) StdStreamsReturnsOnCall(i int, result1 io.ReadCloser, result2 io.Writer, result3 io.Writer) {
	fake.stdStreamsMutex.Lock()
	defer fake.stdStreamsMutex.Unlock()
	fake.StdStreamsStub = nil
	if fake.stdStreamsReturnsOnCall == nil {
		fake.stdStreamsReturnsOnCall = make(map[int]struct {
			result1 io.ReadCloser
			result2 io.Writer
			result3 io.Writer
		})
	}
	fake.stdStreamsReturnsOnCall[i] = struct {
		result1 io.ReadCloser
		result2 io.Writer
		result3 io.Writer
	}{result1, result2, result3}
}

func (fake *FakeTerminalHelper) Invocations() map[string][][]interface{} {
	fake.invocationsMutex.RLock()
	defer fake.invocationsMutex.RUnlock()
	fake.getFdInfoMutex.RLock()
	defer fake.getFdInfoMutex.RUnlock()
	fake.getWinsizeMutex.RLock()
	defer fake.getWinsizeMutex.RUnlock()
	fake.isTerminalMutex.RLock()
	defer fake.isTerminalMutex.RUnlock()
	fake.restoreTerminalMutex.RLock()
	defer fake.restoreTerminalMutex.RUnlock()
	fake.setRawTerminalMutex.RLock()
	defer fake.setRawTerminalMutex.RUnlock()
	fake.stdStreamsMutex.RLock()
	defer fake.stdStreamsMutex.RUnlock()
	copiedInvocations := map[string][][]interface{}{}
	for key, value := range fake.invocations {
		copiedInvocations[key] = value
	}
	return copiedInvocations
}

func (fake *FakeTerminalHelper) 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 _ terminal.TerminalHelper = new(FakeTerminalHelper)
