github.com/andrewhsu/cli/v2@v2.0.1-0.20210910131313-d4b4061f5b89/pkg/extensions/extension_mock.go (about)

     1  // Code generated by moq; DO NOT EDIT.
     2  // github.com/matryer/moq
     3  
     4  package extensions
     5  
     6  import (
     7  	"sync"
     8  )
     9  
    10  // Ensure, that ExtensionMock does implement Extension.
    11  // If this is not the case, regenerate this file with moq.
    12  var _ Extension = &ExtensionMock{}
    13  
    14  // ExtensionMock is a mock implementation of Extension.
    15  //
    16  // 	func TestSomethingThatUsesExtension(t *testing.T) {
    17  //
    18  // 		// make and configure a mocked Extension
    19  // 		mockedExtension := &ExtensionMock{
    20  // 			IsLocalFunc: func() bool {
    21  // 				panic("mock out the IsLocal method")
    22  // 			},
    23  // 			NameFunc: func() string {
    24  // 				panic("mock out the Name method")
    25  // 			},
    26  // 			PathFunc: func() string {
    27  // 				panic("mock out the Path method")
    28  // 			},
    29  // 			URLFunc: func() string {
    30  // 				panic("mock out the URL method")
    31  // 			},
    32  // 			UpdateAvailableFunc: func() bool {
    33  // 				panic("mock out the UpdateAvailable method")
    34  // 			},
    35  // 		}
    36  //
    37  // 		// use mockedExtension in code that requires Extension
    38  // 		// and then make assertions.
    39  //
    40  // 	}
    41  type ExtensionMock struct {
    42  	// IsLocalFunc mocks the IsLocal method.
    43  	IsLocalFunc func() bool
    44  
    45  	// NameFunc mocks the Name method.
    46  	NameFunc func() string
    47  
    48  	// PathFunc mocks the Path method.
    49  	PathFunc func() string
    50  
    51  	// URLFunc mocks the URL method.
    52  	URLFunc func() string
    53  
    54  	// UpdateAvailableFunc mocks the UpdateAvailable method.
    55  	UpdateAvailableFunc func() bool
    56  
    57  	// calls tracks calls to the methods.
    58  	calls struct {
    59  		// IsLocal holds details about calls to the IsLocal method.
    60  		IsLocal []struct {
    61  		}
    62  		// Name holds details about calls to the Name method.
    63  		Name []struct {
    64  		}
    65  		// Path holds details about calls to the Path method.
    66  		Path []struct {
    67  		}
    68  		// URL holds details about calls to the URL method.
    69  		URL []struct {
    70  		}
    71  		// UpdateAvailable holds details about calls to the UpdateAvailable method.
    72  		UpdateAvailable []struct {
    73  		}
    74  	}
    75  	lockIsLocal         sync.RWMutex
    76  	lockName            sync.RWMutex
    77  	lockPath            sync.RWMutex
    78  	lockURL             sync.RWMutex
    79  	lockUpdateAvailable sync.RWMutex
    80  }
    81  
    82  // IsLocal calls IsLocalFunc.
    83  func (mock *ExtensionMock) IsLocal() bool {
    84  	if mock.IsLocalFunc == nil {
    85  		panic("ExtensionMock.IsLocalFunc: method is nil but Extension.IsLocal was just called")
    86  	}
    87  	callInfo := struct {
    88  	}{}
    89  	mock.lockIsLocal.Lock()
    90  	mock.calls.IsLocal = append(mock.calls.IsLocal, callInfo)
    91  	mock.lockIsLocal.Unlock()
    92  	return mock.IsLocalFunc()
    93  }
    94  
    95  // IsLocalCalls gets all the calls that were made to IsLocal.
    96  // Check the length with:
    97  //     len(mockedExtension.IsLocalCalls())
    98  func (mock *ExtensionMock) IsLocalCalls() []struct {
    99  } {
   100  	var calls []struct {
   101  	}
   102  	mock.lockIsLocal.RLock()
   103  	calls = mock.calls.IsLocal
   104  	mock.lockIsLocal.RUnlock()
   105  	return calls
   106  }
   107  
   108  // Name calls NameFunc.
   109  func (mock *ExtensionMock) Name() string {
   110  	if mock.NameFunc == nil {
   111  		panic("ExtensionMock.NameFunc: method is nil but Extension.Name was just called")
   112  	}
   113  	callInfo := struct {
   114  	}{}
   115  	mock.lockName.Lock()
   116  	mock.calls.Name = append(mock.calls.Name, callInfo)
   117  	mock.lockName.Unlock()
   118  	return mock.NameFunc()
   119  }
   120  
   121  // NameCalls gets all the calls that were made to Name.
   122  // Check the length with:
   123  //     len(mockedExtension.NameCalls())
   124  func (mock *ExtensionMock) NameCalls() []struct {
   125  } {
   126  	var calls []struct {
   127  	}
   128  	mock.lockName.RLock()
   129  	calls = mock.calls.Name
   130  	mock.lockName.RUnlock()
   131  	return calls
   132  }
   133  
   134  // Path calls PathFunc.
   135  func (mock *ExtensionMock) Path() string {
   136  	if mock.PathFunc == nil {
   137  		panic("ExtensionMock.PathFunc: method is nil but Extension.Path was just called")
   138  	}
   139  	callInfo := struct {
   140  	}{}
   141  	mock.lockPath.Lock()
   142  	mock.calls.Path = append(mock.calls.Path, callInfo)
   143  	mock.lockPath.Unlock()
   144  	return mock.PathFunc()
   145  }
   146  
   147  // PathCalls gets all the calls that were made to Path.
   148  // Check the length with:
   149  //     len(mockedExtension.PathCalls())
   150  func (mock *ExtensionMock) PathCalls() []struct {
   151  } {
   152  	var calls []struct {
   153  	}
   154  	mock.lockPath.RLock()
   155  	calls = mock.calls.Path
   156  	mock.lockPath.RUnlock()
   157  	return calls
   158  }
   159  
   160  // URL calls URLFunc.
   161  func (mock *ExtensionMock) URL() string {
   162  	if mock.URLFunc == nil {
   163  		panic("ExtensionMock.URLFunc: method is nil but Extension.URL was just called")
   164  	}
   165  	callInfo := struct {
   166  	}{}
   167  	mock.lockURL.Lock()
   168  	mock.calls.URL = append(mock.calls.URL, callInfo)
   169  	mock.lockURL.Unlock()
   170  	return mock.URLFunc()
   171  }
   172  
   173  // URLCalls gets all the calls that were made to URL.
   174  // Check the length with:
   175  //     len(mockedExtension.URLCalls())
   176  func (mock *ExtensionMock) URLCalls() []struct {
   177  } {
   178  	var calls []struct {
   179  	}
   180  	mock.lockURL.RLock()
   181  	calls = mock.calls.URL
   182  	mock.lockURL.RUnlock()
   183  	return calls
   184  }
   185  
   186  // UpdateAvailable calls UpdateAvailableFunc.
   187  func (mock *ExtensionMock) UpdateAvailable() bool {
   188  	if mock.UpdateAvailableFunc == nil {
   189  		panic("ExtensionMock.UpdateAvailableFunc: method is nil but Extension.UpdateAvailable was just called")
   190  	}
   191  	callInfo := struct {
   192  	}{}
   193  	mock.lockUpdateAvailable.Lock()
   194  	mock.calls.UpdateAvailable = append(mock.calls.UpdateAvailable, callInfo)
   195  	mock.lockUpdateAvailable.Unlock()
   196  	return mock.UpdateAvailableFunc()
   197  }
   198  
   199  // UpdateAvailableCalls gets all the calls that were made to UpdateAvailable.
   200  // Check the length with:
   201  //     len(mockedExtension.UpdateAvailableCalls())
   202  func (mock *ExtensionMock) UpdateAvailableCalls() []struct {
   203  } {
   204  	var calls []struct {
   205  	}
   206  	mock.lockUpdateAvailable.RLock()
   207  	calls = mock.calls.UpdateAvailable
   208  	mock.lockUpdateAvailable.RUnlock()
   209  	return calls
   210  }