github.com/cloudfoundry-attic/ltc@v0.0.0-20151123212628-098adc7919fc/ssh/mocks/fake_client_dialer.go (about)

     1  // This file was generated by counterfeiter
     2  package mocks
     3  
     4  import (
     5  	"sync"
     6  
     7  	config_package "github.com/cloudfoundry-incubator/ltc/config"
     8  	"github.com/cloudfoundry-incubator/ltc/ssh"
     9  )
    10  
    11  type FakeClientDialer struct {
    12  	DialStub        func(appName string, instanceIndex int, config *config_package.Config) (ssh.Client, error)
    13  	dialMutex       sync.RWMutex
    14  	dialArgsForCall []struct {
    15  		appName       string
    16  		instanceIndex int
    17  		config        *config_package.Config
    18  	}
    19  	dialReturns struct {
    20  		result1 ssh.Client
    21  		result2 error
    22  	}
    23  }
    24  
    25  func (fake *FakeClientDialer) Dial(appName string, instanceIndex int, config *config_package.Config) (ssh.Client, error) {
    26  	fake.dialMutex.Lock()
    27  	fake.dialArgsForCall = append(fake.dialArgsForCall, struct {
    28  		appName       string
    29  		instanceIndex int
    30  		config        *config_package.Config
    31  	}{appName, instanceIndex, config})
    32  	fake.dialMutex.Unlock()
    33  	if fake.DialStub != nil {
    34  		return fake.DialStub(appName, instanceIndex, config)
    35  	} else {
    36  		return fake.dialReturns.result1, fake.dialReturns.result2
    37  	}
    38  }
    39  
    40  func (fake *FakeClientDialer) DialCallCount() int {
    41  	fake.dialMutex.RLock()
    42  	defer fake.dialMutex.RUnlock()
    43  	return len(fake.dialArgsForCall)
    44  }
    45  
    46  func (fake *FakeClientDialer) DialArgsForCall(i int) (string, int, *config_package.Config) {
    47  	fake.dialMutex.RLock()
    48  	defer fake.dialMutex.RUnlock()
    49  	return fake.dialArgsForCall[i].appName, fake.dialArgsForCall[i].instanceIndex, fake.dialArgsForCall[i].config
    50  }
    51  
    52  func (fake *FakeClientDialer) DialReturns(result1 ssh.Client, result2 error) {
    53  	fake.DialStub = nil
    54  	fake.dialReturns = struct {
    55  		result1 ssh.Client
    56  		result2 error
    57  	}{result1, result2}
    58  }
    59  
    60  var _ ssh.ClientDialer = new(FakeClientDialer)