github.com/loafoe/cli@v7.1.0+incompatible/cf/requirements/requirementsfakes/fake_domain_requirement.go (about)

     1  // Code generated by counterfeiter. DO NOT EDIT.
     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 FakeDomainRequirement struct {
    12  	ExecuteStub        func() error
    13  	executeMutex       sync.RWMutex
    14  	executeArgsForCall []struct {
    15  	}
    16  	executeReturns struct {
    17  		result1 error
    18  	}
    19  	executeReturnsOnCall map[int]struct {
    20  		result1 error
    21  	}
    22  	GetDomainStub        func() models.DomainFields
    23  	getDomainMutex       sync.RWMutex
    24  	getDomainArgsForCall []struct {
    25  	}
    26  	getDomainReturns struct {
    27  		result1 models.DomainFields
    28  	}
    29  	getDomainReturnsOnCall map[int]struct {
    30  		result1 models.DomainFields
    31  	}
    32  	invocations      map[string][][]interface{}
    33  	invocationsMutex sync.RWMutex
    34  }
    35  
    36  func (fake *FakeDomainRequirement) Execute() error {
    37  	fake.executeMutex.Lock()
    38  	ret, specificReturn := fake.executeReturnsOnCall[len(fake.executeArgsForCall)]
    39  	fake.executeArgsForCall = append(fake.executeArgsForCall, struct {
    40  	}{})
    41  	fake.recordInvocation("Execute", []interface{}{})
    42  	fake.executeMutex.Unlock()
    43  	if fake.ExecuteStub != nil {
    44  		return fake.ExecuteStub()
    45  	}
    46  	if specificReturn {
    47  		return ret.result1
    48  	}
    49  	fakeReturns := fake.executeReturns
    50  	return fakeReturns.result1
    51  }
    52  
    53  func (fake *FakeDomainRequirement) ExecuteCallCount() int {
    54  	fake.executeMutex.RLock()
    55  	defer fake.executeMutex.RUnlock()
    56  	return len(fake.executeArgsForCall)
    57  }
    58  
    59  func (fake *FakeDomainRequirement) ExecuteCalls(stub func() error) {
    60  	fake.executeMutex.Lock()
    61  	defer fake.executeMutex.Unlock()
    62  	fake.ExecuteStub = stub
    63  }
    64  
    65  func (fake *FakeDomainRequirement) ExecuteReturns(result1 error) {
    66  	fake.executeMutex.Lock()
    67  	defer fake.executeMutex.Unlock()
    68  	fake.ExecuteStub = nil
    69  	fake.executeReturns = struct {
    70  		result1 error
    71  	}{result1}
    72  }
    73  
    74  func (fake *FakeDomainRequirement) ExecuteReturnsOnCall(i int, result1 error) {
    75  	fake.executeMutex.Lock()
    76  	defer fake.executeMutex.Unlock()
    77  	fake.ExecuteStub = nil
    78  	if fake.executeReturnsOnCall == nil {
    79  		fake.executeReturnsOnCall = make(map[int]struct {
    80  			result1 error
    81  		})
    82  	}
    83  	fake.executeReturnsOnCall[i] = struct {
    84  		result1 error
    85  	}{result1}
    86  }
    87  
    88  func (fake *FakeDomainRequirement) GetDomain() models.DomainFields {
    89  	fake.getDomainMutex.Lock()
    90  	ret, specificReturn := fake.getDomainReturnsOnCall[len(fake.getDomainArgsForCall)]
    91  	fake.getDomainArgsForCall = append(fake.getDomainArgsForCall, struct {
    92  	}{})
    93  	fake.recordInvocation("GetDomain", []interface{}{})
    94  	fake.getDomainMutex.Unlock()
    95  	if fake.GetDomainStub != nil {
    96  		return fake.GetDomainStub()
    97  	}
    98  	if specificReturn {
    99  		return ret.result1
   100  	}
   101  	fakeReturns := fake.getDomainReturns
   102  	return fakeReturns.result1
   103  }
   104  
   105  func (fake *FakeDomainRequirement) GetDomainCallCount() int {
   106  	fake.getDomainMutex.RLock()
   107  	defer fake.getDomainMutex.RUnlock()
   108  	return len(fake.getDomainArgsForCall)
   109  }
   110  
   111  func (fake *FakeDomainRequirement) GetDomainCalls(stub func() models.DomainFields) {
   112  	fake.getDomainMutex.Lock()
   113  	defer fake.getDomainMutex.Unlock()
   114  	fake.GetDomainStub = stub
   115  }
   116  
   117  func (fake *FakeDomainRequirement) GetDomainReturns(result1 models.DomainFields) {
   118  	fake.getDomainMutex.Lock()
   119  	defer fake.getDomainMutex.Unlock()
   120  	fake.GetDomainStub = nil
   121  	fake.getDomainReturns = struct {
   122  		result1 models.DomainFields
   123  	}{result1}
   124  }
   125  
   126  func (fake *FakeDomainRequirement) GetDomainReturnsOnCall(i int, result1 models.DomainFields) {
   127  	fake.getDomainMutex.Lock()
   128  	defer fake.getDomainMutex.Unlock()
   129  	fake.GetDomainStub = nil
   130  	if fake.getDomainReturnsOnCall == nil {
   131  		fake.getDomainReturnsOnCall = make(map[int]struct {
   132  			result1 models.DomainFields
   133  		})
   134  	}
   135  	fake.getDomainReturnsOnCall[i] = struct {
   136  		result1 models.DomainFields
   137  	}{result1}
   138  }
   139  
   140  func (fake *FakeDomainRequirement) Invocations() map[string][][]interface{} {
   141  	fake.invocationsMutex.RLock()
   142  	defer fake.invocationsMutex.RUnlock()
   143  	fake.executeMutex.RLock()
   144  	defer fake.executeMutex.RUnlock()
   145  	fake.getDomainMutex.RLock()
   146  	defer fake.getDomainMutex.RUnlock()
   147  	copiedInvocations := map[string][][]interface{}{}
   148  	for key, value := range fake.invocations {
   149  		copiedInvocations[key] = value
   150  	}
   151  	return copiedInvocations
   152  }
   153  
   154  func (fake *FakeDomainRequirement) recordInvocation(key string, args []interface{}) {
   155  	fake.invocationsMutex.Lock()
   156  	defer fake.invocationsMutex.Unlock()
   157  	if fake.invocations == nil {
   158  		fake.invocations = map[string][][]interface{}{}
   159  	}
   160  	if fake.invocations[key] == nil {
   161  		fake.invocations[key] = [][]interface{}{}
   162  	}
   163  	fake.invocations[key] = append(fake.invocations[key], args)
   164  }
   165  
   166  var _ requirements.DomainRequirement = new(FakeDomainRequirement)