github.com/mook-as/cf-cli@v7.0.0-beta.28.0.20200120190804-b91c115fae48+incompatible/util/ui/uifakes/fake_config.go (about)

     1  // Code generated by counterfeiter. DO NOT EDIT.
     2  package uifakes
     3  
     4  import (
     5  	"sync"
     6  
     7  	"code.cloudfoundry.org/cli/util/configv3"
     8  	"code.cloudfoundry.org/cli/util/ui"
     9  )
    10  
    11  type FakeConfig struct {
    12  	ColorEnabledStub        func() configv3.ColorSetting
    13  	colorEnabledMutex       sync.RWMutex
    14  	colorEnabledArgsForCall []struct {
    15  	}
    16  	colorEnabledReturns struct {
    17  		result1 configv3.ColorSetting
    18  	}
    19  	colorEnabledReturnsOnCall map[int]struct {
    20  		result1 configv3.ColorSetting
    21  	}
    22  	IsTTYStub        func() bool
    23  	isTTYMutex       sync.RWMutex
    24  	isTTYArgsForCall []struct {
    25  	}
    26  	isTTYReturns struct {
    27  		result1 bool
    28  	}
    29  	isTTYReturnsOnCall map[int]struct {
    30  		result1 bool
    31  	}
    32  	LocaleStub        func() string
    33  	localeMutex       sync.RWMutex
    34  	localeArgsForCall []struct {
    35  	}
    36  	localeReturns struct {
    37  		result1 string
    38  	}
    39  	localeReturnsOnCall map[int]struct {
    40  		result1 string
    41  	}
    42  	TerminalWidthStub        func() int
    43  	terminalWidthMutex       sync.RWMutex
    44  	terminalWidthArgsForCall []struct {
    45  	}
    46  	terminalWidthReturns struct {
    47  		result1 int
    48  	}
    49  	terminalWidthReturnsOnCall map[int]struct {
    50  		result1 int
    51  	}
    52  	invocations      map[string][][]interface{}
    53  	invocationsMutex sync.RWMutex
    54  }
    55  
    56  func (fake *FakeConfig) ColorEnabled() configv3.ColorSetting {
    57  	fake.colorEnabledMutex.Lock()
    58  	ret, specificReturn := fake.colorEnabledReturnsOnCall[len(fake.colorEnabledArgsForCall)]
    59  	fake.colorEnabledArgsForCall = append(fake.colorEnabledArgsForCall, struct {
    60  	}{})
    61  	fake.recordInvocation("ColorEnabled", []interface{}{})
    62  	fake.colorEnabledMutex.Unlock()
    63  	if fake.ColorEnabledStub != nil {
    64  		return fake.ColorEnabledStub()
    65  	}
    66  	if specificReturn {
    67  		return ret.result1
    68  	}
    69  	fakeReturns := fake.colorEnabledReturns
    70  	return fakeReturns.result1
    71  }
    72  
    73  func (fake *FakeConfig) ColorEnabledCallCount() int {
    74  	fake.colorEnabledMutex.RLock()
    75  	defer fake.colorEnabledMutex.RUnlock()
    76  	return len(fake.colorEnabledArgsForCall)
    77  }
    78  
    79  func (fake *FakeConfig) ColorEnabledCalls(stub func() configv3.ColorSetting) {
    80  	fake.colorEnabledMutex.Lock()
    81  	defer fake.colorEnabledMutex.Unlock()
    82  	fake.ColorEnabledStub = stub
    83  }
    84  
    85  func (fake *FakeConfig) ColorEnabledReturns(result1 configv3.ColorSetting) {
    86  	fake.colorEnabledMutex.Lock()
    87  	defer fake.colorEnabledMutex.Unlock()
    88  	fake.ColorEnabledStub = nil
    89  	fake.colorEnabledReturns = struct {
    90  		result1 configv3.ColorSetting
    91  	}{result1}
    92  }
    93  
    94  func (fake *FakeConfig) ColorEnabledReturnsOnCall(i int, result1 configv3.ColorSetting) {
    95  	fake.colorEnabledMutex.Lock()
    96  	defer fake.colorEnabledMutex.Unlock()
    97  	fake.ColorEnabledStub = nil
    98  	if fake.colorEnabledReturnsOnCall == nil {
    99  		fake.colorEnabledReturnsOnCall = make(map[int]struct {
   100  			result1 configv3.ColorSetting
   101  		})
   102  	}
   103  	fake.colorEnabledReturnsOnCall[i] = struct {
   104  		result1 configv3.ColorSetting
   105  	}{result1}
   106  }
   107  
   108  func (fake *FakeConfig) IsTTY() bool {
   109  	fake.isTTYMutex.Lock()
   110  	ret, specificReturn := fake.isTTYReturnsOnCall[len(fake.isTTYArgsForCall)]
   111  	fake.isTTYArgsForCall = append(fake.isTTYArgsForCall, struct {
   112  	}{})
   113  	fake.recordInvocation("IsTTY", []interface{}{})
   114  	fake.isTTYMutex.Unlock()
   115  	if fake.IsTTYStub != nil {
   116  		return fake.IsTTYStub()
   117  	}
   118  	if specificReturn {
   119  		return ret.result1
   120  	}
   121  	fakeReturns := fake.isTTYReturns
   122  	return fakeReturns.result1
   123  }
   124  
   125  func (fake *FakeConfig) IsTTYCallCount() int {
   126  	fake.isTTYMutex.RLock()
   127  	defer fake.isTTYMutex.RUnlock()
   128  	return len(fake.isTTYArgsForCall)
   129  }
   130  
   131  func (fake *FakeConfig) IsTTYCalls(stub func() bool) {
   132  	fake.isTTYMutex.Lock()
   133  	defer fake.isTTYMutex.Unlock()
   134  	fake.IsTTYStub = stub
   135  }
   136  
   137  func (fake *FakeConfig) IsTTYReturns(result1 bool) {
   138  	fake.isTTYMutex.Lock()
   139  	defer fake.isTTYMutex.Unlock()
   140  	fake.IsTTYStub = nil
   141  	fake.isTTYReturns = struct {
   142  		result1 bool
   143  	}{result1}
   144  }
   145  
   146  func (fake *FakeConfig) IsTTYReturnsOnCall(i int, result1 bool) {
   147  	fake.isTTYMutex.Lock()
   148  	defer fake.isTTYMutex.Unlock()
   149  	fake.IsTTYStub = nil
   150  	if fake.isTTYReturnsOnCall == nil {
   151  		fake.isTTYReturnsOnCall = make(map[int]struct {
   152  			result1 bool
   153  		})
   154  	}
   155  	fake.isTTYReturnsOnCall[i] = struct {
   156  		result1 bool
   157  	}{result1}
   158  }
   159  
   160  func (fake *FakeConfig) Locale() string {
   161  	fake.localeMutex.Lock()
   162  	ret, specificReturn := fake.localeReturnsOnCall[len(fake.localeArgsForCall)]
   163  	fake.localeArgsForCall = append(fake.localeArgsForCall, struct {
   164  	}{})
   165  	fake.recordInvocation("Locale", []interface{}{})
   166  	fake.localeMutex.Unlock()
   167  	if fake.LocaleStub != nil {
   168  		return fake.LocaleStub()
   169  	}
   170  	if specificReturn {
   171  		return ret.result1
   172  	}
   173  	fakeReturns := fake.localeReturns
   174  	return fakeReturns.result1
   175  }
   176  
   177  func (fake *FakeConfig) LocaleCallCount() int {
   178  	fake.localeMutex.RLock()
   179  	defer fake.localeMutex.RUnlock()
   180  	return len(fake.localeArgsForCall)
   181  }
   182  
   183  func (fake *FakeConfig) LocaleCalls(stub func() string) {
   184  	fake.localeMutex.Lock()
   185  	defer fake.localeMutex.Unlock()
   186  	fake.LocaleStub = stub
   187  }
   188  
   189  func (fake *FakeConfig) LocaleReturns(result1 string) {
   190  	fake.localeMutex.Lock()
   191  	defer fake.localeMutex.Unlock()
   192  	fake.LocaleStub = nil
   193  	fake.localeReturns = struct {
   194  		result1 string
   195  	}{result1}
   196  }
   197  
   198  func (fake *FakeConfig) LocaleReturnsOnCall(i int, result1 string) {
   199  	fake.localeMutex.Lock()
   200  	defer fake.localeMutex.Unlock()
   201  	fake.LocaleStub = nil
   202  	if fake.localeReturnsOnCall == nil {
   203  		fake.localeReturnsOnCall = make(map[int]struct {
   204  			result1 string
   205  		})
   206  	}
   207  	fake.localeReturnsOnCall[i] = struct {
   208  		result1 string
   209  	}{result1}
   210  }
   211  
   212  func (fake *FakeConfig) TerminalWidth() int {
   213  	fake.terminalWidthMutex.Lock()
   214  	ret, specificReturn := fake.terminalWidthReturnsOnCall[len(fake.terminalWidthArgsForCall)]
   215  	fake.terminalWidthArgsForCall = append(fake.terminalWidthArgsForCall, struct {
   216  	}{})
   217  	fake.recordInvocation("TerminalWidth", []interface{}{})
   218  	fake.terminalWidthMutex.Unlock()
   219  	if fake.TerminalWidthStub != nil {
   220  		return fake.TerminalWidthStub()
   221  	}
   222  	if specificReturn {
   223  		return ret.result1
   224  	}
   225  	fakeReturns := fake.terminalWidthReturns
   226  	return fakeReturns.result1
   227  }
   228  
   229  func (fake *FakeConfig) TerminalWidthCallCount() int {
   230  	fake.terminalWidthMutex.RLock()
   231  	defer fake.terminalWidthMutex.RUnlock()
   232  	return len(fake.terminalWidthArgsForCall)
   233  }
   234  
   235  func (fake *FakeConfig) TerminalWidthCalls(stub func() int) {
   236  	fake.terminalWidthMutex.Lock()
   237  	defer fake.terminalWidthMutex.Unlock()
   238  	fake.TerminalWidthStub = stub
   239  }
   240  
   241  func (fake *FakeConfig) TerminalWidthReturns(result1 int) {
   242  	fake.terminalWidthMutex.Lock()
   243  	defer fake.terminalWidthMutex.Unlock()
   244  	fake.TerminalWidthStub = nil
   245  	fake.terminalWidthReturns = struct {
   246  		result1 int
   247  	}{result1}
   248  }
   249  
   250  func (fake *FakeConfig) TerminalWidthReturnsOnCall(i int, result1 int) {
   251  	fake.terminalWidthMutex.Lock()
   252  	defer fake.terminalWidthMutex.Unlock()
   253  	fake.TerminalWidthStub = nil
   254  	if fake.terminalWidthReturnsOnCall == nil {
   255  		fake.terminalWidthReturnsOnCall = make(map[int]struct {
   256  			result1 int
   257  		})
   258  	}
   259  	fake.terminalWidthReturnsOnCall[i] = struct {
   260  		result1 int
   261  	}{result1}
   262  }
   263  
   264  func (fake *FakeConfig) Invocations() map[string][][]interface{} {
   265  	fake.invocationsMutex.RLock()
   266  	defer fake.invocationsMutex.RUnlock()
   267  	fake.colorEnabledMutex.RLock()
   268  	defer fake.colorEnabledMutex.RUnlock()
   269  	fake.isTTYMutex.RLock()
   270  	defer fake.isTTYMutex.RUnlock()
   271  	fake.localeMutex.RLock()
   272  	defer fake.localeMutex.RUnlock()
   273  	fake.terminalWidthMutex.RLock()
   274  	defer fake.terminalWidthMutex.RUnlock()
   275  	copiedInvocations := map[string][][]interface{}{}
   276  	for key, value := range fake.invocations {
   277  		copiedInvocations[key] = value
   278  	}
   279  	return copiedInvocations
   280  }
   281  
   282  func (fake *FakeConfig) recordInvocation(key string, args []interface{}) {
   283  	fake.invocationsMutex.Lock()
   284  	defer fake.invocationsMutex.Unlock()
   285  	if fake.invocations == nil {
   286  		fake.invocations = map[string][][]interface{}{}
   287  	}
   288  	if fake.invocations[key] == nil {
   289  		fake.invocations[key] = [][]interface{}{}
   290  	}
   291  	fake.invocations[key] = append(fake.invocations[key], args)
   292  }
   293  
   294  var _ ui.Config = new(FakeConfig)