github.com/mook-as/cf-cli@v7.0.0-beta.28.0.20200120190804-b91c115fae48+incompatible/cf/commands/route/routefakes/fake_creator.go (about)

     1  // Code generated by counterfeiter. DO NOT EDIT.
     2  package routefakes
     3  
     4  import (
     5  	"sync"
     6  
     7  	"code.cloudfoundry.org/cli/cf/commands/route"
     8  	"code.cloudfoundry.org/cli/cf/models"
     9  )
    10  
    11  type FakeCreator struct {
    12  	CreateRouteStub        func(string, string, int, bool, models.DomainFields, models.SpaceFields) (models.Route, error)
    13  	createRouteMutex       sync.RWMutex
    14  	createRouteArgsForCall []struct {
    15  		arg1 string
    16  		arg2 string
    17  		arg3 int
    18  		arg4 bool
    19  		arg5 models.DomainFields
    20  		arg6 models.SpaceFields
    21  	}
    22  	createRouteReturns struct {
    23  		result1 models.Route
    24  		result2 error
    25  	}
    26  	createRouteReturnsOnCall map[int]struct {
    27  		result1 models.Route
    28  		result2 error
    29  	}
    30  	invocations      map[string][][]interface{}
    31  	invocationsMutex sync.RWMutex
    32  }
    33  
    34  func (fake *FakeCreator) CreateRoute(arg1 string, arg2 string, arg3 int, arg4 bool, arg5 models.DomainFields, arg6 models.SpaceFields) (models.Route, error) {
    35  	fake.createRouteMutex.Lock()
    36  	ret, specificReturn := fake.createRouteReturnsOnCall[len(fake.createRouteArgsForCall)]
    37  	fake.createRouteArgsForCall = append(fake.createRouteArgsForCall, struct {
    38  		arg1 string
    39  		arg2 string
    40  		arg3 int
    41  		arg4 bool
    42  		arg5 models.DomainFields
    43  		arg6 models.SpaceFields
    44  	}{arg1, arg2, arg3, arg4, arg5, arg6})
    45  	fake.recordInvocation("CreateRoute", []interface{}{arg1, arg2, arg3, arg4, arg5, arg6})
    46  	fake.createRouteMutex.Unlock()
    47  	if fake.CreateRouteStub != nil {
    48  		return fake.CreateRouteStub(arg1, arg2, arg3, arg4, arg5, arg6)
    49  	}
    50  	if specificReturn {
    51  		return ret.result1, ret.result2
    52  	}
    53  	fakeReturns := fake.createRouteReturns
    54  	return fakeReturns.result1, fakeReturns.result2
    55  }
    56  
    57  func (fake *FakeCreator) CreateRouteCallCount() int {
    58  	fake.createRouteMutex.RLock()
    59  	defer fake.createRouteMutex.RUnlock()
    60  	return len(fake.createRouteArgsForCall)
    61  }
    62  
    63  func (fake *FakeCreator) CreateRouteCalls(stub func(string, string, int, bool, models.DomainFields, models.SpaceFields) (models.Route, error)) {
    64  	fake.createRouteMutex.Lock()
    65  	defer fake.createRouteMutex.Unlock()
    66  	fake.CreateRouteStub = stub
    67  }
    68  
    69  func (fake *FakeCreator) CreateRouteArgsForCall(i int) (string, string, int, bool, models.DomainFields, models.SpaceFields) {
    70  	fake.createRouteMutex.RLock()
    71  	defer fake.createRouteMutex.RUnlock()
    72  	argsForCall := fake.createRouteArgsForCall[i]
    73  	return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3, argsForCall.arg4, argsForCall.arg5, argsForCall.arg6
    74  }
    75  
    76  func (fake *FakeCreator) CreateRouteReturns(result1 models.Route, result2 error) {
    77  	fake.createRouteMutex.Lock()
    78  	defer fake.createRouteMutex.Unlock()
    79  	fake.CreateRouteStub = nil
    80  	fake.createRouteReturns = struct {
    81  		result1 models.Route
    82  		result2 error
    83  	}{result1, result2}
    84  }
    85  
    86  func (fake *FakeCreator) CreateRouteReturnsOnCall(i int, result1 models.Route, result2 error) {
    87  	fake.createRouteMutex.Lock()
    88  	defer fake.createRouteMutex.Unlock()
    89  	fake.CreateRouteStub = nil
    90  	if fake.createRouteReturnsOnCall == nil {
    91  		fake.createRouteReturnsOnCall = make(map[int]struct {
    92  			result1 models.Route
    93  			result2 error
    94  		})
    95  	}
    96  	fake.createRouteReturnsOnCall[i] = struct {
    97  		result1 models.Route
    98  		result2 error
    99  	}{result1, result2}
   100  }
   101  
   102  func (fake *FakeCreator) Invocations() map[string][][]interface{} {
   103  	fake.invocationsMutex.RLock()
   104  	defer fake.invocationsMutex.RUnlock()
   105  	fake.createRouteMutex.RLock()
   106  	defer fake.createRouteMutex.RUnlock()
   107  	copiedInvocations := map[string][][]interface{}{}
   108  	for key, value := range fake.invocations {
   109  		copiedInvocations[key] = value
   110  	}
   111  	return copiedInvocations
   112  }
   113  
   114  func (fake *FakeCreator) recordInvocation(key string, args []interface{}) {
   115  	fake.invocationsMutex.Lock()
   116  	defer fake.invocationsMutex.Unlock()
   117  	if fake.invocations == nil {
   118  		fake.invocations = map[string][][]interface{}{}
   119  	}
   120  	if fake.invocations[key] == nil {
   121  		fake.invocations[key] = [][]interface{}{}
   122  	}
   123  	fake.invocations[key] = append(fake.invocations[key], args)
   124  }
   125  
   126  var _ route.Creator = new(FakeCreator)