package services_test

import (
	"context"
	"database/sql"
	"time"

	"github.com/myshkin5/effective-octo-garbanzo/persistence"
	"github.com/myshkin5/effective-octo-garbanzo/persistence/data"
	"github.com/satori/go.uuid"
)

type mockGarbanzoStore struct {
	FetchByOctoNameCalled chan bool
	FetchByOctoNameInput  struct {
		Ctx      chan context.Context
		Database chan persistence.Database
		OctoName chan string
	}
	FetchByOctoNameOutput struct {
		Garbanzos chan []data.Garbanzo
		Err       chan error
	}
	FetchByAPIUUIDAndOctoNameCalled chan bool
	FetchByAPIUUIDAndOctoNameInput  struct {
		Ctx      chan context.Context
		Database chan persistence.Database
		ApiUUID  chan uuid.UUID
		OctoName chan string
	}
	FetchByAPIUUIDAndOctoNameOutput struct {
		Garbanzo chan data.Garbanzo
		Err      chan error
	}
	CreateCalled chan bool
	CreateInput  struct {
		Ctx      chan context.Context
		Database chan persistence.Database
		Garbanzo chan data.Garbanzo
	}
	CreateOutput struct {
		GarbanzoId chan int
		Err        chan error
	}
	DeleteByAPIUUIDAndOctoNameCalled chan bool
	DeleteByAPIUUIDAndOctoNameInput  struct {
		Ctx      chan context.Context
		Database chan persistence.Database
		ApiUUID  chan uuid.UUID
		OctoName chan string
	}
	DeleteByAPIUUIDAndOctoNameOutput struct {
		Err chan error
	}
	DeleteByOctoIdCalled chan bool
	DeleteByOctoIdInput  struct {
		Ctx      chan context.Context
		Database chan persistence.Database
		OctoId   chan int
	}
	DeleteByOctoIdOutput struct {
		Err chan error
	}
}

