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

import (
	"io"
	"sync"

	"code.cloudfoundry.org/cli/util/download"
	pb "gopkg.in/cheggaaa/pb.v1"
)

type FakeProgressBar struct {
	FinishStub        func()
	finishMutex       sync.RWMutex
	finishArgsForCall []struct {
	}
	NewProxyReaderStub        func(io.Reader) *pb.Reader
	newProxyReaderMutex       sync.RWMutex
	newProxyReaderArgsForCall []struct {
		arg1 io.Reader
	}
	newProxyReaderReturns struct {
		result1 *pb.Reader
	}
	newProxyReaderReturnsOnCall map[int]struct {
		result1 *pb.Reader
	}
	SetTotalStub        func(int) *pb.ProgressBar
	setTotalMutex       sync.RWMutex
	setTotalArgsForCall []struct {
		arg1 int
	}
	setTotalReturns struct {
		result1 *pb.ProgressBar
	}
	setTotalReturnsOnCall map[int]struct {
		result1 *pb.ProgressBar
	}
	StartStub        func() *pb.ProgressBar
	startMutex       sync.RWMutex
	startArgsForCall []struct {
	}
	startReturns struct {
		result1 *pb.ProgressBar
	}
	startReturnsOnCall map[int]struct {
		result1 *pb.ProgressBar
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *FakeProgressBar) Finish() {
	fake.finishMutex.Lock()
	fake.finishArgsForCall = append(fake.finishArgsForCall, struct {
	}{})
	fake.recordInvocation("Finish", []interface{}{})
	fake.finishMutex.Unlock()
	if fake.FinishStub != nil {
		fake.FinishStub()
	}
}

func (fake *FakeProgressBar) FinishCallCount() int {
	fake.finishMutex.RLock()
	defer fake.finishMutex.RUnlock()
	return len(fake.finishArgsForCall)
}

func (fake *FakeProgressBar) FinishCalls(stub func()) {
	fake.finishMutex.Lock()
	defer fake.finishMutex.Unlock()
	fake.FinishStub = stub
}

func (fake *FakeProgressBar) NewProxyReader(arg1 io.Reader) *pb.Reader {
	fake.newProxyReaderMutex.Lock()
	ret, specificReturn := fake.newProxyReaderReturnsOnCall[len(fake.newProxyReaderArgsForCall)]
	fake.newProxyReaderArgsForCall = append(fake.newProxyReaderArgsForCall, struct {
		arg1 io.Reader
	}{arg1})
	fake.recordInvocation("NewProxyReader", []interface{}{arg1})
	fake.newProxyReaderMutex.Unlock()
	if fake.NewProxyReaderStub != nil {
		return fake.NewProxyReaderStub(arg1)
	}
	if specificReturn {
		return ret.result1
	}
	fakeReturns := fake.newProxyReaderReturns
	return fakeReturns.result1
}

func (fake *FakeProgressBar) NewProxyReaderCallCount() int {
	fake.newProxyReaderMutex.RLock()
	defer fake.newProxyReaderMutex.RUnlock()
	return len(fake.newProxyReaderArgsForCall)
}

func (fake *FakeProgressBar) NewProxyReaderCalls(stub func(io.Reader) *pb.Reader) {
	fake.newProxyReaderMutex.Lock()
	defer fake.newProxyReaderMutex.Unlock()
	fake.NewProxyReaderStub = stub
}

func (fake *FakeProgressBar) NewProxyReaderArgsForCall(i int) io.Reader {
	fake.newProxyReaderMutex.RLock()
	defer fake.newProxyReaderMutex.RUnlock()
	argsForCall := fake.newProxyReaderArgsForCall[i]
	return argsForCall.arg1
}

func (fake *FakeProgressBar) NewProxyReaderReturns(result1 *pb.Reader) {
	fake.newProxyReaderMutex.Lock()
	defer fake.newProxyReaderMutex.Unlock()
	fake.NewProxyReaderStub = nil
	fake.newProxyReaderReturns = struct {
		result1 *pb.Reader
	}{result1}
}

func (fake *FakeProgressBar) NewProxyReaderReturnsOnCall(i int, result1 *pb.Reader) {
	fake.newProxyReaderMutex.Lock()
	defer fake.newProxyReaderMutex.Unlock()
	fake.NewProxyReaderStub = nil
	if fake.newProxyReaderReturnsOnCall == nil {
		fake.newProxyReaderReturnsOnCall = make(map[int]struct {
			result1 *pb.Reader
		})
	}
	fake.newProxyReaderReturnsOnCall[i] = struct {
		result1 *pb.Reader
	}{result1}
}

func (fake *FakeProgressBar) SetTotal(arg1 int) *pb.ProgressBar {
	fake.setTotalMutex.Lock()
	ret, specificReturn := fake.setTotalReturnsOnCall[len(fake.setTotalArgsForCall)]
	fake.setTotalArgsForCall = append(fake.setTotalArgsForCall, struct {
		arg1 int
	}{arg1})
	fake.recordInvocation("SetTotal", []interface{}{arg1})
	fake.setTotalMutex.Unlock()
	if fake.SetTotalStub != nil {
		return fake.SetTotalStub(arg1)
	}
	if specificReturn {
		return ret.result1
	}
	fakeReturns := fake.setTotalReturns
	return fakeReturns.result1
}

func (fake *FakeProgressBar) SetTotalCallCount() int {
	fake.setTotalMutex.RLock()
	defer fake.setTotalMutex.RUnlock()
	return len(fake.setTotalArgsForCall)
}

func (fake *FakeProgressBar) SetTotalCalls(stub func(int) *pb.ProgressBar) {
	fake.setTotalMutex.Lock()
	defer fake.setTotalMutex.Unlock()
	fake.SetTotalStub = stub
}

func (fake *FakeProgressBar) SetTotalArgsForCall(i int) int {
	fake.setTotalMutex.RLock()
	defer fake.setTotalMutex.RUnlock()
	argsForCall := fake.setTotalArgsForCall[i]
	return argsForCall.arg1
}

func (fake *FakeProgressBar) SetTotalReturns(result1 *pb.ProgressBar) {
	fake.setTotalMutex.Lock()
	defer fake.setTotalMutex.Unlock()
	fake.SetTotalStub = nil
	fake.setTotalReturns = struct {
		result1 *pb.ProgressBar
	}{result1}
}

func (fake *FakeProgressBar) SetTotalReturnsOnCall(i int, result1 *pb.ProgressBar) {
	fake.setTotalMutex.Lock()
	defer fake.setTotalMutex.Unlock()
	fake.SetTotalStub = nil
	if fake.setTotalReturnsOnCall == nil {
		fake.setTotalReturnsOnCall = make(map[int]struct {
			result1 *pb.ProgressBar
		})
	}
	fake.setTotalReturnsOnCall[i] = struct {
		result1 *pb.ProgressBar
	}{result1}
}

func (fake *FakeProgressBar) Start() *pb.ProgressBar {
	fake.startMutex.Lock()
	ret, specificReturn := fake.startReturnsOnCall[len(fake.startArgsForCall)]
	fake.startArgsForCall = append(fake.startArgsForCall, struct {
	}{})
	fake.recordInvocation("Start", []interface{}{})
	fake.startMutex.Unlock()
	if fake.StartStub != nil {
		return fake.StartStub()
	}
	if specificReturn {
		return ret.result1
	}
	fakeReturns := fake.startReturns
	return fakeReturns.result1
}

func (fake *FakeProgressBar) StartCallCount() int {
	fake.startMutex.RLock()
	defer fake.startMutex.RUnlock()
	return len(fake.startArgsForCall)
}

func (fake *FakeProgressBar) StartCalls(stub func() *pb.ProgressBar) {
	fake.startMutex.Lock()
	defer fake.startMutex.Unlock()
	fake.StartStub = stub
}

func (fake *FakeProgressBar) StartReturns(result1 *pb.ProgressBar) {
	fake.startMutex.Lock()
	defer fake.startMutex.Unlock()
	fake.StartStub = nil
	fake.startReturns = struct {
		result1 *pb.ProgressBar
	}{result1}
}

func (fake *FakeProgressBar) StartReturnsOnCall(i int, result1 *pb.ProgressBar) {
	fake.startMutex.Lock()
	defer fake.startMutex.Unlock()
	fake.StartStub = nil
	if fake.startReturnsOnCall == nil {
		fake.startReturnsOnCall = make(map[int]struct {
			result1 *pb.ProgressBar
		})
	}
	fake.startReturnsOnCall[i] = struct {
		result1 *pb.ProgressBar
	}{result1}
}

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

func (fake *FakeProgressBar) 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 _ download.ProgressBar = new(FakeProgressBar)
