github.com/ablease/cli@v6.37.1-0.20180613014814-3adbb7d7fb19+incompatible/cf/api/securitygroups/defaults/staging/stagingfakes/fake_security_groups_repo.go (about)

     1  // This file was generated by counterfeiter
     2  package stagingfakes
     3  
     4  import (
     5  	"sync"
     6  
     7  	"code.cloudfoundry.org/cli/cf/api/securitygroups/defaults/staging"
     8  	"code.cloudfoundry.org/cli/cf/models"
     9  )
    10  
    11  type FakeSecurityGroupsRepo struct {
    12  	BindToStagingSetStub        func(string) error
    13  	bindToStagingSetMutex       sync.RWMutex
    14  	bindToStagingSetArgsForCall []struct {
    15  		arg1 string
    16  	}
    17  	bindToStagingSetReturns struct {
    18  		result1 error
    19  	}
    20  	ListStub        func() ([]models.SecurityGroupFields, error)
    21  	listMutex       sync.RWMutex
    22  	listArgsForCall []struct{}
    23  	listReturns     struct {
    24  		result1 []models.SecurityGroupFields
    25  		result2 error
    26  	}
    27  	UnbindFromStagingSetStub        func(string) error
    28  	unbindFromStagingSetMutex       sync.RWMutex
    29  	unbindFromStagingSetArgsForCall []struct {
    30  		arg1 string
    31  	}
    32  	unbindFromStagingSetReturns struct {
    33  		result1 error
    34  	}
    35  	invocations      map[string][][]interface{}
    36  	invocationsMutex sync.RWMutex
    37  }
    38  
    39  func (fake *FakeSecurityGroupsRepo) BindToStagingSet(arg1 string) error {
    40  	fake.bindToStagingSetMutex.Lock()
    41  	fake.bindToStagingSetArgsForCall = append(fake.bindToStagingSetArgsForCall, struct {
    42  		arg1 string
    43  	}{arg1})
    44  	fake.recordInvocation("BindToStagingSet", []interface{}{arg1})
    45  	fake.bindToStagingSetMutex.Unlock()
    46  	if fake.BindToStagingSetStub != nil {
    47  		return fake.BindToStagingSetStub(arg1)
    48  	} else {
    49  		return fake.bindToStagingSetReturns.result1
    50  	}
    51  }
    52  
    53  func (fake *FakeSecurityGroupsRepo) BindToStagingSetCallCount() int {
    54  	fake.bindToStagingSetMutex.RLock()
    55  	defer fake.bindToStagingSetMutex.RUnlock()
    56  	return len(fake.bindToStagingSetArgsForCall)
    57  }
    58  
    59  func (fake *FakeSecurityGroupsRepo) BindToStagingSetArgsForCall(i int) string {
    60  	fake.bindToStagingSetMutex.RLock()
    61  	defer fake.bindToStagingSetMutex.RUnlock()
    62  	return fake.bindToStagingSetArgsForCall[i].arg1
    63  }
    64  
    65  func (fake *FakeSecurityGroupsRepo) BindToStagingSetReturns(result1 error) {
    66  	fake.BindToStagingSetStub = nil
    67  	fake.bindToStagingSetReturns = struct {
    68  		result1 error
    69  	}{result1}
    70  }
    71  
    72  func (fake *FakeSecurityGroupsRepo) List() ([]models.SecurityGroupFields, error) {
    73  	fake.listMutex.Lock()
    74  	fake.listArgsForCall = append(fake.listArgsForCall, struct{}{})
    75  	fake.recordInvocation("List", []interface{}{})
    76  	fake.listMutex.Unlock()
    77  	if fake.ListStub != nil {
    78  		return fake.ListStub()
    79  	} else {
    80  		return fake.listReturns.result1, fake.listReturns.result2
    81  	}
    82  }
    83  
    84  func (fake *FakeSecurityGroupsRepo) ListCallCount() int {
    85  	fake.listMutex.RLock()
    86  	defer fake.listMutex.RUnlock()
    87  	return len(fake.listArgsForCall)
    88  }
    89  
    90  func (fake *FakeSecurityGroupsRepo) ListReturns(result1 []models.SecurityGroupFields, result2 error) {
    91  	fake.ListStub = nil
    92  	fake.listReturns = struct {
    93  		result1 []models.SecurityGroupFields
    94  		result2 error
    95  	}{result1, result2}
    96  }
    97  
    98  func (fake *FakeSecurityGroupsRepo) UnbindFromStagingSet(arg1 string) error {
    99  	fake.unbindFromStagingSetMutex.Lock()
   100  	fake.unbindFromStagingSetArgsForCall = append(fake.unbindFromStagingSetArgsForCall, struct {
   101  		arg1 string
   102  	}{arg1})
   103  	fake.recordInvocation("UnbindFromStagingSet", []interface{}{arg1})
   104  	fake.unbindFromStagingSetMutex.Unlock()
   105  	if fake.UnbindFromStagingSetStub != nil {
   106  		return fake.UnbindFromStagingSetStub(arg1)
   107  	} else {
   108  		return fake.unbindFromStagingSetReturns.result1
   109  	}
   110  }
   111  
   112  func (fake *FakeSecurityGroupsRepo) UnbindFromStagingSetCallCount() int {
   113  	fake.unbindFromStagingSetMutex.RLock()
   114  	defer fake.unbindFromStagingSetMutex.RUnlock()
   115  	return len(fake.unbindFromStagingSetArgsForCall)
   116  }
   117  
   118  func (fake *FakeSecurityGroupsRepo) UnbindFromStagingSetArgsForCall(i int) string {
   119  	fake.unbindFromStagingSetMutex.RLock()
   120  	defer fake.unbindFromStagingSetMutex.RUnlock()
   121  	return fake.unbindFromStagingSetArgsForCall[i].arg1
   122  }
   123  
   124  func (fake *FakeSecurityGroupsRepo) UnbindFromStagingSetReturns(result1 error) {
   125  	fake.UnbindFromStagingSetStub = nil
   126  	fake.unbindFromStagingSetReturns = struct {
   127  		result1 error
   128  	}{result1}
   129  }
   130  
   131  func (fake *FakeSecurityGroupsRepo) Invocations() map[string][][]interface{} {
   132  	fake.invocationsMutex.RLock()
   133  	defer fake.invocationsMutex.RUnlock()
   134  	fake.bindToStagingSetMutex.RLock()
   135  	defer fake.bindToStagingSetMutex.RUnlock()
   136  	fake.listMutex.RLock()
   137  	defer fake.listMutex.RUnlock()
   138  	fake.unbindFromStagingSetMutex.RLock()
   139  	defer fake.unbindFromStagingSetMutex.RUnlock()
   140  	return fake.invocations
   141  }
   142  
   143  func (fake *FakeSecurityGroupsRepo) recordInvocation(key string, args []interface{}) {
   144  	fake.invocationsMutex.Lock()
   145  	defer fake.invocationsMutex.Unlock()
   146  	if fake.invocations == nil {
   147  		fake.invocations = map[string][][]interface{}{}
   148  	}
   149  	if fake.invocations[key] == nil {
   150  		fake.invocations[key] = [][]interface{}{}
   151  	}
   152  	fake.invocations[key] = append(fake.invocations[key], args)
   153  }
   154  
   155  var _ staging.SecurityGroupsRepo = new(FakeSecurityGroupsRepo)