github.com/loggregator/cli@v6.33.1-0.20180224010324-82334f081791+incompatible/cf/net/netfakes/fake_warning_producer.go (about)

     1  // This file was generated by counterfeiter
     2  package netfakes
     3  
     4  import (
     5  	"sync"
     6  
     7  	"code.cloudfoundry.org/cli/cf/net"
     8  )
     9  
    10  type FakeWarningProducer struct {
    11  	WarningsStub        func() []string
    12  	warningsMutex       sync.RWMutex
    13  	warningsArgsForCall []struct{}
    14  	warningsReturns     struct {
    15  		result1 []string
    16  	}
    17  	invocations      map[string][][]interface{}
    18  	invocationsMutex sync.RWMutex
    19  }
    20  
    21  func (fake *FakeWarningProducer) Warnings() []string {
    22  	fake.warningsMutex.Lock()
    23  	fake.warningsArgsForCall = append(fake.warningsArgsForCall, struct{}{})
    24  	fake.recordInvocation("Warnings", []interface{}{})
    25  	fake.warningsMutex.Unlock()
    26  	if fake.WarningsStub != nil {
    27  		return fake.WarningsStub()
    28  	} else {
    29  		return fake.warningsReturns.result1
    30  	}
    31  }
    32  
    33  func (fake *FakeWarningProducer) WarningsCallCount() int {
    34  	fake.warningsMutex.RLock()
    35  	defer fake.warningsMutex.RUnlock()
    36  	return len(fake.warningsArgsForCall)
    37  }
    38  
    39  func (fake *FakeWarningProducer) WarningsReturns(result1 []string) {
    40  	fake.WarningsStub = nil
    41  	fake.warningsReturns = struct {
    42  		result1 []string
    43  	}{result1}
    44  }
    45  
    46  func (fake *FakeWarningProducer) Invocations() map[string][][]interface{} {
    47  	fake.invocationsMutex.RLock()
    48  	defer fake.invocationsMutex.RUnlock()
    49  	fake.warningsMutex.RLock()
    50  	defer fake.warningsMutex.RUnlock()
    51  	return fake.invocations
    52  }
    53  
    54  func (fake *FakeWarningProducer) recordInvocation(key string, args []interface{}) {
    55  	fake.invocationsMutex.Lock()
    56  	defer fake.invocationsMutex.Unlock()
    57  	if fake.invocations == nil {
    58  		fake.invocations = map[string][][]interface{}{}
    59  	}
    60  	if fake.invocations[key] == nil {
    61  		fake.invocations[key] = [][]interface{}{}
    62  	}
    63  	fake.invocations[key] = append(fake.invocations[key], args)
    64  }
    65  
    66  var _ net.WarningProducer = new(FakeWarningProducer)