func mockoutGetAllUsers(keys []*datastore.Key, users []UserDao.UserDTO, err error) *TestHelper.Spy { spy := new(TestHelper.Spy) userDao_GetAllUsers = func(ctx appengine.Context) ([]*datastore.Key, []UserDao.UserDTO, error) { spy.RegisterCall() spy.RegisterArg1(ctx) return keys, users, err } return spy }
func mockoutUserHasActiveSubscription(isActive []bool, err []error) *TestHelper.Spy { spy := new(TestHelper.Spy) transactionDao_UserHasActiveSubscription = func(ctx appengine.Context, userKey *datastore.Key) (bool, error) { spy.RegisterCall() spy.RegisterArg1(ctx) spy.RegisterArg1(userKey) _isActive := isActive[0] _err := err[0] if len(isActive) > 1 { isActive = isActive[1:] } if len(err) > 1 { err = err[1:] } return _isActive, _err } return spy }