github.com/swisscom/cloudfoundry-cli@v7.1.0+incompatible/actor/v2action/v2actionfakes/fake_simple_progress_bar.go (about)

     1  // Code generated by counterfeiter. DO NOT EDIT.
     2  package v2actionfakes
     3  
     4  import (
     5  	"io"
     6  	"sync"
     7  
     8  	"code.cloudfoundry.org/cli/actor/v2action"
     9  )
    10  
    11  type FakeSimpleProgressBar struct {
    12  	InitializeStub        func(string) (io.Reader, int64, error)
    13  	initializeMutex       sync.RWMutex
    14  	initializeArgsForCall []struct {
    15  		arg1 string
    16  	}
    17  	initializeReturns struct {
    18  		result1 io.Reader
    19  		result2 int64
    20  		result3 error
    21  	}
    22  	initializeReturnsOnCall map[int]struct {
    23  		result1 io.Reader
    24  		result2 int64
    25  		result3 error
    26  	}
    27  	TerminateStub        func()
    28  	terminateMutex       sync.RWMutex
    29  	terminateArgsForCall []struct {
    30  	}
    31  	invocations      map[string][][]interface{}
    32  	invocationsMutex sync.RWMutex
    33  }
    34  
    35  func (fake *FakeSimpleProgressBar) Initialize(arg1 string) (io.Reader, int64, error) {
    36  	fake.initializeMutex.Lock()
    37  	ret, specificReturn := fake.initializeReturnsOnCall[len(fake.initializeArgsForCall)]
    38  	fake.initializeArgsForCall = append(fake.initializeArgsForCall, struct {
    39  		arg1 string
    40  	}{arg1})
    41  	fake.recordInvocation("Initialize", []interface{}{arg1})
    42  	fake.initializeMutex.Unlock()
    43  	if fake.InitializeStub != nil {
    44  		return fake.InitializeStub(arg1)
    45  	}
    46  	if specificReturn {
    47  		return ret.result1, ret.result2, ret.result3
    48  	}
    49  	fakeReturns := fake.initializeReturns
    50  	return fakeReturns.result1, fakeReturns.result2, fakeReturns.result3
    51  }
    52  
    53  func (fake *FakeSimpleProgressBar) InitializeCallCount() int {
    54  	fake.initializeMutex.RLock()
    55  	defer fake.initializeMutex.RUnlock()
    56  	return len(fake.initializeArgsForCall)
    57  }
    58  
    59  func (fake *FakeSimpleProgressBar) InitializeCalls(stub func(string) (io.Reader, int64, error)) {
    60  	fake.initializeMutex.Lock()
    61  	defer fake.initializeMutex.Unlock()
    62  	fake.InitializeStub = stub
    63  }
    64  
    65  func (fake *FakeSimpleProgressBar) InitializeArgsForCall(i int) string {
    66  	fake.initializeMutex.RLock()
    67  	defer fake.initializeMutex.RUnlock()
    68  	argsForCall := fake.initializeArgsForCall[i]
    69  	return argsForCall.arg1
    70  }
    71  
    72  func (fake *FakeSimpleProgressBar) InitializeReturns(result1 io.Reader, result2 int64, result3 error) {
    73  	fake.initializeMutex.Lock()
    74  	defer fake.initializeMutex.Unlock()
    75  	fake.InitializeStub = nil
    76  	fake.initializeReturns = struct {
    77  		result1 io.Reader
    78  		result2 int64
    79  		result3 error
    80  	}{result1, result2, result3}
    81  }
    82  
    83  func (fake *FakeSimpleProgressBar) InitializeReturnsOnCall(i int, result1 io.Reader, result2 int64, result3 error) {
    84  	fake.initializeMutex.Lock()
    85  	defer fake.initializeMutex.Unlock()
    86  	fake.InitializeStub = nil
    87  	if fake.initializeReturnsOnCall == nil {
    88  		fake.initializeReturnsOnCall = make(map[int]struct {
    89  			result1 io.Reader
    90  			result2 int64
    91  			result3 error
    92  		})
    93  	}
    94  	fake.initializeReturnsOnCall[i] = struct {
    95  		result1 io.Reader
    96  		result2 int64
    97  		result3 error
    98  	}{result1, result2, result3}
    99  }
   100  
   101  func (fake *FakeSimpleProgressBar) Terminate() {
   102  	fake.terminateMutex.Lock()
   103  	fake.terminateArgsForCall = append(fake.terminateArgsForCall, struct {
   104  	}{})
   105  	fake.recordInvocation("Terminate", []interface{}{})
   106  	fake.terminateMutex.Unlock()
   107  	if fake.TerminateStub != nil {
   108  		fake.TerminateStub()
   109  	}
   110  }
   111  
   112  func (fake *FakeSimpleProgressBar) TerminateCallCount() int {
   113  	fake.terminateMutex.RLock()
   114  	defer fake.terminateMutex.RUnlock()
   115  	return len(fake.terminateArgsForCall)
   116  }
   117  
   118  func (fake *FakeSimpleProgressBar) TerminateCalls(stub func()) {
   119  	fake.terminateMutex.Lock()
   120  	defer fake.terminateMutex.Unlock()
   121  	fake.TerminateStub = stub
   122  }
   123  
   124  func (fake *FakeSimpleProgressBar) Invocations() map[string][][]interface{} {
   125  	fake.invocationsMutex.RLock()
   126  	defer fake.invocationsMutex.RUnlock()
   127  	fake.initializeMutex.RLock()
   128  	defer fake.initializeMutex.RUnlock()
   129  	fake.terminateMutex.RLock()
   130  	defer fake.terminateMutex.RUnlock()
   131  	copiedInvocations := map[string][][]interface{}{}
   132  	for key, value := range fake.invocations {
   133  		copiedInvocations[key] = value
   134  	}
   135  	return copiedInvocations
   136  }
   137  
   138  func (fake *FakeSimpleProgressBar) recordInvocation(key string, args []interface{}) {
   139  	fake.invocationsMutex.Lock()
   140  	defer fake.invocationsMutex.Unlock()
   141  	if fake.invocations == nil {
   142  		fake.invocations = map[string][][]interface{}{}
   143  	}
   144  	if fake.invocations[key] == nil {
   145  		fake.invocations[key] = [][]interface{}{}
   146  	}
   147  	fake.invocations[key] = append(fake.invocations[key], args)
   148  }
   149  
   150  var _ v2action.SimpleProgressBar = new(FakeSimpleProgressBar)