github.com/bitrise-io/go-steputils/v2@v2.0.0-alpha.30/cache/compression/archive_dependency_checker_mock.go (about)

     1  // Code generated by moq; DO NOT EDIT.
     2  // github.com/matryer/moq
     3  
     4  package compression
     5  
     6  import (
     7  	"sync"
     8  )
     9  
    10  // Ensure, that ArchiveDependencyCheckerMock does implement ArchiveDependencyChecker.
    11  // If this is not the case, regenerate this file with moq.
    12  var _ ArchiveDependencyChecker = &ArchiveDependencyCheckerMock{}
    13  
    14  // ArchiveDependencyCheckerMock is a mock implementation of ArchiveDependencyChecker.
    15  //
    16  //	func TestSomethingThatUsesArchiveDependencyChecker(t *testing.T) {
    17  //
    18  //		// make and configure a mocked ArchiveDependencyChecker
    19  //		mockedArchiveDependencyChecker := &ArchiveDependencyCheckerMock{
    20  //			CheckDependenciesFunc: func() bool {
    21  //				panic("mock out the CheckDependencies method")
    22  //			},
    23  //		}
    24  //
    25  //		// use mockedArchiveDependencyChecker in code that requires ArchiveDependencyChecker
    26  //		// and then make assertions.
    27  //
    28  //	}
    29  type ArchiveDependencyCheckerMock struct {
    30  	// CheckDependenciesFunc mocks the CheckDependencies method.
    31  	CheckDependenciesFunc func() bool
    32  
    33  	// calls tracks calls to the methods.
    34  	calls struct {
    35  		// CheckDependencies holds details about calls to the CheckDependencies method.
    36  		CheckDependencies []struct {
    37  		}
    38  	}
    39  	lockCheckDependencies sync.RWMutex
    40  }
    41  
    42  // CheckDependencies calls CheckDependenciesFunc.
    43  func (mock *ArchiveDependencyCheckerMock) CheckDependencies() bool {
    44  	callInfo := struct {
    45  	}{}
    46  	mock.lockCheckDependencies.Lock()
    47  	mock.calls.CheckDependencies = append(mock.calls.CheckDependencies, callInfo)
    48  	mock.lockCheckDependencies.Unlock()
    49  	if mock.CheckDependenciesFunc == nil {
    50  		var (
    51  			bOut bool
    52  		)
    53  		return bOut
    54  	}
    55  	return mock.CheckDependenciesFunc()
    56  }
    57  
    58  // CheckDependenciesCalls gets all the calls that were made to CheckDependencies.
    59  // Check the length with:
    60  //
    61  //	len(mockedArchiveDependencyChecker.CheckDependenciesCalls())
    62  func (mock *ArchiveDependencyCheckerMock) CheckDependenciesCalls() []struct {
    63  } {
    64  	var calls []struct {
    65  	}
    66  	mock.lockCheckDependencies.RLock()
    67  	calls = mock.calls.CheckDependencies
    68  	mock.lockCheckDependencies.RUnlock()
    69  	return calls
    70  }