func newMockGarbanzoStore() *mockGarbanzoStore {
	m := &mockGarbanzoStore{}
	m.FetchByOctoNameCalled = make(chan bool, 100)
	m.FetchByOctoNameInput.Ctx = make(chan context.Context, 100)
	m.FetchByOctoNameInput.Database = make(chan persistence.Database, 100)
	m.FetchByOctoNameInput.OctoName = make(chan string, 100)
	m.FetchByOctoNameOutput.Garbanzos = make(chan []data.Garbanzo, 100)
	m.FetchByOctoNameOutput.Err = make(chan error, 100)
	m.FetchByAPIUUIDAndOctoNameCalled = make(chan bool, 100)
	m.FetchByAPIUUIDAndOctoNameInput.Ctx = make(chan context.Context, 100)
	m.FetchByAPIUUIDAndOctoNameInput.Database = make(chan persistence.Database, 100)
	m.FetchByAPIUUIDAndOctoNameInput.ApiUUID = make(chan uuid.UUID, 100)
	m.FetchByAPIUUIDAndOctoNameInput.OctoName = make(chan string, 100)
	m.FetchByAPIUUIDAndOctoNameOutput.Garbanzo = make(chan data.Garbanzo, 100)
	m.FetchByAPIUUIDAndOctoNameOutput.Err = make(chan error, 100)
	m.CreateCalled = make(chan bool, 100)
	m.CreateInput.Ctx = make(chan context.Context, 100)
	m.CreateInput.Database = make(chan persistence.Database, 100)
	m.CreateInput.Garbanzo = make(chan data.Garbanzo, 100)
	m.CreateOutput.GarbanzoId = make(chan int, 100)
	m.CreateOutput.Err = make(chan error, 100)
	m.DeleteByAPIUUIDAndOctoNameCalled = make(chan bool, 100)
	m.DeleteByAPIUUIDAndOctoNameInput.Ctx = make(chan context.Context, 100)
	m.DeleteByAPIUUIDAndOctoNameInput.Database = make(chan persistence.Database, 100)
	m.DeleteByAPIUUIDAndOctoNameInput.ApiUUID = make(chan uuid.UUID, 100)
	m.DeleteByAPIUUIDAndOctoNameInput.OctoName = make(chan string, 100)
	m.DeleteByAPIUUIDAndOctoNameOutput.Err = make(chan error, 100)
	m.DeleteByOctoIdCalled = make(chan bool, 100)
	m.DeleteByOctoIdInput.Ctx = make(chan context.Context, 100)
	m.DeleteByOctoIdInput.Database = make(chan persistence.Database, 100)
	m.DeleteByOctoIdInput.OctoId = make(chan int, 100)
	m.DeleteByOctoIdOutput.Err = make(chan error, 100)
	return m
}
func (m *mockGarbanzoStore) FetchByOctoName(ctx context.Context, database persistence.Database, octoName string) (garbanzos []data.Garbanzo, err error) {
	m.FetchByOctoNameCalled <- true
	m.FetchByOctoNameInput.Ctx <- ctx
	m.FetchByOctoNameInput.Database <- database
	m.FetchByOctoNameInput.OctoName <- octoName
	return <-m.FetchByOctoNameOutput.Garbanzos, <-m.FetchByOctoNameOutput.Err
}
func (m *mockGarbanzoStore) FetchByAPIUUIDAndOctoName(ctx context.Context, database persistence.Database, apiUUID uuid.UUID, octoName string) (garbanzo data.Garbanzo, err error) {
	m.FetchByAPIUUIDAndOctoNameCalled <- true
	m.FetchByAPIUUIDAndOctoNameInput.Ctx <- ctx
	m.FetchByAPIUUIDAndOctoNameInput.Database <- database
	m.FetchByAPIUUIDAndOctoNameInput.ApiUUID <- apiUUID
	m.FetchByAPIUUIDAndOctoNameInput.OctoName <- octoName
	return <-m.FetchByAPIUUIDAndOctoNameOutput.Garbanzo, <-m.FetchByAPIUUIDAndOctoNameOutput.Err
}
func (m *mockGarbanzoStore) Create(ctx context.Context, database persistence.Database, garbanzo data.Garbanzo) (garbanzoId int, err error) {
	m.CreateCalled <- true
	m.CreateInput.Ctx <- ctx
	m.CreateInput.Database <- database
	m.CreateInput.Garbanzo <- garbanzo
	return <-m.CreateOutput.GarbanzoId, <-m.CreateOutput.Err
}
func (m *mockGarbanzoStore) DeleteByAPIUUIDAndOctoName(ctx context.Context, database persistence.Database, apiUUID uuid.UUID, octoName string) (err error) {
	m.DeleteByAPIUUIDAndOctoNameCalled <- true
	m.DeleteByAPIUUIDAndOctoNameInput.Ctx <- ctx
	m.DeleteByAPIUUIDAndOctoNameInput.Database <- database
	m.DeleteByAPIUUIDAndOctoNameInput.ApiUUID <- apiUUID
	m.DeleteByAPIUUIDAndOctoNameInput.OctoName <- octoName
	return <-m.DeleteByAPIUUIDAndOctoNameOutput.Err
}
func (m *mockGarbanzoStore) DeleteByOctoId(ctx context.Context, database persistence.Database, octoId int) (err error) {
	m.DeleteByOctoIdCalled <- true
	m.DeleteByOctoIdInput.Ctx <- ctx
	m.DeleteByOctoIdInput.Database <- database
	m.DeleteByOctoIdInput.OctoId <- octoId
	return <-m.DeleteByOctoIdOutput.Err
}

type mockOctoStore struct {
	FetchAllCalled chan bool
	FetchAllInput  struct {
		Ctx      chan context.Context
		Database chan persistence.Database
	}
	FetchAllOutput struct {
		Octos chan []data.Octo
		Err   chan error
	}
	FetchByNameCalled chan bool
	FetchByNameInput  struct {
		Ctx             chan context.Context
		Database        chan persistence.Database
		Name            chan string
		SelectForUpdate chan bool
	}
	FetchByNameOutput struct {
		Octo chan data.Octo
		Err  chan error
	}
	CreateCalled chan bool
	CreateInput  struct {
		Ctx      chan context.Context
		Database chan persistence.Database
		Octo     chan data.Octo
	}
	CreateOutput struct {
		OctoId chan int
		Err    chan error
	}
	DeleteByIdCalled chan bool
	DeleteByIdInput  struct {
		Ctx      chan context.Context
		Database chan persistence.Database
		Id       chan int
	}
	DeleteByIdOutput struct {
		Err chan error
	}
}

