github.com/schwarzm/garden-linux@v0.0.0-20150507151835-33bca2147c47/old/rootfs_provider/fake_mapper/FakeMapper.go (about)

     1  // This file was generated by counterfeiter
     2  package fake_mapper
     3  
     4  import (
     5  	"sync"
     6  
     7  	"github.com/cloudfoundry-incubator/garden-linux/old/rootfs_provider"
     8  )
     9  
    10  type FakeMapper struct {
    11  	MapStub        func(id int) int
    12  	mapMutex       sync.RWMutex
    13  	mapArgsForCall []struct {
    14  		id int
    15  	}
    16  	mapReturns struct {
    17  		result1 int
    18  	}
    19  }
    20  
    21  func (fake *FakeMapper) Map(id int) int {
    22  	fake.mapMutex.Lock()
    23  	fake.mapArgsForCall = append(fake.mapArgsForCall, struct {
    24  		id int
    25  	}{id})
    26  	fake.mapMutex.Unlock()
    27  	if fake.MapStub != nil {
    28  		return fake.MapStub(id)
    29  	} else {
    30  		return fake.mapReturns.result1
    31  	}
    32  }
    33  
    34  func (fake *FakeMapper) MapCallCount() int {
    35  	fake.mapMutex.RLock()
    36  	defer fake.mapMutex.RUnlock()
    37  	return len(fake.mapArgsForCall)
    38  }
    39  
    40  func (fake *FakeMapper) MapArgsForCall(i int) int {
    41  	fake.mapMutex.RLock()
    42  	defer fake.mapMutex.RUnlock()
    43  	return fake.mapArgsForCall[i].id
    44  }
    45  
    46  func (fake *FakeMapper) MapReturns(result1 int) {
    47  	fake.MapStub = nil
    48  	fake.mapReturns = struct {
    49  		result1 int
    50  	}{result1}
    51  }
    52  
    53  var _ rootfs_provider.Mapper = new(FakeMapper)