github.com/braveheart12/just@v0.8.7/ledger/pulsemanager/pulse_storage_pm_mock.go (about)

     1  package pulsemanager
     2  
     3  /*
     4  DO NOT EDIT!
     5  This code was generated automatically using github.com/gojuno/minimock v1.9
     6  The original interface "pulseStoragePm" can be found in github.com/insolar/insolar/ledger/pulsemanager
     7  */
     8  import (
     9  	context "context"
    10  	"sync/atomic"
    11  	"time"
    12  
    13  	"github.com/gojuno/minimock"
    14  	core "github.com/insolar/insolar/core"
    15  
    16  	testify_assert "github.com/stretchr/testify/assert"
    17  )
    18  
    19  //pulseStoragePmMock implements github.com/insolar/insolar/ledger/pulsemanager.pulseStoragePm
    20  type pulseStoragePmMock struct {
    21  	t minimock.Tester
    22  
    23  	CurrentFunc       func(p context.Context) (r *core.Pulse, r1 error)
    24  	CurrentCounter    uint64
    25  	CurrentPreCounter uint64
    26  	CurrentMock       mpulseStoragePmMockCurrent
    27  
    28  	LockFunc       func()
    29  	LockCounter    uint64
    30  	LockPreCounter uint64
    31  	LockMock       mpulseStoragePmMockLock
    32  
    33  	SetFunc       func(p *core.Pulse)
    34  	SetCounter    uint64
    35  	SetPreCounter uint64
    36  	SetMock       mpulseStoragePmMockSet
    37  
    38  	UnlockFunc       func()
    39  	UnlockCounter    uint64
    40  	UnlockPreCounter uint64
    41  	UnlockMock       mpulseStoragePmMockUnlock
    42  }
    43  
    44  //NewpulseStoragePmMock returns a mock for github.com/insolar/insolar/ledger/pulsemanager.pulseStoragePm
    45  func NewpulseStoragePmMock(t minimock.Tester) *pulseStoragePmMock {
    46  	m := &pulseStoragePmMock{t: t}
    47  
    48  	if controller, ok := t.(minimock.MockController); ok {
    49  		controller.RegisterMocker(m)
    50  	}
    51  
    52  	m.CurrentMock = mpulseStoragePmMockCurrent{mock: m}
    53  	m.LockMock = mpulseStoragePmMockLock{mock: m}
    54  	m.SetMock = mpulseStoragePmMockSet{mock: m}
    55  	m.UnlockMock = mpulseStoragePmMockUnlock{mock: m}
    56  
    57  	return m
    58  }
    59  
    60  type mpulseStoragePmMockCurrent struct {
    61  	mock              *pulseStoragePmMock
    62  	mainExpectation   *pulseStoragePmMockCurrentExpectation
    63  	expectationSeries []*pulseStoragePmMockCurrentExpectation
    64  }
    65  
    66  type pulseStoragePmMockCurrentExpectation struct {
    67  	input  *pulseStoragePmMockCurrentInput
    68  	result *pulseStoragePmMockCurrentResult
    69  }
    70  
    71  type pulseStoragePmMockCurrentInput struct {
    72  	p context.Context
    73  }
    74  
    75  type pulseStoragePmMockCurrentResult struct {
    76  	r  *core.Pulse
    77  	r1 error
    78  }
    79  
    80  //Expect specifies that invocation of pulseStoragePm.Current is expected from 1 to Infinity times
    81  func (m *mpulseStoragePmMockCurrent) Expect(p context.Context) *mpulseStoragePmMockCurrent {
    82  	m.mock.CurrentFunc = nil
    83  	m.expectationSeries = nil
    84  
    85  	if m.mainExpectation == nil {
    86  		m.mainExpectation = &pulseStoragePmMockCurrentExpectation{}
    87  	}
    88  	m.mainExpectation.input = &pulseStoragePmMockCurrentInput{p}
    89  	return m
    90  }
    91  
    92  //Return specifies results of invocation of pulseStoragePm.Current
    93  func (m *mpulseStoragePmMockCurrent) Return(r *core.Pulse, r1 error) *pulseStoragePmMock {
    94  	m.mock.CurrentFunc = nil
    95  	m.expectationSeries = nil
    96  
    97  	if m.mainExpectation == nil {
    98  		m.mainExpectation = &pulseStoragePmMockCurrentExpectation{}
    99  	}
   100  	m.mainExpectation.result = &pulseStoragePmMockCurrentResult{r, r1}
   101  	return m.mock
   102  }
   103  
   104  //ExpectOnce specifies that invocation of pulseStoragePm.Current is expected once
   105  func (m *mpulseStoragePmMockCurrent) ExpectOnce(p context.Context) *pulseStoragePmMockCurrentExpectation {
   106  	m.mock.CurrentFunc = nil
   107  	m.mainExpectation = nil
   108  
   109  	expectation := &pulseStoragePmMockCurrentExpectation{}
   110  	expectation.input = &pulseStoragePmMockCurrentInput{p}
   111  	m.expectationSeries = append(m.expectationSeries, expectation)
   112  	return expectation
   113  }
   114  
   115  func (e *pulseStoragePmMockCurrentExpectation) Return(r *core.Pulse, r1 error) {
   116  	e.result = &pulseStoragePmMockCurrentResult{r, r1}
   117  }
   118  
   119  //Set uses given function f as a mock of pulseStoragePm.Current method
   120  func (m *mpulseStoragePmMockCurrent) Set(f func(p context.Context) (r *core.Pulse, r1 error)) *pulseStoragePmMock {
   121  	m.mainExpectation = nil
   122  	m.expectationSeries = nil
   123  
   124  	m.mock.CurrentFunc = f
   125  	return m.mock
   126  }
   127  
   128  //Current implements github.com/insolar/insolar/ledger/pulsemanager.pulseStoragePm interface
   129  func (m *pulseStoragePmMock) Current(p context.Context) (r *core.Pulse, r1 error) {
   130  	counter := atomic.AddUint64(&m.CurrentPreCounter, 1)
   131  	defer atomic.AddUint64(&m.CurrentCounter, 1)
   132  
   133  	if len(m.CurrentMock.expectationSeries) > 0 {
   134  		if counter > uint64(len(m.CurrentMock.expectationSeries)) {
   135  			m.t.Fatalf("Unexpected call to pulseStoragePmMock.Current. %v", p)
   136  			return
   137  		}
   138  
   139  		input := m.CurrentMock.expectationSeries[counter-1].input
   140  		testify_assert.Equal(m.t, *input, pulseStoragePmMockCurrentInput{p}, "pulseStoragePm.Current got unexpected parameters")
   141  
   142  		result := m.CurrentMock.expectationSeries[counter-1].result
   143  		if result == nil {
   144  			m.t.Fatal("No results are set for the pulseStoragePmMock.Current")
   145  			return
   146  		}
   147  
   148  		r = result.r
   149  		r1 = result.r1
   150  
   151  		return
   152  	}
   153  
   154  	if m.CurrentMock.mainExpectation != nil {
   155  
   156  		input := m.CurrentMock.mainExpectation.input
   157  		if input != nil {
   158  			testify_assert.Equal(m.t, *input, pulseStoragePmMockCurrentInput{p}, "pulseStoragePm.Current got unexpected parameters")
   159  		}
   160  
   161  		result := m.CurrentMock.mainExpectation.result
   162  		if result == nil {
   163  			m.t.Fatal("No results are set for the pulseStoragePmMock.Current")
   164  		}
   165  
   166  		r = result.r
   167  		r1 = result.r1
   168  
   169  		return
   170  	}
   171  
   172  	if m.CurrentFunc == nil {
   173  		m.t.Fatalf("Unexpected call to pulseStoragePmMock.Current. %v", p)
   174  		return
   175  	}
   176  
   177  	return m.CurrentFunc(p)
   178  }
   179  
   180  //CurrentMinimockCounter returns a count of pulseStoragePmMock.CurrentFunc invocations
   181  func (m *pulseStoragePmMock) CurrentMinimockCounter() uint64 {
   182  	return atomic.LoadUint64(&m.CurrentCounter)
   183  }
   184  
   185  //CurrentMinimockPreCounter returns the value of pulseStoragePmMock.Current invocations
   186  func (m *pulseStoragePmMock) CurrentMinimockPreCounter() uint64 {
   187  	return atomic.LoadUint64(&m.CurrentPreCounter)
   188  }
   189  
   190  //CurrentFinished returns true if mock invocations count is ok
   191  func (m *pulseStoragePmMock) CurrentFinished() bool {
   192  	// if expectation series were set then invocations count should be equal to expectations count
   193  	if len(m.CurrentMock.expectationSeries) > 0 {
   194  		return atomic.LoadUint64(&m.CurrentCounter) == uint64(len(m.CurrentMock.expectationSeries))
   195  	}
   196  
   197  	// if main expectation was set then invocations count should be greater than zero
   198  	if m.CurrentMock.mainExpectation != nil {
   199  		return atomic.LoadUint64(&m.CurrentCounter) > 0
   200  	}
   201  
   202  	// if func was set then invocations count should be greater than zero
   203  	if m.CurrentFunc != nil {
   204  		return atomic.LoadUint64(&m.CurrentCounter) > 0
   205  	}
   206  
   207  	return true
   208  }
   209  
   210  type mpulseStoragePmMockLock struct {
   211  	mock              *pulseStoragePmMock
   212  	mainExpectation   *pulseStoragePmMockLockExpectation
   213  	expectationSeries []*pulseStoragePmMockLockExpectation
   214  }
   215  
   216  type pulseStoragePmMockLockExpectation struct {
   217  }
   218  
   219  //Expect specifies that invocation of pulseStoragePm.Lock is expected from 1 to Infinity times
   220  func (m *mpulseStoragePmMockLock) Expect() *mpulseStoragePmMockLock {
   221  	m.mock.LockFunc = nil
   222  	m.expectationSeries = nil
   223  
   224  	if m.mainExpectation == nil {
   225  		m.mainExpectation = &pulseStoragePmMockLockExpectation{}
   226  	}
   227  
   228  	return m
   229  }
   230  
   231  //Return specifies results of invocation of pulseStoragePm.Lock
   232  func (m *mpulseStoragePmMockLock) Return() *pulseStoragePmMock {
   233  	m.mock.LockFunc = nil
   234  	m.expectationSeries = nil
   235  
   236  	if m.mainExpectation == nil {
   237  		m.mainExpectation = &pulseStoragePmMockLockExpectation{}
   238  	}
   239  
   240  	return m.mock
   241  }
   242  
   243  //ExpectOnce specifies that invocation of pulseStoragePm.Lock is expected once
   244  func (m *mpulseStoragePmMockLock) ExpectOnce() *pulseStoragePmMockLockExpectation {
   245  	m.mock.LockFunc = nil
   246  	m.mainExpectation = nil
   247  
   248  	expectation := &pulseStoragePmMockLockExpectation{}
   249  
   250  	m.expectationSeries = append(m.expectationSeries, expectation)
   251  	return expectation
   252  }
   253  
   254  //Set uses given function f as a mock of pulseStoragePm.Lock method
   255  func (m *mpulseStoragePmMockLock) Set(f func()) *pulseStoragePmMock {
   256  	m.mainExpectation = nil
   257  	m.expectationSeries = nil
   258  
   259  	m.mock.LockFunc = f
   260  	return m.mock
   261  }
   262  
   263  //Lock implements github.com/insolar/insolar/ledger/pulsemanager.pulseStoragePm interface
   264  func (m *pulseStoragePmMock) Lock() {
   265  	counter := atomic.AddUint64(&m.LockPreCounter, 1)
   266  	defer atomic.AddUint64(&m.LockCounter, 1)
   267  
   268  	if len(m.LockMock.expectationSeries) > 0 {
   269  		if counter > uint64(len(m.LockMock.expectationSeries)) {
   270  			m.t.Fatalf("Unexpected call to pulseStoragePmMock.Lock.")
   271  			return
   272  		}
   273  
   274  		return
   275  	}
   276  
   277  	if m.LockMock.mainExpectation != nil {
   278  
   279  		return
   280  	}
   281  
   282  	if m.LockFunc == nil {
   283  		m.t.Fatalf("Unexpected call to pulseStoragePmMock.Lock.")
   284  		return
   285  	}
   286  
   287  	m.LockFunc()
   288  }
   289  
   290  //LockMinimockCounter returns a count of pulseStoragePmMock.LockFunc invocations
   291  func (m *pulseStoragePmMock) LockMinimockCounter() uint64 {
   292  	return atomic.LoadUint64(&m.LockCounter)
   293  }
   294  
   295  //LockMinimockPreCounter returns the value of pulseStoragePmMock.Lock invocations
   296  func (m *pulseStoragePmMock) LockMinimockPreCounter() uint64 {
   297  	return atomic.LoadUint64(&m.LockPreCounter)
   298  }
   299  
   300  //LockFinished returns true if mock invocations count is ok
   301  func (m *pulseStoragePmMock) LockFinished() bool {
   302  	// if expectation series were set then invocations count should be equal to expectations count
   303  	if len(m.LockMock.expectationSeries) > 0 {
   304  		return atomic.LoadUint64(&m.LockCounter) == uint64(len(m.LockMock.expectationSeries))
   305  	}
   306  
   307  	// if main expectation was set then invocations count should be greater than zero
   308  	if m.LockMock.mainExpectation != nil {
   309  		return atomic.LoadUint64(&m.LockCounter) > 0
   310  	}
   311  
   312  	// if func was set then invocations count should be greater than zero
   313  	if m.LockFunc != nil {
   314  		return atomic.LoadUint64(&m.LockCounter) > 0
   315  	}
   316  
   317  	return true
   318  }
   319  
   320  type mpulseStoragePmMockSet struct {
   321  	mock              *pulseStoragePmMock
   322  	mainExpectation   *pulseStoragePmMockSetExpectation
   323  	expectationSeries []*pulseStoragePmMockSetExpectation
   324  }
   325  
   326  type pulseStoragePmMockSetExpectation struct {
   327  	input *pulseStoragePmMockSetInput
   328  }
   329  
   330  type pulseStoragePmMockSetInput struct {
   331  	p *core.Pulse
   332  }
   333  
   334  //Expect specifies that invocation of pulseStoragePm.Set is expected from 1 to Infinity times
   335  func (m *mpulseStoragePmMockSet) Expect(p *core.Pulse) *mpulseStoragePmMockSet {
   336  	m.mock.SetFunc = nil
   337  	m.expectationSeries = nil
   338  
   339  	if m.mainExpectation == nil {
   340  		m.mainExpectation = &pulseStoragePmMockSetExpectation{}
   341  	}
   342  	m.mainExpectation.input = &pulseStoragePmMockSetInput{p}
   343  	return m
   344  }
   345  
   346  //Return specifies results of invocation of pulseStoragePm.Set
   347  func (m *mpulseStoragePmMockSet) Return() *pulseStoragePmMock {
   348  	m.mock.SetFunc = nil
   349  	m.expectationSeries = nil
   350  
   351  	if m.mainExpectation == nil {
   352  		m.mainExpectation = &pulseStoragePmMockSetExpectation{}
   353  	}
   354  
   355  	return m.mock
   356  }
   357  
   358  //ExpectOnce specifies that invocation of pulseStoragePm.Set is expected once
   359  func (m *mpulseStoragePmMockSet) ExpectOnce(p *core.Pulse) *pulseStoragePmMockSetExpectation {
   360  	m.mock.SetFunc = nil
   361  	m.mainExpectation = nil
   362  
   363  	expectation := &pulseStoragePmMockSetExpectation{}
   364  	expectation.input = &pulseStoragePmMockSetInput{p}
   365  	m.expectationSeries = append(m.expectationSeries, expectation)
   366  	return expectation
   367  }
   368  
   369  //Set uses given function f as a mock of pulseStoragePm.Set method
   370  func (m *mpulseStoragePmMockSet) Set(f func(p *core.Pulse)) *pulseStoragePmMock {
   371  	m.mainExpectation = nil
   372  	m.expectationSeries = nil
   373  
   374  	m.mock.SetFunc = f
   375  	return m.mock
   376  }
   377  
   378  //Set implements github.com/insolar/insolar/ledger/pulsemanager.pulseStoragePm interface
   379  func (m *pulseStoragePmMock) Set(p *core.Pulse) {
   380  	counter := atomic.AddUint64(&m.SetPreCounter, 1)
   381  	defer atomic.AddUint64(&m.SetCounter, 1)
   382  
   383  	if len(m.SetMock.expectationSeries) > 0 {
   384  		if counter > uint64(len(m.SetMock.expectationSeries)) {
   385  			m.t.Fatalf("Unexpected call to pulseStoragePmMock.Set. %v", p)
   386  			return
   387  		}
   388  
   389  		input := m.SetMock.expectationSeries[counter-1].input
   390  		testify_assert.Equal(m.t, *input, pulseStoragePmMockSetInput{p}, "pulseStoragePm.Set got unexpected parameters")
   391  
   392  		return
   393  	}
   394  
   395  	if m.SetMock.mainExpectation != nil {
   396  
   397  		input := m.SetMock.mainExpectation.input
   398  		if input != nil {
   399  			testify_assert.Equal(m.t, *input, pulseStoragePmMockSetInput{p}, "pulseStoragePm.Set got unexpected parameters")
   400  		}
   401  
   402  		return
   403  	}
   404  
   405  	if m.SetFunc == nil {
   406  		m.t.Fatalf("Unexpected call to pulseStoragePmMock.Set. %v", p)
   407  		return
   408  	}
   409  
   410  	m.SetFunc(p)
   411  }
   412  
   413  //SetMinimockCounter returns a count of pulseStoragePmMock.SetFunc invocations
   414  func (m *pulseStoragePmMock) SetMinimockCounter() uint64 {
   415  	return atomic.LoadUint64(&m.SetCounter)
   416  }
   417  
   418  //SetMinimockPreCounter returns the value of pulseStoragePmMock.Set invocations
   419  func (m *pulseStoragePmMock) SetMinimockPreCounter() uint64 {
   420  	return atomic.LoadUint64(&m.SetPreCounter)
   421  }
   422  
   423  //SetFinished returns true if mock invocations count is ok
   424  func (m *pulseStoragePmMock) SetFinished() bool {
   425  	// if expectation series were set then invocations count should be equal to expectations count
   426  	if len(m.SetMock.expectationSeries) > 0 {
   427  		return atomic.LoadUint64(&m.SetCounter) == uint64(len(m.SetMock.expectationSeries))
   428  	}
   429  
   430  	// if main expectation was set then invocations count should be greater than zero
   431  	if m.SetMock.mainExpectation != nil {
   432  		return atomic.LoadUint64(&m.SetCounter) > 0
   433  	}
   434  
   435  	// if func was set then invocations count should be greater than zero
   436  	if m.SetFunc != nil {
   437  		return atomic.LoadUint64(&m.SetCounter) > 0
   438  	}
   439  
   440  	return true
   441  }
   442  
   443  type mpulseStoragePmMockUnlock struct {
   444  	mock              *pulseStoragePmMock
   445  	mainExpectation   *pulseStoragePmMockUnlockExpectation
   446  	expectationSeries []*pulseStoragePmMockUnlockExpectation
   447  }
   448  
   449  type pulseStoragePmMockUnlockExpectation struct {
   450  }
   451  
   452  //Expect specifies that invocation of pulseStoragePm.Unlock is expected from 1 to Infinity times
   453  func (m *mpulseStoragePmMockUnlock) Expect() *mpulseStoragePmMockUnlock {
   454  	m.mock.UnlockFunc = nil
   455  	m.expectationSeries = nil
   456  
   457  	if m.mainExpectation == nil {
   458  		m.mainExpectation = &pulseStoragePmMockUnlockExpectation{}
   459  	}
   460  
   461  	return m
   462  }
   463  
   464  //Return specifies results of invocation of pulseStoragePm.Unlock
   465  func (m *mpulseStoragePmMockUnlock) Return() *pulseStoragePmMock {
   466  	m.mock.UnlockFunc = nil
   467  	m.expectationSeries = nil
   468  
   469  	if m.mainExpectation == nil {
   470  		m.mainExpectation = &pulseStoragePmMockUnlockExpectation{}
   471  	}
   472  
   473  	return m.mock
   474  }
   475  
   476  //ExpectOnce specifies that invocation of pulseStoragePm.Unlock is expected once
   477  func (m *mpulseStoragePmMockUnlock) ExpectOnce() *pulseStoragePmMockUnlockExpectation {
   478  	m.mock.UnlockFunc = nil
   479  	m.mainExpectation = nil
   480  
   481  	expectation := &pulseStoragePmMockUnlockExpectation{}
   482  
   483  	m.expectationSeries = append(m.expectationSeries, expectation)
   484  	return expectation
   485  }
   486  
   487  //Set uses given function f as a mock of pulseStoragePm.Unlock method
   488  func (m *mpulseStoragePmMockUnlock) Set(f func()) *pulseStoragePmMock {
   489  	m.mainExpectation = nil
   490  	m.expectationSeries = nil
   491  
   492  	m.mock.UnlockFunc = f
   493  	return m.mock
   494  }
   495  
   496  //Unlock implements github.com/insolar/insolar/ledger/pulsemanager.pulseStoragePm interface
   497  func (m *pulseStoragePmMock) Unlock() {
   498  	counter := atomic.AddUint64(&m.UnlockPreCounter, 1)
   499  	defer atomic.AddUint64(&m.UnlockCounter, 1)
   500  
   501  	if len(m.UnlockMock.expectationSeries) > 0 {
   502  		if counter > uint64(len(m.UnlockMock.expectationSeries)) {
   503  			m.t.Fatalf("Unexpected call to pulseStoragePmMock.Unlock.")
   504  			return
   505  		}
   506  
   507  		return
   508  	}
   509  
   510  	if m.UnlockMock.mainExpectation != nil {
   511  
   512  		return
   513  	}
   514  
   515  	if m.UnlockFunc == nil {
   516  		m.t.Fatalf("Unexpected call to pulseStoragePmMock.Unlock.")
   517  		return
   518  	}
   519  
   520  	m.UnlockFunc()
   521  }
   522  
   523  //UnlockMinimockCounter returns a count of pulseStoragePmMock.UnlockFunc invocations
   524  func (m *pulseStoragePmMock) UnlockMinimockCounter() uint64 {
   525  	return atomic.LoadUint64(&m.UnlockCounter)
   526  }
   527  
   528  //UnlockMinimockPreCounter returns the value of pulseStoragePmMock.Unlock invocations
   529  func (m *pulseStoragePmMock) UnlockMinimockPreCounter() uint64 {
   530  	return atomic.LoadUint64(&m.UnlockPreCounter)
   531  }
   532  
   533  //UnlockFinished returns true if mock invocations count is ok
   534  func (m *pulseStoragePmMock) UnlockFinished() bool {
   535  	// if expectation series were set then invocations count should be equal to expectations count
   536  	if len(m.UnlockMock.expectationSeries) > 0 {
   537  		return atomic.LoadUint64(&m.UnlockCounter) == uint64(len(m.UnlockMock.expectationSeries))
   538  	}
   539  
   540  	// if main expectation was set then invocations count should be greater than zero
   541  	if m.UnlockMock.mainExpectation != nil {
   542  		return atomic.LoadUint64(&m.UnlockCounter) > 0
   543  	}
   544  
   545  	// if func was set then invocations count should be greater than zero
   546  	if m.UnlockFunc != nil {
   547  		return atomic.LoadUint64(&m.UnlockCounter) > 0
   548  	}
   549  
   550  	return true
   551  }
   552  
   553  //ValidateCallCounters checks that all mocked methods of the interface have been called at least once
   554  //Deprecated: please use MinimockFinish method or use Finish method of minimock.Controller
   555  func (m *pulseStoragePmMock) ValidateCallCounters() {
   556  
   557  	if !m.CurrentFinished() {
   558  		m.t.Fatal("Expected call to pulseStoragePmMock.Current")
   559  	}
   560  
   561  	if !m.LockFinished() {
   562  		m.t.Fatal("Expected call to pulseStoragePmMock.Lock")
   563  	}
   564  
   565  	if !m.SetFinished() {
   566  		m.t.Fatal("Expected call to pulseStoragePmMock.Set")
   567  	}
   568  
   569  	if !m.UnlockFinished() {
   570  		m.t.Fatal("Expected call to pulseStoragePmMock.Unlock")
   571  	}
   572  
   573  }
   574  
   575  //CheckMocksCalled checks that all mocked methods of the interface have been called at least once
   576  //Deprecated: please use MinimockFinish method or use Finish method of minimock.Controller
   577  func (m *pulseStoragePmMock) CheckMocksCalled() {
   578  	m.Finish()
   579  }
   580  
   581  //Finish checks that all mocked methods of the interface have been called at least once
   582  //Deprecated: please use MinimockFinish or use Finish method of minimock.Controller
   583  func (m *pulseStoragePmMock) Finish() {
   584  	m.MinimockFinish()
   585  }
   586  
   587  //MinimockFinish checks that all mocked methods of the interface have been called at least once
   588  func (m *pulseStoragePmMock) MinimockFinish() {
   589  
   590  	if !m.CurrentFinished() {
   591  		m.t.Fatal("Expected call to pulseStoragePmMock.Current")
   592  	}
   593  
   594  	if !m.LockFinished() {
   595  		m.t.Fatal("Expected call to pulseStoragePmMock.Lock")
   596  	}
   597  
   598  	if !m.SetFinished() {
   599  		m.t.Fatal("Expected call to pulseStoragePmMock.Set")
   600  	}
   601  
   602  	if !m.UnlockFinished() {
   603  		m.t.Fatal("Expected call to pulseStoragePmMock.Unlock")
   604  	}
   605  
   606  }
   607  
   608  //Wait waits for all mocked methods to be called at least once
   609  //Deprecated: please use MinimockWait or use Wait method of minimock.Controller
   610  func (m *pulseStoragePmMock) Wait(timeout time.Duration) {
   611  	m.MinimockWait(timeout)
   612  }
   613  
   614  //MinimockWait waits for all mocked methods to be called at least once
   615  //this method is called by minimock.Controller
   616  func (m *pulseStoragePmMock) MinimockWait(timeout time.Duration) {
   617  	timeoutCh := time.After(timeout)
   618  	for {
   619  		ok := true
   620  		ok = ok && m.CurrentFinished()
   621  		ok = ok && m.LockFinished()
   622  		ok = ok && m.SetFinished()
   623  		ok = ok && m.UnlockFinished()
   624  
   625  		if ok {
   626  			return
   627  		}
   628  
   629  		select {
   630  		case <-timeoutCh:
   631  
   632  			if !m.CurrentFinished() {
   633  				m.t.Error("Expected call to pulseStoragePmMock.Current")
   634  			}
   635  
   636  			if !m.LockFinished() {
   637  				m.t.Error("Expected call to pulseStoragePmMock.Lock")
   638  			}
   639  
   640  			if !m.SetFinished() {
   641  				m.t.Error("Expected call to pulseStoragePmMock.Set")
   642  			}
   643  
   644  			if !m.UnlockFinished() {
   645  				m.t.Error("Expected call to pulseStoragePmMock.Unlock")
   646  			}
   647  
   648  			m.t.Fatalf("Some mocks were not called on time: %s", timeout)
   649  			return
   650  		default:
   651  			time.Sleep(time.Millisecond)
   652  		}
   653  	}
   654  }
   655  
   656  //AllMocksCalled returns true if all mocked methods were called before the execution of AllMocksCalled,
   657  //it can be used with assert/require, i.e. assert.True(mock.AllMocksCalled())
   658  func (m *pulseStoragePmMock) AllMocksCalled() bool {
   659  
   660  	if !m.CurrentFinished() {
   661  		return false
   662  	}
   663  
   664  	if !m.LockFinished() {
   665  		return false
   666  	}
   667  
   668  	if !m.SetFinished() {
   669  		return false
   670  	}
   671  
   672  	if !m.UnlockFinished() {
   673  		return false
   674  	}
   675  
   676  	return true
   677  }