github.com/cloudfoundry-incubator/stembuild@v0.0.0-20211223202937-5b61d62226c6/commandparser/commandparserfakes/fake_vm_construct.go (about)

     1  // Code generated by counterfeiter. DO NOT EDIT.
     2  package commandparserfakes
     3  
     4  import (
     5  	"sync"
     6  
     7  	"github.com/cloudfoundry-incubator/stembuild/commandparser"
     8  )
     9  
    10  type FakeVmConstruct struct {
    11  	PrepareVMStub        func() error
    12  	prepareVMMutex       sync.RWMutex
    13  	prepareVMArgsForCall []struct {
    14  	}
    15  	prepareVMReturns struct {
    16  		result1 error
    17  	}
    18  	prepareVMReturnsOnCall map[int]struct {
    19  		result1 error
    20  	}
    21  	invocations      map[string][][]interface{}
    22  	invocationsMutex sync.RWMutex
    23  }
    24  
    25  func (fake *FakeVmConstruct) PrepareVM() error {
    26  	fake.prepareVMMutex.Lock()
    27  	ret, specificReturn := fake.prepareVMReturnsOnCall[len(fake.prepareVMArgsForCall)]
    28  	fake.prepareVMArgsForCall = append(fake.prepareVMArgsForCall, struct {
    29  	}{})
    30  	fake.recordInvocation("PrepareVM", []interface{}{})
    31  	fake.prepareVMMutex.Unlock()
    32  	if fake.PrepareVMStub != nil {
    33  		return fake.PrepareVMStub()
    34  	}
    35  	if specificReturn {
    36  		return ret.result1
    37  	}
    38  	fakeReturns := fake.prepareVMReturns
    39  	return fakeReturns.result1
    40  }
    41  
    42  func (fake *FakeVmConstruct) PrepareVMCallCount() int {
    43  	fake.prepareVMMutex.RLock()
    44  	defer fake.prepareVMMutex.RUnlock()
    45  	return len(fake.prepareVMArgsForCall)
    46  }
    47  
    48  func (fake *FakeVmConstruct) PrepareVMCalls(stub func() error) {
    49  	fake.prepareVMMutex.Lock()
    50  	defer fake.prepareVMMutex.Unlock()
    51  	fake.PrepareVMStub = stub
    52  }
    53  
    54  func (fake *FakeVmConstruct) PrepareVMReturns(result1 error) {
    55  	fake.prepareVMMutex.Lock()
    56  	defer fake.prepareVMMutex.Unlock()
    57  	fake.PrepareVMStub = nil
    58  	fake.prepareVMReturns = struct {
    59  		result1 error
    60  	}{result1}
    61  }
    62  
    63  func (fake *FakeVmConstruct) PrepareVMReturnsOnCall(i int, result1 error) {
    64  	fake.prepareVMMutex.Lock()
    65  	defer fake.prepareVMMutex.Unlock()
    66  	fake.PrepareVMStub = nil
    67  	if fake.prepareVMReturnsOnCall == nil {
    68  		fake.prepareVMReturnsOnCall = make(map[int]struct {
    69  			result1 error
    70  		})
    71  	}
    72  	fake.prepareVMReturnsOnCall[i] = struct {
    73  		result1 error
    74  	}{result1}
    75  }
    76  
    77  func (fake *FakeVmConstruct) Invocations() map[string][][]interface{} {
    78  	fake.invocationsMutex.RLock()
    79  	defer fake.invocationsMutex.RUnlock()
    80  	fake.prepareVMMutex.RLock()
    81  	defer fake.prepareVMMutex.RUnlock()
    82  	copiedInvocations := map[string][][]interface{}{}
    83  	for key, value := range fake.invocations {
    84  		copiedInvocations[key] = value
    85  	}
    86  	return copiedInvocations
    87  }
    88  
    89  func (fake *FakeVmConstruct) recordInvocation(key string, args []interface{}) {
    90  	fake.invocationsMutex.Lock()
    91  	defer fake.invocationsMutex.Unlock()
    92  	if fake.invocations == nil {
    93  		fake.invocations = map[string][][]interface{}{}
    94  	}
    95  	if fake.invocations[key] == nil {
    96  		fake.invocations[key] = [][]interface{}{}
    97  	}
    98  	fake.invocations[key] = append(fake.invocations[key], args)
    99  }
   100  
   101  var _ commandparser.VmConstruct = new(FakeVmConstruct)