github.com/cloudfoundry-attic/ltc@v0.0.0-20151123212628-098adc7919fc/ssh/mocks/fake_session_factory.go (about) 1 // This file was generated by counterfeiter 2 package mocks 3 4 import ( 5 "sync" 6 7 "github.com/cloudfoundry-incubator/ltc/ssh" 8 ) 9 10 type FakeSessionFactory struct { 11 NewStub func(client ssh.Client, width, height int, desirePTY bool) (ssh.Session, error) 12 newMutex sync.RWMutex 13 newArgsForCall []struct { 14 client ssh.Client 15 width int 16 height int 17 desirePTY bool 18 } 19 newReturns struct { 20 result1 ssh.Session 21 result2 error 22 } 23 } 24 25 func (fake *FakeSessionFactory) New(client ssh.Client, width int, height int, desirePTY bool) (ssh.Session, error) { 26 fake.newMutex.Lock() 27 fake.newArgsForCall = append(fake.newArgsForCall, struct { 28 client ssh.Client 29 width int 30 height int 31 desirePTY bool 32 }{client, width, height, desirePTY}) 33 fake.newMutex.Unlock() 34 if fake.NewStub != nil { 35 return fake.NewStub(client, width, height, desirePTY) 36 } else { 37 return fake.newReturns.result1, fake.newReturns.result2 38 } 39 } 40 41 func (fake *FakeSessionFactory) NewCallCount() int { 42 fake.newMutex.RLock() 43 defer fake.newMutex.RUnlock() 44 return len(fake.newArgsForCall) 45 } 46 47 func (fake *FakeSessionFactory) NewArgsForCall(i int) (ssh.Client, int, int, bool) { 48 fake.newMutex.RLock() 49 defer fake.newMutex.RUnlock() 50 return fake.newArgsForCall[i].client, fake.newArgsForCall[i].width, fake.newArgsForCall[i].height, fake.newArgsForCall[i].desirePTY 51 } 52 53 func (fake *FakeSessionFactory) NewReturns(result1 ssh.Session, result2 error) { 54 fake.NewStub = nil 55 fake.newReturns = struct { 56 result1 ssh.Session 57 result2 error 58 }{result1, result2} 59 } 60 61 var _ ssh.SessionFactory = new(FakeSessionFactory)