github.com/mook-as/cf-cli@v7.0.0-beta.28.0.20200120190804-b91c115fae48+incompatible/cf/commands/service/servicefakes/fake_route_service_unbinder.go (about)

     1  // Code generated by counterfeiter. DO NOT EDIT.
     2  package servicefakes
     3  
     4  import (
     5  	"sync"
     6  
     7  	"code.cloudfoundry.org/cli/cf/commands/service"
     8  	"code.cloudfoundry.org/cli/cf/models"
     9  )
    10  
    11  type FakeRouteServiceUnbinder struct {
    12  	UnbindRouteStub        func(models.Route, models.ServiceInstance) error
    13  	unbindRouteMutex       sync.RWMutex
    14  	unbindRouteArgsForCall []struct {
    15  		arg1 models.Route
    16  		arg2 models.ServiceInstance
    17  	}
    18  	unbindRouteReturns struct {
    19  		result1 error
    20  	}
    21  	unbindRouteReturnsOnCall map[int]struct {
    22  		result1 error
    23  	}
    24  	invocations      map[string][][]interface{}
    25  	invocationsMutex sync.RWMutex
    26  }
    27  
    28  func (fake *FakeRouteServiceUnbinder) UnbindRoute(arg1 models.Route, arg2 models.ServiceInstance) error {
    29  	fake.unbindRouteMutex.Lock()
    30  	ret, specificReturn := fake.unbindRouteReturnsOnCall[len(fake.unbindRouteArgsForCall)]
    31  	fake.unbindRouteArgsForCall = append(fake.unbindRouteArgsForCall, struct {
    32  		arg1 models.Route
    33  		arg2 models.ServiceInstance
    34  	}{arg1, arg2})
    35  	fake.recordInvocation("UnbindRoute", []interface{}{arg1, arg2})
    36  	fake.unbindRouteMutex.Unlock()
    37  	if fake.UnbindRouteStub != nil {
    38  		return fake.UnbindRouteStub(arg1, arg2)
    39  	}
    40  	if specificReturn {
    41  		return ret.result1
    42  	}
    43  	fakeReturns := fake.unbindRouteReturns
    44  	return fakeReturns.result1
    45  }
    46  
    47  func (fake *FakeRouteServiceUnbinder) UnbindRouteCallCount() int {
    48  	fake.unbindRouteMutex.RLock()
    49  	defer fake.unbindRouteMutex.RUnlock()
    50  	return len(fake.unbindRouteArgsForCall)
    51  }
    52  
    53  func (fake *FakeRouteServiceUnbinder) UnbindRouteCalls(stub func(models.Route, models.ServiceInstance) error) {
    54  	fake.unbindRouteMutex.Lock()
    55  	defer fake.unbindRouteMutex.Unlock()
    56  	fake.UnbindRouteStub = stub
    57  }
    58  
    59  func (fake *FakeRouteServiceUnbinder) UnbindRouteArgsForCall(i int) (models.Route, models.ServiceInstance) {
    60  	fake.unbindRouteMutex.RLock()
    61  	defer fake.unbindRouteMutex.RUnlock()
    62  	argsForCall := fake.unbindRouteArgsForCall[i]
    63  	return argsForCall.arg1, argsForCall.arg2
    64  }
    65  
    66  func (fake *FakeRouteServiceUnbinder) UnbindRouteReturns(result1 error) {
    67  	fake.unbindRouteMutex.Lock()
    68  	defer fake.unbindRouteMutex.Unlock()
    69  	fake.UnbindRouteStub = nil
    70  	fake.unbindRouteReturns = struct {
    71  		result1 error
    72  	}{result1}
    73  }
    74  
    75  func (fake *FakeRouteServiceUnbinder) UnbindRouteReturnsOnCall(i int, result1 error) {
    76  	fake.unbindRouteMutex.Lock()
    77  	defer fake.unbindRouteMutex.Unlock()
    78  	fake.UnbindRouteStub = nil
    79  	if fake.unbindRouteReturnsOnCall == nil {
    80  		fake.unbindRouteReturnsOnCall = make(map[int]struct {
    81  			result1 error
    82  		})
    83  	}
    84  	fake.unbindRouteReturnsOnCall[i] = struct {
    85  		result1 error
    86  	}{result1}
    87  }
    88  
    89  func (fake *FakeRouteServiceUnbinder) Invocations() map[string][][]interface{} {
    90  	fake.invocationsMutex.RLock()
    91  	defer fake.invocationsMutex.RUnlock()
    92  	fake.unbindRouteMutex.RLock()
    93  	defer fake.unbindRouteMutex.RUnlock()
    94  	copiedInvocations := map[string][][]interface{}{}
    95  	for key, value := range fake.invocations {
    96  		copiedInvocations[key] = value
    97  	}
    98  	return copiedInvocations
    99  }
   100  
   101  func (fake *FakeRouteServiceUnbinder) recordInvocation(key string, args []interface{}) {
   102  	fake.invocationsMutex.Lock()
   103  	defer fake.invocationsMutex.Unlock()
   104  	if fake.invocations == nil {
   105  		fake.invocations = map[string][][]interface{}{}
   106  	}
   107  	if fake.invocations[key] == nil {
   108  		fake.invocations[key] = [][]interface{}{}
   109  	}
   110  	fake.invocations[key] = append(fake.invocations[key], args)
   111  }
   112  
   113  var _ service.RouteServiceUnbinder = new(FakeRouteServiceUnbinder)