github.com/loggregator/cli@v6.33.1-0.20180224010324-82334f081791+incompatible/cf/requirements/requirementsfakes/fake_space_requirement.go (about)

     1  // This file was generated by counterfeiter
     2  package requirementsfakes
     3  
     4  import (
     5  	"sync"
     6  
     7  	"code.cloudfoundry.org/cli/cf/models"
     8  	"code.cloudfoundry.org/cli/cf/requirements"
     9  )
    10  
    11  type FakeSpaceRequirement struct {
    12  	ExecuteStub        func() error
    13  	executeMutex       sync.RWMutex
    14  	executeArgsForCall []struct{}
    15  	executeReturns     struct {
    16  		result1 error
    17  	}
    18  	SetSpaceNameStub        func(string)
    19  	setSpaceNameMutex       sync.RWMutex
    20  	setSpaceNameArgsForCall []struct {
    21  		arg1 string
    22  	}
    23  	GetSpaceStub        func() models.Space
    24  	getSpaceMutex       sync.RWMutex
    25  	getSpaceArgsForCall []struct{}
    26  	getSpaceReturns     struct {
    27  		result1 models.Space
    28  	}
    29  	invocations      map[string][][]interface{}
    30  	invocationsMutex sync.RWMutex
    31  }
    32  
    33  func (fake *FakeSpaceRequirement) Execute() error {
    34  	fake.executeMutex.Lock()
    35  	fake.executeArgsForCall = append(fake.executeArgsForCall, struct{}{})
    36  	fake.recordInvocation("Execute", []interface{}{})
    37  	fake.executeMutex.Unlock()
    38  	if fake.ExecuteStub != nil {
    39  		return fake.ExecuteStub()
    40  	} else {
    41  		return fake.executeReturns.result1
    42  	}
    43  }
    44  
    45  func (fake *FakeSpaceRequirement) ExecuteCallCount() int {
    46  	fake.executeMutex.RLock()
    47  	defer fake.executeMutex.RUnlock()
    48  	return len(fake.executeArgsForCall)
    49  }
    50  
    51  func (fake *FakeSpaceRequirement) ExecuteReturns(result1 error) {
    52  	fake.ExecuteStub = nil
    53  	fake.executeReturns = struct {
    54  		result1 error
    55  	}{result1}
    56  }
    57  
    58  func (fake *FakeSpaceRequirement) SetSpaceName(arg1 string) {
    59  	fake.setSpaceNameMutex.Lock()
    60  	fake.setSpaceNameArgsForCall = append(fake.setSpaceNameArgsForCall, struct {
    61  		arg1 string
    62  	}{arg1})
    63  	fake.recordInvocation("SetSpaceName", []interface{}{arg1})
    64  	fake.setSpaceNameMutex.Unlock()
    65  	if fake.SetSpaceNameStub != nil {
    66  		fake.SetSpaceNameStub(arg1)
    67  	}
    68  }
    69  
    70  func (fake *FakeSpaceRequirement) SetSpaceNameCallCount() int {
    71  	fake.setSpaceNameMutex.RLock()
    72  	defer fake.setSpaceNameMutex.RUnlock()
    73  	return len(fake.setSpaceNameArgsForCall)
    74  }
    75  
    76  func (fake *FakeSpaceRequirement) SetSpaceNameArgsForCall(i int) string {
    77  	fake.setSpaceNameMutex.RLock()
    78  	defer fake.setSpaceNameMutex.RUnlock()
    79  	return fake.setSpaceNameArgsForCall[i].arg1
    80  }
    81  
    82  func (fake *FakeSpaceRequirement) GetSpace() models.Space {
    83  	fake.getSpaceMutex.Lock()
    84  	fake.getSpaceArgsForCall = append(fake.getSpaceArgsForCall, struct{}{})
    85  	fake.recordInvocation("GetSpace", []interface{}{})
    86  	fake.getSpaceMutex.Unlock()
    87  	if fake.GetSpaceStub != nil {
    88  		return fake.GetSpaceStub()
    89  	} else {
    90  		return fake.getSpaceReturns.result1
    91  	}
    92  }
    93  
    94  func (fake *FakeSpaceRequirement) GetSpaceCallCount() int {
    95  	fake.getSpaceMutex.RLock()
    96  	defer fake.getSpaceMutex.RUnlock()
    97  	return len(fake.getSpaceArgsForCall)
    98  }
    99  
   100  func (fake *FakeSpaceRequirement) GetSpaceReturns(result1 models.Space) {
   101  	fake.GetSpaceStub = nil
   102  	fake.getSpaceReturns = struct {
   103  		result1 models.Space
   104  	}{result1}
   105  }
   106  
   107  func (fake *FakeSpaceRequirement) Invocations() map[string][][]interface{} {
   108  	fake.invocationsMutex.RLock()
   109  	defer fake.invocationsMutex.RUnlock()
   110  	fake.executeMutex.RLock()
   111  	defer fake.executeMutex.RUnlock()
   112  	fake.setSpaceNameMutex.RLock()
   113  	defer fake.setSpaceNameMutex.RUnlock()
   114  	fake.getSpaceMutex.RLock()
   115  	defer fake.getSpaceMutex.RUnlock()
   116  	return fake.invocations
   117  }
   118  
   119  func (fake *FakeSpaceRequirement) recordInvocation(key string, args []interface{}) {
   120  	fake.invocationsMutex.Lock()
   121  	defer fake.invocationsMutex.Unlock()
   122  	if fake.invocations == nil {
   123  		fake.invocations = map[string][][]interface{}{}
   124  	}
   125  	if fake.invocations[key] == nil {
   126  		fake.invocations[key] = [][]interface{}{}
   127  	}
   128  	fake.invocations[key] = append(fake.invocations[key], args)
   129  }
   130  
   131  var _ requirements.SpaceRequirement = new(FakeSpaceRequirement)