func (self *Mock) On(methodName string, arguments ...interface{}) *Call {
	for _, arg := range arguments {
		if v := reflect.ValueOf(arg); v.Kind() == reflect.Func {
			panic(fmt.Sprintf("cannot use Func in expectations. Use mock.AnythingOfType(\"%T\")", arg))
		}
	}
	self.mutex.Lock()
	defer self.mutex.Unlock()
	c := newCall(self, methodName, arguments...)
	self.ExpectedCalls = append(self.ExpectedCalls, c)
	return c
}
/*
Setting expectations

On starts a description of an expectation of the specified method
being called.

Mock.On("MyMethod", arg1, arg2)
package mock
import (
	"fmt"
	"reflect"
	"regexp"
	"runtime"
	"strings"
	"sync"
	"time"
	"github.com/stretchr/objx"
	"github.com/stretchr/testify/assert"
)
type TestingT interface {
	Logf(format string, args ...interface{})
	Errorf(format string, args ...interface{})
}
type Call struct {
	Parent *Mock
	Method string
	Arguments Arguments
	ReturnArguments Arguments
	Repeatability int
	WaitFor <-chan time.Time
	RunFn func(Arguments)
}
func newCall(parent *Mock, methodName string, methodArguments ...interface{}) *Call {
	return &Call{
		Parent:          parent,
		Method:          methodName,
		Arguments:       methodArguments,
		ReturnArguments: make([]interface{}, 0),
		Repeatability:   0,
		WaitFor:         nil,
		RunFn:           nil,
	}
}
func (self *Call) lock() {
	self.Parent.mutex.Lock()
}
func (self *Call) unlock() {
	self.Parent.mutex.Unlock()
}
func (self *Call) Return(returnArguments ...interface{}) *Call {
	self.lock()
	defer self.unlock()
	self.ReturnArguments = returnArguments
	return self
}
func (self *Call) Once() *Call {
	return self.Times(1)
}
func (self *Call) Twice() *Call {
	return self.Times(2)
}
func (self *Call) Times(i int) *Call {
	self.lock()
	defer self.unlock()
	self.Repeatability = i
	return self
}
func (self *Call) WaitUntil(w <-chan time.Time) *Call {
	self.lock()
	defer self.unlock()
	self.WaitFor = w
	return self
}
func (self *Call) After(d time.Duration) *Call {
	return self.WaitUntil(time.After(d))
}
func (self *Call) Run(fn func(Arguments)) *Call {
	self.lock()
	defer self.unlock()
	self.RunFn = fn
	return self
}
func (self *Call) On(methodName string, arguments ...interface{}) *Call {
	return self.Parent.On(methodName, arguments...)
}
type Mock struct {
	ExpectedCalls []*Call
	Calls []Call
	testData objx.Map
	mutex sync.Mutex
}
func (m *Mock) TestData() objx.Map {
	if m.testData == nil {
		m.testData = make(objx.Map)
	}
	return m.testData
}