func newMockOctoStore() *mockOctoStore {
	m := &mockOctoStore{}
	m.FetchAllCalled = make(chan bool, 100)
	m.FetchAllInput.Ctx = make(chan context.Context, 100)
	m.FetchAllInput.Database = make(chan persistence.Database, 100)
	m.FetchAllOutput.Octos = make(chan []data.Octo, 100)
	m.FetchAllOutput.Err = make(chan error, 100)
	m.FetchByNameCalled = make(chan bool, 100)
	m.FetchByNameInput.Ctx = make(chan context.Context, 100)
	m.FetchByNameInput.Database = make(chan persistence.Database, 100)
	m.FetchByNameInput.Name = make(chan string, 100)
	m.FetchByNameInput.SelectForUpdate = make(chan bool, 100)
	m.FetchByNameOutput.Octo = make(chan data.Octo, 100)
	m.FetchByNameOutput.Err = make(chan error, 100)
	m.CreateCalled = make(chan bool, 100)
	m.CreateInput.Ctx = make(chan context.Context, 100)
	m.CreateInput.Database = make(chan persistence.Database, 100)
	m.CreateInput.Octo = make(chan data.Octo, 100)
	m.CreateOutput.OctoId = make(chan int, 100)
	m.CreateOutput.Err = make(chan error, 100)
	m.DeleteByIdCalled = make(chan bool, 100)
	m.DeleteByIdInput.Ctx = make(chan context.Context, 100)
	m.DeleteByIdInput.Database = make(chan persistence.Database, 100)
	m.DeleteByIdInput.Id = make(chan int, 100)
	m.DeleteByIdOutput.Err = make(chan error, 100)
	return m
}
func (m *mockOctoStore) FetchAll(ctx context.Context, database persistence.Database) (octos []data.Octo, err error) {
	m.FetchAllCalled <- true
	m.FetchAllInput.Ctx <- ctx
	m.FetchAllInput.Database <- database
	return <-m.FetchAllOutput.Octos, <-m.FetchAllOutput.Err
}
func (m *mockOctoStore) FetchByName(ctx context.Context, database persistence.Database, name string, selectForUpdate bool) (octo data.Octo, err error) {
	m.FetchByNameCalled <- true
	m.FetchByNameInput.Ctx <- ctx
	m.FetchByNameInput.Database <- database
	m.FetchByNameInput.Name <- name
	m.FetchByNameInput.SelectForUpdate <- selectForUpdate
	return <-m.FetchByNameOutput.Octo, <-m.FetchByNameOutput.Err
}
func (m *mockOctoStore) Create(ctx context.Context, database persistence.Database, octo data.Octo) (octoId int, err error) {
	m.CreateCalled <- true
	m.CreateInput.Ctx <- ctx
	m.CreateInput.Database <- database
	m.CreateInput.Octo <- octo
	return <-m.CreateOutput.OctoId, <-m.CreateOutput.Err
}
func (m *mockOctoStore) DeleteById(ctx context.Context, database persistence.Database, id int) (err error) {
	m.DeleteByIdCalled <- true
	m.DeleteByIdInput.Ctx <- ctx
	m.DeleteByIdInput.Database <- database
	m.DeleteByIdInput.Id <- id
	return <-m.DeleteByIdOutput.Err
}

type mockDatabase struct {
	ExecCalled chan bool
	ExecInput  struct {
		Ctx   chan context.Context
		Query chan string
		Args  chan []interface{}
	}
	ExecOutput struct {
		Result chan sql.Result
		Err    chan error
	}
	QueryCalled chan bool
	QueryInput  struct {
		Ctx   chan context.Context
		Query chan string
		Args  chan []interface{}
	}
	QueryOutput struct {
		Rows chan *sql.Rows
		Err  chan error
	}
	QueryRowCalled chan bool
	QueryRowInput  struct {
		Ctx   chan context.Context
		Query chan string
		Args  chan []interface{}
	}
	QueryRowOutput struct {
		Row chan *sql.Row
	}
	BeginTxCalled chan bool
	BeginTxInput  struct {
		Ctx chan context.Context
	}
	BeginTxOutput struct {
		Database chan persistence.Database
		Err      chan error
	}
	CommitCalled chan bool
	CommitOutput struct {
		Err chan error
	}
	RollbackCalled chan bool
	RollbackOutput struct {
		Err chan error
	}
}

func newMockDatabase() *mockDatabase {
	m := &mockDatabase{}
	m.ExecCalled = make(chan bool, 100)
	m.ExecInput.Ctx = make(chan context.Context, 100)
	m.ExecInput.Query = make(chan string, 100)
	m.ExecInput.Args = make(chan []interface{}, 100)
	m.ExecOutput.Result = make(chan sql.Result, 100)
	m.ExecOutput.Err = make(chan error, 100)
	m.QueryCalled = make(chan bool, 100)
	m.QueryInput.Ctx = make(chan context.Context, 100)
	m.QueryInput.Query = make(chan string, 100)
	m.QueryInput.Args = make(chan []interface{}, 100)
	m.QueryOutput.Rows = make(chan *sql.Rows, 100)
	m.QueryOutput.Err = make(chan error, 100)
	m.QueryRowCalled = make(chan bool, 100)
	m.QueryRowInput.Ctx = make(chan context.Context, 100)
	m.QueryRowInput.Query = make(chan string, 100)
	m.QueryRowInput.Args = make(chan []interface{}, 100)
	m.QueryRowOutput.Row = make(chan *sql.Row, 100)
	m.BeginTxCalled = make(chan bool, 100)
	m.BeginTxInput.Ctx = make(chan context.Context, 100)
	m.BeginTxOutput.Database = make(chan persistence.Database, 100)
	m.BeginTxOutput.Err = make(chan error, 100)
	m.CommitCalled = make(chan bool, 100)
	m.CommitOutput.Err = make(chan error, 100)
	m.RollbackCalled = make(chan bool, 100)
	m.RollbackOutput.Err = make(chan error, 100)
	return m
}
func (m *mockDatabase) Exec(ctx context.Context, query string, args ...interface{}) (result sql.Result, err error) {
	m.ExecCalled <- true
	m.ExecInput.Ctx <- ctx
	m.ExecInput.Query <- query
	m.ExecInput.Args <- args
	return <-m.ExecOutput.Result, <-m.ExecOutput.Err
}
func (m *mockDatabase) Query(ctx context.Context, query string, args ...interface{}) (rows *sql.Rows, err error) {
	m.QueryCalled <- true
	m.QueryInput.Ctx <- ctx
	m.QueryInput.Query <- query
	m.QueryInput.Args <- args
	return <-m.QueryOutput.Rows, <-m.QueryOutput.Err
}
func (m *mockDatabase) QueryRow(ctx context.Context, query string, args ...interface{}) (row *sql.Row) {
	m.QueryRowCalled <- true
	m.QueryRowInput.Ctx <- ctx
	m.QueryRowInput.Query <- query
	m.QueryRowInput.Args <- args
	return <-m.QueryRowOutput.Row
}
func (m *mockDatabase) BeginTx(ctx context.Context) (database persistence.Database, err error) {
	m.BeginTxCalled <- true
	m.BeginTxInput.Ctx <- ctx
	return <-m.BeginTxOutput.Database, <-m.BeginTxOutput.Err
}
func (m *mockDatabase) Commit() (err error) {
	m.CommitCalled <- true
	return <-m.CommitOutput.Err
}
func (m *mockDatabase) Rollback() (err error) {
	m.RollbackCalled <- true
	return <-m.RollbackOutput.Err
}

type mockContext struct {
	DeadlineCalled chan bool
	DeadlineOutput struct {
		Deadline chan time.Time
		Ok       chan bool
	}
	DoneCalled chan bool
	DoneOutput struct {
		Ret0 chan (<-chan struct{})
	}
	ErrCalled chan bool
	ErrOutput struct {
		Ret0 chan error
	}
	ValueCalled chan bool
	ValueInput  struct {
		Key chan interface{}
	}
	ValueOutput struct {
		Ret0 chan interface{}
	}
}

func newMockContext() *mockContext {
	m := &mockContext{}
	m.DeadlineCalled = make(chan bool, 100)
	m.DeadlineOutput.Deadline = make(chan time.Time, 100)
	m.DeadlineOutput.Ok = make(chan bool, 100)
	m.DoneCalled = make(chan bool, 100)
	m.DoneOutput.Ret0 = make(chan (<-chan struct{}), 100)
	m.ErrCalled = make(chan bool, 100)
	m.ErrOutput.Ret0 = make(chan error, 100)
	m.ValueCalled = make(chan bool, 100)
	m.ValueInput.Key = make(chan interface{}, 100)
	m.ValueOutput.Ret0 = make(chan interface{}, 100)
	return m
}
func (m *mockContext) Deadline() (deadline time.Time, ok bool) {
	m.DeadlineCalled <- true
	return <-m.DeadlineOutput.Deadline, <-m.DeadlineOutput.Ok
}
func (m *mockContext) Done() <-chan struct{} {
	m.DoneCalled <- true
	return <-m.DoneOutput.Ret0
}
func (m *mockContext) Err() error {
	m.ErrCalled <- true
	return <-m.ErrOutput.Ret0
}
func (m *mockContext) Value(key interface{}) interface{} {
	m.ValueCalled <- true
	m.ValueInput.Key <- key
	return <-m.ValueOutput.Ret0
}
// This file was generated by github.com/nelsam/hel.  Do not
// edit this code by hand unless you *really* know what you're
// doing.  Expect any changes made manually to be overwritten
// the next time hel regenerates this file.

