sportsfields

package
v0.0.0-...-61e9378 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 6, 2024 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SportsFieldService

type SportsFieldService interface {
	Broker() string
	Tenant() string

	GetAll(requiredCategories []string) []domain.SportsField
	GetByID(id string) (*domain.SportsField, error)

	Start(ctx context.Context)
	Shutdown(ctx context.Context)
}

func NewSportsFieldService

func NewSportsFieldService(ctx context.Context, contextBrokerURL, tenant string, orgreg organisations.Registry) SportsFieldService

type SportsFieldServiceMock

type SportsFieldServiceMock struct {
	// BrokerFunc mocks the Broker method.
	BrokerFunc func() string

	// GetAllFunc mocks the GetAll method.
	GetAllFunc func(requiredCategories []string) []domain.SportsField

	// GetByIDFunc mocks the GetByID method.
	GetByIDFunc func(id string) (*domain.SportsField, error)

	// ShutdownFunc mocks the Shutdown method.
	ShutdownFunc func(ctx context.Context)

	// StartFunc mocks the Start method.
	StartFunc func(ctx context.Context)

	// TenantFunc mocks the Tenant method.
	TenantFunc func() string
	// contains filtered or unexported fields
}

SportsFieldServiceMock is a mock implementation of SportsFieldService.

func TestSomethingThatUsesSportsFieldService(t *testing.T) {

	// make and configure a mocked SportsFieldService
	mockedSportsFieldService := &SportsFieldServiceMock{
		BrokerFunc: func() string {
			panic("mock out the Broker method")
		},
		GetAllFunc: func(requiredCategories []string) []domain.SportsField {
			panic("mock out the GetAll method")
		},
		GetByIDFunc: func(id string) (*domain.SportsField, error) {
			panic("mock out the GetByID method")
		},
		ShutdownFunc: func(ctx context.Context)  {
			panic("mock out the Shutdown method")
		},
		StartFunc: func(ctx context.Context)  {
			panic("mock out the Start method")
		},
		TenantFunc: func() string {
			panic("mock out the Tenant method")
		},
	}

	// use mockedSportsFieldService in code that requires SportsFieldService
	// and then make assertions.

}

func (*SportsFieldServiceMock) Broker

func (mock *SportsFieldServiceMock) Broker() string

Broker calls BrokerFunc.

func (*SportsFieldServiceMock) BrokerCalls

func (mock *SportsFieldServiceMock) BrokerCalls() []struct {
}

BrokerCalls gets all the calls that were made to Broker. Check the length with:

len(mockedSportsFieldService.BrokerCalls())

func (*SportsFieldServiceMock) GetAll

func (mock *SportsFieldServiceMock) GetAll(requiredCategories []string) []domain.SportsField

GetAll calls GetAllFunc.

func (*SportsFieldServiceMock) GetAllCalls

func (mock *SportsFieldServiceMock) GetAllCalls() []struct {
	RequiredCategories []string
}

GetAllCalls gets all the calls that were made to GetAll. Check the length with:

len(mockedSportsFieldService.GetAllCalls())

func (*SportsFieldServiceMock) GetByID

func (mock *SportsFieldServiceMock) GetByID(id string) (*domain.SportsField, error)

GetByID calls GetByIDFunc.

func (*SportsFieldServiceMock) GetByIDCalls

func (mock *SportsFieldServiceMock) GetByIDCalls() []struct {
	ID string
}

GetByIDCalls gets all the calls that were made to GetByID. Check the length with:

len(mockedSportsFieldService.GetByIDCalls())

func (*SportsFieldServiceMock) Shutdown

func (mock *SportsFieldServiceMock) Shutdown(ctx context.Context)

Shutdown calls ShutdownFunc.

func (*SportsFieldServiceMock) ShutdownCalls

func (mock *SportsFieldServiceMock) ShutdownCalls() []struct {
	Ctx context.Context
}

ShutdownCalls gets all the calls that were made to Shutdown. Check the length with:

len(mockedSportsFieldService.ShutdownCalls())

func (*SportsFieldServiceMock) Start

func (mock *SportsFieldServiceMock) Start(ctx context.Context)

Start calls StartFunc.

func (*SportsFieldServiceMock) StartCalls

func (mock *SportsFieldServiceMock) StartCalls() []struct {
	Ctx context.Context
}

StartCalls gets all the calls that were made to Start. Check the length with:

len(mockedSportsFieldService.StartCalls())

func (*SportsFieldServiceMock) Tenant

func (mock *SportsFieldServiceMock) Tenant() string

Tenant calls TenantFunc.

func (*SportsFieldServiceMock) TenantCalls

func (mock *SportsFieldServiceMock) TenantCalls() []struct {
}

TenantCalls gets all the calls that were made to Tenant. Check the length with:

len(mockedSportsFieldService.TenantCalls())

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL