github.com/cloudfoundry/cli@v7.1.0+incompatible/util/ui/uifakes/fake_resolver.go (about)

     1  // Code generated by counterfeiter. DO NOT EDIT.
     2  package uifakes
     3  
     4  import (
     5  	"io"
     6  	"sync"
     7  
     8  	"code.cloudfoundry.org/cli/util/ui"
     9  )
    10  
    11  type FakeResolver struct {
    12  	ResolveStub        func(interface{}) error
    13  	resolveMutex       sync.RWMutex
    14  	resolveArgsForCall []struct {
    15  		arg1 interface{}
    16  	}
    17  	resolveReturns struct {
    18  		result1 error
    19  	}
    20  	resolveReturnsOnCall map[int]struct {
    21  		result1 error
    22  	}
    23  	SetInStub        func(io.Reader)
    24  	setInMutex       sync.RWMutex
    25  	setInArgsForCall []struct {
    26  		arg1 io.Reader
    27  	}
    28  	SetOutStub        func(io.Writer)
    29  	setOutMutex       sync.RWMutex
    30  	setOutArgsForCall []struct {
    31  		arg1 io.Writer
    32  	}
    33  	invocations      map[string][][]interface{}
    34  	invocationsMutex sync.RWMutex
    35  }
    36  
    37  func (fake *FakeResolver) Resolve(arg1 interface{}) error {
    38  	fake.resolveMutex.Lock()
    39  	ret, specificReturn := fake.resolveReturnsOnCall[len(fake.resolveArgsForCall)]
    40  	fake.resolveArgsForCall = append(fake.resolveArgsForCall, struct {
    41  		arg1 interface{}
    42  	}{arg1})
    43  	fake.recordInvocation("Resolve", []interface{}{arg1})
    44  	fake.resolveMutex.Unlock()
    45  	if fake.ResolveStub != nil {
    46  		return fake.ResolveStub(arg1)
    47  	}
    48  	if specificReturn {
    49  		return ret.result1
    50  	}
    51  	fakeReturns := fake.resolveReturns
    52  	return fakeReturns.result1
    53  }
    54  
    55  func (fake *FakeResolver) ResolveCallCount() int {
    56  	fake.resolveMutex.RLock()
    57  	defer fake.resolveMutex.RUnlock()
    58  	return len(fake.resolveArgsForCall)
    59  }
    60  
    61  func (fake *FakeResolver) ResolveCalls(stub func(interface{}) error) {
    62  	fake.resolveMutex.Lock()
    63  	defer fake.resolveMutex.Unlock()
    64  	fake.ResolveStub = stub
    65  }
    66  
    67  func (fake *FakeResolver) ResolveArgsForCall(i int) interface{} {
    68  	fake.resolveMutex.RLock()
    69  	defer fake.resolveMutex.RUnlock()
    70  	argsForCall := fake.resolveArgsForCall[i]
    71  	return argsForCall.arg1
    72  }
    73  
    74  func (fake *FakeResolver) ResolveReturns(result1 error) {
    75  	fake.resolveMutex.Lock()
    76  	defer fake.resolveMutex.Unlock()
    77  	fake.ResolveStub = nil
    78  	fake.resolveReturns = struct {
    79  		result1 error
    80  	}{result1}
    81  }
    82  
    83  func (fake *FakeResolver) ResolveReturnsOnCall(i int, result1 error) {
    84  	fake.resolveMutex.Lock()
    85  	defer fake.resolveMutex.Unlock()
    86  	fake.ResolveStub = nil
    87  	if fake.resolveReturnsOnCall == nil {
    88  		fake.resolveReturnsOnCall = make(map[int]struct {
    89  			result1 error
    90  		})
    91  	}
    92  	fake.resolveReturnsOnCall[i] = struct {
    93  		result1 error
    94  	}{result1}
    95  }
    96  
    97  func (fake *FakeResolver) SetIn(arg1 io.Reader) {
    98  	fake.setInMutex.Lock()
    99  	fake.setInArgsForCall = append(fake.setInArgsForCall, struct {
   100  		arg1 io.Reader
   101  	}{arg1})
   102  	fake.recordInvocation("SetIn", []interface{}{arg1})
   103  	fake.setInMutex.Unlock()
   104  	if fake.SetInStub != nil {
   105  		fake.SetInStub(arg1)
   106  	}
   107  }
   108  
   109  func (fake *FakeResolver) SetInCallCount() int {
   110  	fake.setInMutex.RLock()
   111  	defer fake.setInMutex.RUnlock()
   112  	return len(fake.setInArgsForCall)
   113  }
   114  
   115  func (fake *FakeResolver) SetInCalls(stub func(io.Reader)) {
   116  	fake.setInMutex.Lock()
   117  	defer fake.setInMutex.Unlock()
   118  	fake.SetInStub = stub
   119  }
   120  
   121  func (fake *FakeResolver) SetInArgsForCall(i int) io.Reader {
   122  	fake.setInMutex.RLock()
   123  	defer fake.setInMutex.RUnlock()
   124  	argsForCall := fake.setInArgsForCall[i]
   125  	return argsForCall.arg1
   126  }
   127  
   128  func (fake *FakeResolver) SetOut(arg1 io.Writer) {
   129  	fake.setOutMutex.Lock()
   130  	fake.setOutArgsForCall = append(fake.setOutArgsForCall, struct {
   131  		arg1 io.Writer
   132  	}{arg1})
   133  	fake.recordInvocation("SetOut", []interface{}{arg1})
   134  	fake.setOutMutex.Unlock()
   135  	if fake.SetOutStub != nil {
   136  		fake.SetOutStub(arg1)
   137  	}
   138  }
   139  
   140  func (fake *FakeResolver) SetOutCallCount() int {
   141  	fake.setOutMutex.RLock()
   142  	defer fake.setOutMutex.RUnlock()
   143  	return len(fake.setOutArgsForCall)
   144  }
   145  
   146  func (fake *FakeResolver) SetOutCalls(stub func(io.Writer)) {
   147  	fake.setOutMutex.Lock()
   148  	defer fake.setOutMutex.Unlock()
   149  	fake.SetOutStub = stub
   150  }
   151  
   152  func (fake *FakeResolver) SetOutArgsForCall(i int) io.Writer {
   153  	fake.setOutMutex.RLock()
   154  	defer fake.setOutMutex.RUnlock()
   155  	argsForCall := fake.setOutArgsForCall[i]
   156  	return argsForCall.arg1
   157  }
   158  
   159  func (fake *FakeResolver) Invocations() map[string][][]interface{} {
   160  	fake.invocationsMutex.RLock()
   161  	defer fake.invocationsMutex.RUnlock()
   162  	fake.resolveMutex.RLock()
   163  	defer fake.resolveMutex.RUnlock()
   164  	fake.setInMutex.RLock()
   165  	defer fake.setInMutex.RUnlock()
   166  	fake.setOutMutex.RLock()
   167  	defer fake.setOutMutex.RUnlock()
   168  	copiedInvocations := map[string][][]interface{}{}
   169  	for key, value := range fake.invocations {
   170  		copiedInvocations[key] = value
   171  	}
   172  	return copiedInvocations
   173  }
   174  
   175  func (fake *FakeResolver) recordInvocation(key string, args []interface{}) {
   176  	fake.invocationsMutex.Lock()
   177  	defer fake.invocationsMutex.Unlock()
   178  	if fake.invocations == nil {
   179  		fake.invocations = map[string][][]interface{}{}
   180  	}
   181  	if fake.invocations[key] == nil {
   182  		fake.invocations[key] = [][]interface{}{}
   183  	}
   184  	fake.invocations[key] = append(fake.invocations[key], args)
   185  }
   186  
   187  var _ ui.Resolver = new(FakeResolver)