package services_test

import (
	"context"
	"database/sql"
	"time"

	"github.com/myshkin5/effective-octo-garbanzo/persistence"
	"github.com/myshkin5/effective-octo-garbanzo/persistence/data"
	"github.com/satori/go.uuid"
)

type mockGarbanzoStore struct {
	FetchByOctoNameCalled chan bool
	FetchByOctoNameInput  struct {
		Ctx      chan context.Context
		Database chan persistence.Database
		OctoName chan string
	}
	FetchByOctoNameOutput struct {
		Garbanzos chan []data.Garbanzo
		Err       chan error
	}
	FetchByAPIUUIDAndOctoNameCalled chan bool
	FetchByAPIUUIDAndOctoNameInput  struct {
		Ctx      chan context.Context
		Database chan persistence.Database
		ApiUUID  chan uuid.UUID
		OctoName chan string
	}
	FetchByAPIUUIDAndOctoNameOutput struct {
		Garbanzo chan data.Garbanzo
		Err      chan error
	}
	CreateCalled chan bool
	CreateInput  struct {
		Ctx      chan context.Context
		Database chan persistence.Database
		Garbanzo chan data.Garbanzo
	}
	CreateOutput struct {
		GarbanzoId chan int
		Err        chan error
	}
	DeleteByAPIUUIDAndOctoNameCalled chan bool
	DeleteByAPIUUIDAndOctoNameInput  struct {
		Ctx      chan context.Context
		Database chan persistence.Database
		ApiUUID  chan uuid.UUID
		OctoName chan string
	}
	DeleteByAPIUUIDAndOctoNameOutput struct {
		Err chan error
	}
	DeleteByOctoIdCalled chan bool
	DeleteByOctoIdInput  struct {
		Ctx      chan context.Context
		Database chan persistence.Database
		OctoId   chan int
	}
	DeleteByOctoIdOutput struct {
		Err chan error
	}
}

