// This file was generated by counterfeiter
package fake_net

import (
	"net"
	"sync"
)

type FakeListener struct {
	AcceptStub        func() (c net.Conn, err error)
	acceptMutex       sync.RWMutex
	acceptArgsForCall []struct{}
	acceptReturns     struct {
		result1 net.Conn
		result2 error
	}
	CloseStub        func() error
	closeMutex       sync.RWMutex
	closeArgsForCall []struct{}
	closeReturns     struct {
		result1 error
	}
	AddrStub        func() net.Addr
	addrMutex       sync.RWMutex
	addrArgsForCall []struct{}
	addrReturns     struct {
		result1 net.Addr
	}
}

func (fake *FakeListener) Accept() (c net.Conn, err error) {
	fake.acceptMutex.Lock()
	fake.acceptArgsForCall = append(fake.acceptArgsForCall, struct{}{})
	fake.acceptMutex.Unlock()
	if fake.AcceptStub != nil {
		return fake.AcceptStub()
	} else {
		return fake.acceptReturns.result1, fake.acceptReturns.result2
	}
}

func (fake *FakeListener) AcceptCallCount() int {
	fake.acceptMutex.RLock()
	defer fake.acceptMutex.RUnlock()
	return len(fake.acceptArgsForCall)
}

func (fake *FakeListener) AcceptReturns(result1 net.Conn, result2 error) {
	fake.AcceptStub = nil
	fake.acceptReturns = struct {
		result1 net.Conn
		result2 error
	}{result1, result2}
}

func (fake *FakeListener) Close() error {
	fake.closeMutex.Lock()
	fake.closeArgsForCall = append(fake.closeArgsForCall, struct{}{})
	fake.closeMutex.Unlock()
	if fake.CloseStub != nil {
		return fake.CloseStub()
	} else {
		return fake.closeReturns.result1
	}
}

func (fake *FakeListener) CloseCallCount() int {
	fake.closeMutex.RLock()
	defer fake.closeMutex.RUnlock()
	return len(fake.closeArgsForCall)
}

func (fake *FakeListener) CloseReturns(result1 error) {
	fake.CloseStub = nil
	fake.closeReturns = struct {
		result1 error
	}{result1}
}

func (fake *FakeListener) Addr() net.Addr {
	fake.addrMutex.Lock()
	fake.addrArgsForCall = append(fake.addrArgsForCall, struct{}{})
	fake.addrMutex.Unlock()
	if fake.AddrStub != nil {
		return fake.AddrStub()
	} else {
		return fake.addrReturns.result1
	}
}

func (fake *FakeListener) AddrCallCount() int {
	fake.addrMutex.RLock()
	defer fake.addrMutex.RUnlock()
	return len(fake.addrArgsForCall)
}

func (fake *FakeListener) AddrReturns(result1 net.Addr) {
	fake.AddrStub = nil
	fake.addrReturns = struct {
		result1 net.Addr
	}{result1}
}

var _ net.Listener = new(FakeListener)
