github.com/Thanhphan1147/cloudfoundry-cli@v7.1.0+incompatible/plugin/rpc/rpcfakes/fake_terminal_output_switch.go (about)

     1  // Code generated by counterfeiter. DO NOT EDIT.
     2  package rpcfakes
     3  
     4  import (
     5  	"sync"
     6  
     7  	"code.cloudfoundry.org/cli/plugin/rpc"
     8  )
     9  
    10  type FakeTerminalOutputSwitch struct {
    11  	DisableTerminalOutputStub        func(bool)
    12  	disableTerminalOutputMutex       sync.RWMutex
    13  	disableTerminalOutputArgsForCall []struct {
    14  		arg1 bool
    15  	}
    16  	invocations      map[string][][]interface{}
    17  	invocationsMutex sync.RWMutex
    18  }
    19  
    20  func (fake *FakeTerminalOutputSwitch) DisableTerminalOutput(arg1 bool) {
    21  	fake.disableTerminalOutputMutex.Lock()
    22  	fake.disableTerminalOutputArgsForCall = append(fake.disableTerminalOutputArgsForCall, struct {
    23  		arg1 bool
    24  	}{arg1})
    25  	fake.recordInvocation("DisableTerminalOutput", []interface{}{arg1})
    26  	fake.disableTerminalOutputMutex.Unlock()
    27  	if fake.DisableTerminalOutputStub != nil {
    28  		fake.DisableTerminalOutputStub(arg1)
    29  	}
    30  }
    31  
    32  func (fake *FakeTerminalOutputSwitch) DisableTerminalOutputCallCount() int {
    33  	fake.disableTerminalOutputMutex.RLock()
    34  	defer fake.disableTerminalOutputMutex.RUnlock()
    35  	return len(fake.disableTerminalOutputArgsForCall)
    36  }
    37  
    38  func (fake *FakeTerminalOutputSwitch) DisableTerminalOutputCalls(stub func(bool)) {
    39  	fake.disableTerminalOutputMutex.Lock()
    40  	defer fake.disableTerminalOutputMutex.Unlock()
    41  	fake.DisableTerminalOutputStub = stub
    42  }
    43  
    44  func (fake *FakeTerminalOutputSwitch) DisableTerminalOutputArgsForCall(i int) bool {
    45  	fake.disableTerminalOutputMutex.RLock()
    46  	defer fake.disableTerminalOutputMutex.RUnlock()
    47  	argsForCall := fake.disableTerminalOutputArgsForCall[i]
    48  	return argsForCall.arg1
    49  }
    50  
    51  func (fake *FakeTerminalOutputSwitch) Invocations() map[string][][]interface{} {
    52  	fake.invocationsMutex.RLock()
    53  	defer fake.invocationsMutex.RUnlock()
    54  	fake.disableTerminalOutputMutex.RLock()
    55  	defer fake.disableTerminalOutputMutex.RUnlock()
    56  	copiedInvocations := map[string][][]interface{}{}
    57  	for key, value := range fake.invocations {
    58  		copiedInvocations[key] = value
    59  	}
    60  	return copiedInvocations
    61  }
    62  
    63  func (fake *FakeTerminalOutputSwitch) recordInvocation(key string, args []interface{}) {
    64  	fake.invocationsMutex.Lock()
    65  	defer fake.invocationsMutex.Unlock()
    66  	if fake.invocations == nil {
    67  		fake.invocations = map[string][][]interface{}{}
    68  	}
    69  	if fake.invocations[key] == nil {
    70  		fake.invocations[key] = [][]interface{}{}
    71  	}
    72  	fake.invocations[key] = append(fake.invocations[key], args)
    73  }
    74  
    75  var _ rpc.TerminalOutputSwitch = new(FakeTerminalOutputSwitch)