func newMockGarbanzoStore() *mockGarbanzoStore {
	m := &mockGarbanzoStore{}
	m.FetchByOctoNameCalled = make(chan bool, 100)
	m.FetchByOctoNameInput.Ctx = make(chan context.Context, 100)
	m.FetchByOctoNameInput.Database = make(chan persistence.Database, 100)
	m.FetchByOctoNameInput.OctoName = make(chan string, 100)
	m.FetchByOctoNameOutput.Garbanzos = make(chan []data.Garbanzo, 100)
	m.FetchByOctoNameOutput.Err = make(chan error, 100)
	m.FetchByAPIUUIDAndOctoNameCalled = make(chan bool, 100)
	m.FetchByAPIUUIDAndOctoNameInput.Ctx = make(chan context.Context, 100)
	m.FetchByAPIUUIDAndOctoNameInput.Database = make(chan persistence.Database, 100)
	m.FetchByAPIUUIDAndOctoNameInput.ApiUUID = make(chan uuid.UUID, 100)
	m.FetchByAPIUUIDAndOctoNameInput.OctoName = make(chan string, 100)
	m.FetchByAPIUUIDAndOctoNameOutput.Garbanzo = make(chan data.Garbanzo, 100)
	m.FetchByAPIUUIDAndOctoNameOutput.Err = make(chan error, 100)
	m.CreateCalled = make(chan bool, 100)
	m.CreateInput.Ctx = make(chan context.Context, 100)
	m.CreateInput.Database = make(chan persistence.Database, 100)
	m.CreateInput.Garbanzo = make(chan data.Garbanzo, 100)
	m.CreateOutput.GarbanzoId = make(chan int, 100)
	m.CreateOutput.Err = make(chan error, 100)
	m.DeleteByAPIUUIDAndOctoNameCalled = make(chan bool, 100)
	m.DeleteByAPIUUIDAndOctoNameInput.Ctx = make(chan context.Context, 100)
	m.DeleteByAPIUUIDAndOctoNameInput.Database = make(chan persistence.Database, 100)
	m.DeleteByAPIUUIDAndOctoNameInput.ApiUUID = make(chan uuid.UUID, 100)
	m.DeleteByAPIUUIDAndOctoNameInput.OctoName = make(chan string, 100)
	m.DeleteByAPIUUIDAndOctoNameOutput.Err = make(chan error, 100)
	m.DeleteByOctoIdCalled = make(chan bool, 100)
	m.DeleteByOctoIdInput.Ctx = make(chan context.Context, 100)
	m.DeleteByOctoIdInput.Database = make(chan persistence.Database, 100)
	m.DeleteByOctoIdInput.OctoId = make(chan int, 100)
	m.DeleteByOctoIdOutput.Err = make(chan error, 100)
	return m
}
func (m *mockGarbanzoStore) FetchByOctoName(ctx context.Context, database persistence.Database, octoName string) (garbanzos []data.Garbanzo, err error) {
	m.FetchByOctoNameCalled <- true
	m.FetchByOctoNameInput.Ctx <- ctx
	m.FetchByOctoNameInput.Database <- database
	m.FetchByOctoNameInput.OctoName <- octoName
	return <-m.FetchByOctoNameOutput.Garbanzos, <-m.FetchByOctoNameOutput.Err
}
func (m *mockGarbanzoStore) FetchByAPIUUIDAndOctoName(ctx context.Context, database persistence.Database, apiUUID uuid.UUID, octoName string) (garbanzo data.Garbanzo, err error) {
	m.FetchByAPIUUIDAndOctoNameCalled <- true
	m.FetchByAPIUUIDAndOctoNameInput.Ctx <- ctx
	m.FetchByAPIUUIDAndOctoNameInput.Database <- database
	m.FetchByAPIUUIDAndOctoNameInput.ApiUUID <- apiUUID
	m.FetchByAPIUUIDAndOctoNameInput.OctoName <- octoName
	return <-m.FetchByAPIUUIDAndOctoNameOutput.Garbanzo, <-m.FetchByAPIUUIDAndOctoNameOutput.Err
}
func (m *mockGarbanzoStore) Create(ctx context.Context, database persistence.Database, garbanzo data.Garbanzo) (garbanzoId int, err error) {
	m.CreateCalled <- true
	m.CreateInput.Ctx <- ctx
	m.CreateInput.Database <- database
	m.CreateInput.Garbanzo <- garbanzo
	return <-m.CreateOutput.GarbanzoId, <-m.CreateOutput.Err
}
func (m *mockGarbanzoStore) DeleteByAPIUUIDAndOctoName(ctx context.Context, database persistence.Database, apiUUID uuid.UUID, octoName string) (err error) {
	m.DeleteByAPIUUIDAndOctoNameCalled <- true
	m.DeleteByAPIUUIDAndOctoNameInput.Ctx <- ctx
	m.DeleteByAPIUUIDAndOctoNameInput.Database <- database
	m.DeleteByAPIUUIDAndOctoNameInput.ApiUUID <- apiUUID
	m.DeleteByAPIUUIDAndOctoNameInput.OctoName <- octoName
	return <-m.DeleteByAPIUUIDAndOctoNameOutput.Err
}
func (m *mockGarbanzoStore) DeleteByOctoId(ctx context.Context, database persistence.Database, octoId int) (err error) {
	m.DeleteByOctoIdCalled <- true
	m.DeleteByOctoIdInput.Ctx <- ctx
	m.DeleteByOctoIdInput.Database <- database
	m.DeleteByOctoIdInput.OctoId <- octoId
	return <-m.DeleteByOctoIdOutput.Err
}

type mockOctoStore struct {
	FetchAllCalled chan bool
	FetchAllInput  struct {
		Ctx      chan context.Context
		Database chan persistence.Database
	}
	FetchAllOutput struct {
		Octos chan []data.Octo
		Err   chan error
	}
	FetchByNameCalled chan bool
	FetchByNameInput  struct {
		Ctx             chan context.Context
		Database        chan persistence.Database
		Name            chan string
		SelectForUpdate chan bool
	}
	FetchByNameOutput struct {
		Octo chan data.Octo
		Err  chan error
	}
	CreateCalled chan bool
	CreateInput  struct {
		Ctx      chan context.Context
		Database chan persistence.Database
		Octo     chan data.Octo
	}
	CreateOutput struct {
		OctoId chan int
		Err    chan error
	}
	DeleteByIdCalled chan bool
	DeleteByIdInput  struct {
		Ctx      chan context.Context
		Database chan persistence.Database
		Id       chan int
	}
	DeleteByIdOutput struct {
		Err chan error
	}
}

