github.com/loggregator/cli@v6.33.1-0.20180224010324-82334f081791+incompatible/cf/commands/service/servicefakes/fake_route_service_unbinder.go (about)

     1  // This file was generated by counterfeiter
     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(route models.Route, serviceInstance models.ServiceInstance) error
    13  	unbindRouteMutex       sync.RWMutex
    14  	unbindRouteArgsForCall []struct {
    15  		route           models.Route
    16  		serviceInstance models.ServiceInstance
    17  	}
    18  	unbindRouteReturns struct {
    19  		result1 error
    20  	}
    21  	invocations      map[string][][]interface{}
    22  	invocationsMutex sync.RWMutex
    23  }
    24  
    25  func (fake *FakeRouteServiceUnbinder) UnbindRoute(route models.Route, serviceInstance models.ServiceInstance) error {
    26  	fake.unbindRouteMutex.Lock()
    27  	fake.unbindRouteArgsForCall = append(fake.unbindRouteArgsForCall, struct {
    28  		route           models.Route
    29  		serviceInstance models.ServiceInstance
    30  	}{route, serviceInstance})
    31  	fake.recordInvocation("UnbindRoute", []interface{}{route, serviceInstance})
    32  	fake.unbindRouteMutex.Unlock()
    33  	if fake.UnbindRouteStub != nil {
    34  		return fake.UnbindRouteStub(route, serviceInstance)
    35  	} else {
    36  		return fake.unbindRouteReturns.result1
    37  	}
    38  }
    39  
    40  func (fake *FakeRouteServiceUnbinder) UnbindRouteCallCount() int {
    41  	fake.unbindRouteMutex.RLock()
    42  	defer fake.unbindRouteMutex.RUnlock()
    43  	return len(fake.unbindRouteArgsForCall)
    44  }
    45  
    46  func (fake *FakeRouteServiceUnbinder) UnbindRouteArgsForCall(i int) (models.Route, models.ServiceInstance) {
    47  	fake.unbindRouteMutex.RLock()
    48  	defer fake.unbindRouteMutex.RUnlock()
    49  	return fake.unbindRouteArgsForCall[i].route, fake.unbindRouteArgsForCall[i].serviceInstance
    50  }
    51  
    52  func (fake *FakeRouteServiceUnbinder) UnbindRouteReturns(result1 error) {
    53  	fake.UnbindRouteStub = nil
    54  	fake.unbindRouteReturns = struct {
    55  		result1 error
    56  	}{result1}
    57  }
    58  
    59  func (fake *FakeRouteServiceUnbinder) Invocations() map[string][][]interface{} {
    60  	fake.invocationsMutex.RLock()
    61  	defer fake.invocationsMutex.RUnlock()
    62  	fake.unbindRouteMutex.RLock()
    63  	defer fake.unbindRouteMutex.RUnlock()
    64  	return fake.invocations
    65  }
    66  
    67  func (fake *FakeRouteServiceUnbinder) recordInvocation(key string, args []interface{}) {
    68  	fake.invocationsMutex.Lock()
    69  	defer fake.invocationsMutex.Unlock()
    70  	if fake.invocations == nil {
    71  		fake.invocations = map[string][][]interface{}{}
    72  	}
    73  	if fake.invocations[key] == nil {
    74  		fake.invocations[key] = [][]interface{}{}
    75  	}
    76  	fake.invocations[key] = append(fake.invocations[key], args)
    77  }
    78  
    79  var _ service.RouteServiceUnbinder = new(FakeRouteServiceUnbinder)