citywork

package
v0.0.0-...-8a4ed4b Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2024 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CityWorkSvc

type CityWorkSvc interface {
	Start(ctx context.Context) error
	// contains filtered or unexported methods
}

func NewCityWorkService

func NewCityWorkService(ctx context.Context, s SdlClient, timeInterval int, c client.ContextBrokerClient) CityWorkSvc

type SdlClient

type SdlClient interface {
	Get(cxt context.Context) (*sdlResponse, error)
}

func NewSdlClient

func NewSdlClient(ctx context.Context, sundsvallvaxerURL string) SdlClient

type SdlClientMock

type SdlClientMock struct {
	// GetFunc mocks the Get method.
	GetFunc func(cxt context.Context) (*sdlResponse, error)
	// contains filtered or unexported fields
}

SdlClientMock is a mock implementation of SdlClient.

func TestSomethingThatUsesSdlClient(t *testing.T) {

	// make and configure a mocked SdlClient
	mockedSdlClient := &SdlClientMock{
		GetFunc: func(cxt context.Context) (*sdlResponse, error) {
			panic("mock out the Get method")
		},
	}

	// use mockedSdlClient in code that requires SdlClient
	// and then make assertions.

}

func (*SdlClientMock) Get

func (mock *SdlClientMock) Get(cxt context.Context) (*sdlResponse, error)

Get calls GetFunc.

func (*SdlClientMock) GetCalls

func (mock *SdlClientMock) GetCalls() []struct {
	Cxt context.Context
}

GetCalls gets all the calls that were made to Get. Check the length with:

len(mockedSdlClient.GetCalls())

Jump to

Keyboard shortcuts

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