func newMockOctoStore() *mockOctoStore {
	m := &mockOctoStore{}
	m.FetchAllCalled = make(chan bool, 100)
	m.FetchAllInput.Ctx = make(chan context.Context, 100)
	m.FetchAllInput.Database = make(chan persistence.Database, 100)
	m.FetchAllOutput.Octos = make(chan []data.Octo, 100)
	m.FetchAllOutput.Err = make(chan error, 100)
	m.FetchByNameCalled = make(chan bool, 100)
	m.FetchByNameInput.Ctx = make(chan context.Context, 100)
	m.FetchByNameInput.Database = make(chan persistence.Database, 100)
	m.FetchByNameInput.Name = make(chan string, 100)
	m.FetchByNameInput.SelectForUpdate = make(chan bool, 100)
	m.FetchByNameOutput.Octo = make(chan data.Octo, 100)
	m.FetchByNameOutput.Err = make(chan error, 100)
	m.CreateCalled = make(chan bool, 100)
	m.CreateInput.Ctx = make(chan context.Context, 100)
	m.CreateInput.Database = make(chan persistence.Database, 100)
	m.CreateInput.Octo = make(chan data.Octo, 100)
	m.CreateOutput.OctoId = make(chan int, 100)
	m.CreateOutput.Err = make(chan error, 100)
	m.DeleteByIdCalled = make(chan bool, 100)
	m.DeleteByIdInput.Ctx = make(chan context.Context, 100)
	m.DeleteByIdInput.Database = make(chan persistence.Database, 100)
	m.DeleteByIdInput.Id = make(chan int, 100)
	m.DeleteByIdOutput.Err = make(chan error, 100)
	return m
}
func (m *mockOctoStore) FetchAll(ctx context.Context, database persistence.Database) (octos []data.Octo, err error) {
	m.FetchAllCalled <- true
	m.FetchAllInput.Ctx <- ctx
	m.FetchAllInput.Database <- database
	return <-m.FetchAllOutput.Octos, <-m.FetchAllOutput.Err
}
func (m *mockOctoStore) FetchByName(ctx context.Context, database persistence.Database, name string, selectForUpdate bool) (octo data.Octo, err error) {
	m.FetchByNameCalled <- true
	m.FetchByNameInput.Ctx <- ctx
	m.FetchByNameInput.Database <- database
	m.FetchByNameInput.Name <- name
	m.FetchByNameInput.SelectForUpdate <- selectForUpdate
	return <-m.FetchByNameOutput.Octo, <-m.FetchByNameOutput.Err
}
func (m *mockOctoStore) Create(ctx context.Context, database persistence.Database, octo data.Octo) (octoId int, err error) {
	m.CreateCalled <- true
	m.CreateInput.Ctx <- ctx
	m.CreateInput.Database <- database
	m.CreateInput.Octo <- octo
	return <-m.CreateOutput.OctoId, <-m.CreateOutput.Err
}
func (m *mockOctoStore) DeleteById(ctx context.Context, database persistence.Database, id int) (err error) {
	m.DeleteByIdCalled <- true
	m.DeleteByIdInput.Ctx <- ctx
	m.DeleteByIdInput.Database <- database
	m.DeleteByIdInput.Id <- id
	return <-m.DeleteByIdOutput.Err
}

type mockDatabase struct {
	ExecCalled chan bool
	ExecInput  struct {
		Ctx   chan context.Context
		Query chan string
		Args  chan []interface{}
	}
	ExecOutput struct {
		Result chan sql.Result
		Err    chan error
	}
	QueryCalled chan bool
	QueryInput  struct {
		Ctx   chan context.Context
		Query chan string
		Args  chan []interface{}
	}
	QueryOutput struct {
		Rows chan *sql.Rows
		Err  chan error
	}
	QueryRowCalled chan bool
	QueryRowInput  struct {
		Ctx   chan context.Context
		Query chan string
		Args  chan []interface{}
	}
	QueryRowOutput struct {
		Row chan *sql.Row
	}
	BeginTxCalled chan bool
	BeginTxInput  struct {
		Ctx chan context.Context
	}
	BeginTxOutput struct {
		Database chan persistence.Database
		Err      chan error
	}
	CommitCalled chan bool
	CommitOutput struct {
		Err chan error
	}
	RollbackCalled chan bool
	RollbackOutput struct {
		Err chan error
	}
}

