2022-04-21 15:25:43 +00:00
|
|
|
// Code generated by moq; DO NOT EDIT.
|
|
|
|
// github.com/matryer/moq
|
|
|
|
|
|
|
|
package constraints
|
|
|
|
|
|
|
|
import (
|
|
|
|
"sync"
|
|
|
|
)
|
|
|
|
|
|
|
|
// Ensure, that ConstraintMock does implement Constraint.
|
|
|
|
// If this is not the case, regenerate this file with moq.
|
|
|
|
var _ Constraint = &ConstraintMock{}
|
|
|
|
|
|
|
|
// ConstraintMock is a mock implementation of Constraint.
|
|
|
|
//
|
2023-04-25 09:26:55 +00:00
|
|
|
// func TestSomethingThatUsesConstraint(t *testing.T) {
|
2022-04-21 15:25:43 +00:00
|
|
|
//
|
2023-04-25 09:26:55 +00:00
|
|
|
// // make and configure a mocked Constraint
|
|
|
|
// mockedConstraint := &ConstraintMock{
|
|
|
|
// AssertFunc: func() error {
|
|
|
|
// panic("mock out the Assert method")
|
|
|
|
// },
|
|
|
|
// StringFunc: func() string {
|
|
|
|
// panic("mock out the String method")
|
|
|
|
// },
|
|
|
|
// }
|
2022-04-21 15:25:43 +00:00
|
|
|
//
|
2023-04-25 09:26:55 +00:00
|
|
|
// // use mockedConstraint in code that requires Constraint
|
|
|
|
// // and then make assertions.
|
2022-04-21 15:25:43 +00:00
|
|
|
//
|
2023-04-25 09:26:55 +00:00
|
|
|
// }
|
2022-04-21 15:25:43 +00:00
|
|
|
type ConstraintMock struct {
|
|
|
|
// AssertFunc mocks the Assert method.
|
|
|
|
AssertFunc func() error
|
|
|
|
|
|
|
|
// StringFunc mocks the String method.
|
|
|
|
StringFunc func() string
|
|
|
|
|
|
|
|
// calls tracks calls to the methods.
|
|
|
|
calls struct {
|
|
|
|
// Assert holds details about calls to the Assert method.
|
|
|
|
Assert []struct {
|
|
|
|
}
|
|
|
|
// String holds details about calls to the String method.
|
|
|
|
String []struct {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
lockAssert sync.RWMutex
|
|
|
|
lockString sync.RWMutex
|
|
|
|
}
|
|
|
|
|
|
|
|
// Assert calls AssertFunc.
|
|
|
|
func (mock *ConstraintMock) Assert() error {
|
|
|
|
callInfo := struct {
|
|
|
|
}{}
|
|
|
|
mock.lockAssert.Lock()
|
|
|
|
mock.calls.Assert = append(mock.calls.Assert, callInfo)
|
|
|
|
mock.lockAssert.Unlock()
|
|
|
|
if mock.AssertFunc == nil {
|
|
|
|
var (
|
|
|
|
errOut error
|
|
|
|
)
|
|
|
|
return errOut
|
|
|
|
}
|
|
|
|
return mock.AssertFunc()
|
|
|
|
}
|
|
|
|
|
|
|
|
// AssertCalls gets all the calls that were made to Assert.
|
|
|
|
// Check the length with:
|
2023-04-25 09:26:55 +00:00
|
|
|
//
|
|
|
|
// len(mockedConstraint.AssertCalls())
|
2022-04-21 15:25:43 +00:00
|
|
|
func (mock *ConstraintMock) AssertCalls() []struct {
|
|
|
|
} {
|
|
|
|
var calls []struct {
|
|
|
|
}
|
|
|
|
mock.lockAssert.RLock()
|
|
|
|
calls = mock.calls.Assert
|
|
|
|
mock.lockAssert.RUnlock()
|
|
|
|
return calls
|
|
|
|
}
|
|
|
|
|
|
|
|
// String calls StringFunc.
|
|
|
|
func (mock *ConstraintMock) String() string {
|
|
|
|
callInfo := struct {
|
|
|
|
}{}
|
|
|
|
mock.lockString.Lock()
|
|
|
|
mock.calls.String = append(mock.calls.String, callInfo)
|
|
|
|
mock.lockString.Unlock()
|
|
|
|
if mock.StringFunc == nil {
|
|
|
|
var (
|
|
|
|
sOut string
|
|
|
|
)
|
|
|
|
return sOut
|
|
|
|
}
|
|
|
|
return mock.StringFunc()
|
|
|
|
}
|
|
|
|
|
|
|
|
// StringCalls gets all the calls that were made to String.
|
|
|
|
// Check the length with:
|
2023-04-25 09:26:55 +00:00
|
|
|
//
|
|
|
|
// len(mockedConstraint.StringCalls())
|
2022-04-21 15:25:43 +00:00
|
|
|
func (mock *ConstraintMock) StringCalls() []struct {
|
|
|
|
} {
|
|
|
|
var calls []struct {
|
|
|
|
}
|
|
|
|
mock.lockString.RLock()
|
|
|
|
calls = mock.calls.String
|
|
|
|
mock.lockString.RUnlock()
|
|
|
|
return calls
|
|
|
|
}
|