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

import (
	io "io"
	sync "sync"

	marman "github.com/cf-platform-eng/marman"
)

type FakeDownloader struct {
	DownloadFromReaderStub        func(string, io.ReadCloser) error
	downloadFromReaderMutex       sync.RWMutex
	downloadFromReaderArgsForCall []struct {
		arg1 string
		arg2 io.ReadCloser
	}
	downloadFromReaderReturns struct {
		result1 error
	}
	downloadFromReaderReturnsOnCall map[int]struct {
		result1 error
	}
	DownloadFromURLStub        func(string, string) error
	downloadFromURLMutex       sync.RWMutex
	downloadFromURLArgsForCall []struct {
		arg1 string
		arg2 string
	}
	downloadFromURLReturns struct {
		result1 error
	}
	downloadFromURLReturnsOnCall map[int]struct {
		result1 error
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *FakeDownloader) DownloadFromReader(arg1 string, arg2 io.ReadCloser) error {
	fake.downloadFromReaderMutex.Lock()
	ret, specificReturn := fake.downloadFromReaderReturnsOnCall[len(fake.downloadFromReaderArgsForCall)]
	fake.downloadFromReaderArgsForCall = append(fake.downloadFromReaderArgsForCall, struct {
		arg1 string
		arg2 io.ReadCloser
	}{arg1, arg2})
	fake.recordInvocation("DownloadFromReader", []interface{}{arg1, arg2})
	fake.downloadFromReaderMutex.Unlock()
	if fake.DownloadFromReaderStub != nil {
		return fake.DownloadFromReaderStub(arg1, arg2)
	}
	if specificReturn {
		return ret.result1
	}
	fakeReturns := fake.downloadFromReaderReturns
	return fakeReturns.result1
}

func (fake *FakeDownloader) DownloadFromReaderCallCount() int {
	fake.downloadFromReaderMutex.RLock()
	defer fake.downloadFromReaderMutex.RUnlock()
	return len(fake.downloadFromReaderArgsForCall)
}

func (fake *FakeDownloader) DownloadFromReaderCalls(stub func(string, io.ReadCloser) error) {
	fake.downloadFromReaderMutex.Lock()
	defer fake.downloadFromReaderMutex.Unlock()
	fake.DownloadFromReaderStub = stub
}

func (fake *FakeDownloader) DownloadFromReaderArgsForCall(i int) (string, io.ReadCloser) {
	fake.downloadFromReaderMutex.RLock()
	defer fake.downloadFromReaderMutex.RUnlock()
	argsForCall := fake.downloadFromReaderArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2
}

func (fake *FakeDownloader) DownloadFromReaderReturns(result1 error) {
	fake.downloadFromReaderMutex.Lock()
	defer fake.downloadFromReaderMutex.Unlock()
	fake.DownloadFromReaderStub = nil
	fake.downloadFromReaderReturns = struct {
		result1 error
	}{result1}
}

func (fake *FakeDownloader) DownloadFromReaderReturnsOnCall(i int, result1 error) {
	fake.downloadFromReaderMutex.Lock()
	defer fake.downloadFromReaderMutex.Unlock()
	fake.DownloadFromReaderStub = nil
	if fake.downloadFromReaderReturnsOnCall == nil {
		fake.downloadFromReaderReturnsOnCall = make(map[int]struct {
			result1 error
		})
	}
	fake.downloadFromReaderReturnsOnCall[i] = struct {
		result1 error
	}{result1}
}

func (fake *FakeDownloader) DownloadFromURL(arg1 string, arg2 string) error {
	fake.downloadFromURLMutex.Lock()
	ret, specificReturn := fake.downloadFromURLReturnsOnCall[len(fake.downloadFromURLArgsForCall)]
	fake.downloadFromURLArgsForCall = append(fake.downloadFromURLArgsForCall, struct {
		arg1 string
		arg2 string
	}{arg1, arg2})
	fake.recordInvocation("DownloadFromURL", []interface{}{arg1, arg2})
	fake.downloadFromURLMutex.Unlock()
	if fake.DownloadFromURLStub != nil {
		return fake.DownloadFromURLStub(arg1, arg2)
	}
	if specificReturn {
		return ret.result1
	}
	fakeReturns := fake.downloadFromURLReturns
	return fakeReturns.result1
}

func (fake *FakeDownloader) DownloadFromURLCallCount() int {
	fake.downloadFromURLMutex.RLock()
	defer fake.downloadFromURLMutex.RUnlock()
	return len(fake.downloadFromURLArgsForCall)
}

func (fake *FakeDownloader) DownloadFromURLCalls(stub func(string, string) error) {
	fake.downloadFromURLMutex.Lock()
	defer fake.downloadFromURLMutex.Unlock()
	fake.DownloadFromURLStub = stub
}

func (fake *FakeDownloader) DownloadFromURLArgsForCall(i int) (string, string) {
	fake.downloadFromURLMutex.RLock()
	defer fake.downloadFromURLMutex.RUnlock()
	argsForCall := fake.downloadFromURLArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2
}

func (fake *FakeDownloader) DownloadFromURLReturns(result1 error) {
	fake.downloadFromURLMutex.Lock()
	defer fake.downloadFromURLMutex.Unlock()
	fake.DownloadFromURLStub = nil
	fake.downloadFromURLReturns = struct {
		result1 error
	}{result1}
}

func (fake *FakeDownloader) DownloadFromURLReturnsOnCall(i int, result1 error) {
	fake.downloadFromURLMutex.Lock()
	defer fake.downloadFromURLMutex.Unlock()
	fake.DownloadFromURLStub = nil
	if fake.downloadFromURLReturnsOnCall == nil {
		fake.downloadFromURLReturnsOnCall = make(map[int]struct {
			result1 error
		})
	}
	fake.downloadFromURLReturnsOnCall[i] = struct {
		result1 error
	}{result1}
}

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

func (fake *FakeDownloader) 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 _ marman.Downloader = new(FakeDownloader)