func newMockDatabase() *mockDatabase {
	m := &mockDatabase{}
	m.ExecCalled = make(chan bool, 100)
	m.ExecInput.Ctx = make(chan context.Context, 100)
	m.ExecInput.Query = make(chan string, 100)
	m.ExecInput.Args = make(chan []interface{}, 100)
	m.ExecOutput.Result = make(chan sql.Result, 100)
	m.ExecOutput.Err = make(chan error, 100)
	m.QueryCalled = make(chan bool, 100)
	m.QueryInput.Ctx = make(chan context.Context, 100)
	m.QueryInput.Query = make(chan string, 100)
	m.QueryInput.Args = make(chan []interface{}, 100)
	m.QueryOutput.Rows = make(chan *sql.Rows, 100)
	m.QueryOutput.Err = make(chan error, 100)
	m.QueryRowCalled = make(chan bool, 100)
	m.QueryRowInput.Ctx = make(chan context.Context, 100)
	m.QueryRowInput.Query = make(chan string, 100)
	m.QueryRowInput.Args = make(chan []interface{}, 100)
	m.QueryRowOutput.Row = make(chan *sql.Row, 100)
	m.BeginTxCalled = make(chan bool, 100)
	m.BeginTxInput.Ctx = make(chan context.Context, 100)
	m.BeginTxOutput.Database = make(chan persistence.Database, 100)
	m.BeginTxOutput.Err = make(chan error, 100)
	m.CommitCalled = make(chan bool, 100)
	m.CommitOutput.Err = make(chan error, 100)
	m.RollbackCalled = make(chan bool, 100)
	m.RollbackOutput.Err = make(chan error, 100)
	return m
}
func (m *mockDatabase) Exec(ctx context.Context, query string, args ...interface{}) (result sql.Result, err error) {
	m.ExecCalled <- true
	m.ExecInput.Ctx <- ctx
	m.ExecInput.Query <- query
	m.ExecInput.Args <- args
	return <-m.ExecOutput.Result, <-m.ExecOutput.Err
}
func (m *mockDatabase) Query(ctx context.Context, query string, args ...interface{}) (rows *sql.Rows, err error) {
	m.QueryCalled <- true
	m.QueryInput.Ctx <- ctx
	m.QueryInput.Query <- query
	m.QueryInput.Args <- args
	return <-m.QueryOutput.Rows, <-m.QueryOutput.Err
}
func (m *mockDatabase) QueryRow(ctx context.Context, query string, args ...interface{}) (row *sql.Row) {
	m.QueryRowCalled <- true
	m.QueryRowInput.Ctx <- ctx
	m.QueryRowInput.Query <- query
	m.QueryRowInput.Args <- args
	return <-m.QueryRowOutput.Row
}
func (m *mockDatabase) BeginTx(ctx context.Context) (database persistence.Database, err error) {
	m.BeginTxCalled <- true
	m.BeginTxInput.Ctx <- ctx
	return <-m.BeginTxOutput.Database, <-m.BeginTxOutput.Err
}
func (m *mockDatabase) Commit() (err error) {
	m.CommitCalled <- true
	return <-m.CommitOutput.Err
}
func (m *mockDatabase) Rollback() (err error) {
	m.RollbackCalled <- true
	return <-m.RollbackOutput.Err
}

type mockContext struct {
	DeadlineCalled chan bool
	DeadlineOutput struct {
		Deadline chan time.Time
		Ok       chan bool
	}
	DoneCalled chan bool
	DoneOutput struct {
		Ret0 chan (<-chan struct{})
	}
	ErrCalled chan bool
	ErrOutput struct {
		Ret0 chan error
	}
	ValueCalled chan bool
	ValueInput  struct {
		Key chan interface{}
	}
	ValueOutput struct {
		Ret0 chan interface{}
	}
}

func newMockContext() *mockContext {
	m := &mockContext{}
	m.DeadlineCalled = make(chan bool, 100)
	m.DeadlineOutput.Deadline = make(chan time.Time, 100)
	m.DeadlineOutput.Ok = make(chan bool, 100)
	m.DoneCalled = make(chan bool, 100)
	m.DoneOutput.Ret0 = make(chan (<-chan struct{}), 100)
	m.ErrCalled = make(chan bool, 100)
	m.ErrOutput.Ret0 = make(chan error, 100)
	m.ValueCalled = make(chan bool, 100)
	m.ValueInput.Key = make(chan interface{}, 100)
	m.ValueOutput.Ret0 = make(chan interface{}, 100)
	return m
}
func (m *mockContext) Deadline() (deadline time.Time, ok bool) {
	m.DeadlineCalled <- true
	return <-m.DeadlineOutput.Deadline, <-m.DeadlineOutput.Ok
}
func (m *mockContext) Done() <-chan struct{} {
	m.DoneCalled <- true
	return <-m.DoneOutput.Ret0
}
func (m *mockContext) Err() error {
	m.ErrCalled <- true
	return <-m.ErrOutput.Ret0
}
func (m *mockContext) Value(key interface{}) interface{} {
	m.ValueCalled <- true
	m.ValueInput.Key <- key
	return <-m.ValueOutput.Ret0
}
