github.com/liamawhite/cli-with-i18n@v6.32.1-0.20171122084555-dede0a5c3448+incompatible/command/v3/v3fakes/fake_remove_network_policy_actor.go (about)

     1  // Code generated by counterfeiter. DO NOT EDIT.
     2  package v3fakes
     3  
     4  import (
     5  	"sync"
     6  
     7  	"github.com/liamawhite/cli-with-i18n/actor/cfnetworkingaction"
     8  	"github.com/liamawhite/cli-with-i18n/command/v3"
     9  )
    10  
    11  type FakeRemoveNetworkPolicyActor struct {
    12  	RemoveNetworkPolicyStub        func(spaceGUID string, srcAppName string, destAppName string, protocol string, startPort int, endPort int) (cfnetworkingaction.Warnings, error)
    13  	removeNetworkPolicyMutex       sync.RWMutex
    14  	removeNetworkPolicyArgsForCall []struct {
    15  		spaceGUID   string
    16  		srcAppName  string
    17  		destAppName string
    18  		protocol    string
    19  		startPort   int
    20  		endPort     int
    21  	}
    22  	removeNetworkPolicyReturns struct {
    23  		result1 cfnetworkingaction.Warnings
    24  		result2 error
    25  	}
    26  	removeNetworkPolicyReturnsOnCall map[int]struct {
    27  		result1 cfnetworkingaction.Warnings
    28  		result2 error
    29  	}
    30  	invocations      map[string][][]interface{}
    31  	invocationsMutex sync.RWMutex
    32  }
    33  
    34  func (fake *FakeRemoveNetworkPolicyActor) RemoveNetworkPolicy(spaceGUID string, srcAppName string, destAppName string, protocol string, startPort int, endPort int) (cfnetworkingaction.Warnings, error) {
    35  	fake.removeNetworkPolicyMutex.Lock()
    36  	ret, specificReturn := fake.removeNetworkPolicyReturnsOnCall[len(fake.removeNetworkPolicyArgsForCall)]
    37  	fake.removeNetworkPolicyArgsForCall = append(fake.removeNetworkPolicyArgsForCall, struct {
    38  		spaceGUID   string
    39  		srcAppName  string
    40  		destAppName string
    41  		protocol    string
    42  		startPort   int
    43  		endPort     int
    44  	}{spaceGUID, srcAppName, destAppName, protocol, startPort, endPort})
    45  	fake.recordInvocation("RemoveNetworkPolicy", []interface{}{spaceGUID, srcAppName, destAppName, protocol, startPort, endPort})
    46  	fake.removeNetworkPolicyMutex.Unlock()
    47  	if fake.RemoveNetworkPolicyStub != nil {
    48  		return fake.RemoveNetworkPolicyStub(spaceGUID, srcAppName, destAppName, protocol, startPort, endPort)
    49  	}
    50  	if specificReturn {
    51  		return ret.result1, ret.result2
    52  	}
    53  	return fake.removeNetworkPolicyReturns.result1, fake.removeNetworkPolicyReturns.result2
    54  }
    55  
    56  func (fake *FakeRemoveNetworkPolicyActor) RemoveNetworkPolicyCallCount() int {
    57  	fake.removeNetworkPolicyMutex.RLock()
    58  	defer fake.removeNetworkPolicyMutex.RUnlock()
    59  	return len(fake.removeNetworkPolicyArgsForCall)
    60  }
    61  
    62  func (fake *FakeRemoveNetworkPolicyActor) RemoveNetworkPolicyArgsForCall(i int) (string, string, string, string, int, int) {
    63  	fake.removeNetworkPolicyMutex.RLock()
    64  	defer fake.removeNetworkPolicyMutex.RUnlock()
    65  	return fake.removeNetworkPolicyArgsForCall[i].spaceGUID, fake.removeNetworkPolicyArgsForCall[i].srcAppName, fake.removeNetworkPolicyArgsForCall[i].destAppName, fake.removeNetworkPolicyArgsForCall[i].protocol, fake.removeNetworkPolicyArgsForCall[i].startPort, fake.removeNetworkPolicyArgsForCall[i].endPort
    66  }
    67  
    68  func (fake *FakeRemoveNetworkPolicyActor) RemoveNetworkPolicyReturns(result1 cfnetworkingaction.Warnings, result2 error) {
    69  	fake.RemoveNetworkPolicyStub = nil
    70  	fake.removeNetworkPolicyReturns = struct {
    71  		result1 cfnetworkingaction.Warnings
    72  		result2 error
    73  	}{result1, result2}
    74  }
    75  
    76  func (fake *FakeRemoveNetworkPolicyActor) RemoveNetworkPolicyReturnsOnCall(i int, result1 cfnetworkingaction.Warnings, result2 error) {
    77  	fake.RemoveNetworkPolicyStub = nil
    78  	if fake.removeNetworkPolicyReturnsOnCall == nil {
    79  		fake.removeNetworkPolicyReturnsOnCall = make(map[int]struct {
    80  			result1 cfnetworkingaction.Warnings
    81  			result2 error
    82  		})
    83  	}
    84  	fake.removeNetworkPolicyReturnsOnCall[i] = struct {
    85  		result1 cfnetworkingaction.Warnings
    86  		result2 error
    87  	}{result1, result2}
    88  }
    89  
    90  func (fake *FakeRemoveNetworkPolicyActor) Invocations() map[string][][]interface{} {
    91  	fake.invocationsMutex.RLock()
    92  	defer fake.invocationsMutex.RUnlock()
    93  	fake.removeNetworkPolicyMutex.RLock()
    94  	defer fake.removeNetworkPolicyMutex.RUnlock()
    95  	copiedInvocations := map[string][][]interface{}{}
    96  	for key, value := range fake.invocations {
    97  		copiedInvocations[key] = value
    98  	}
    99  	return copiedInvocations
   100  }
   101  
   102  func (fake *FakeRemoveNetworkPolicyActor) recordInvocation(key string, args []interface{}) {
   103  	fake.invocationsMutex.Lock()
   104  	defer fake.invocationsMutex.Unlock()
   105  	if fake.invocations == nil {
   106  		fake.invocations = map[string][][]interface{}{}
   107  	}
   108  	if fake.invocations[key] == nil {
   109  		fake.invocations[key] = [][]interface{}{}
   110  	}
   111  	fake.invocations[key] = append(fake.invocations[key], args)
   112  }
   113  
   114  var _ v3.RemoveNetworkPolicyActor = new(FakeRemoveNetworkPolicyActor)