mock

package
v0.0.0-...-99cece9 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2020 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CargoRepository

type CargoRepository struct {
	StoreFn      func(c *shipping.Cargo) error
	StoreInvoked bool

	FindFn      func(id shipping.TrackingID) (*shipping.Cargo, error)
	FindInvoked bool

	FindAllFn      func() []*shipping.Cargo
	FindAllInvoked bool
}

CargoRepository is a mock cargo repository.

func (*CargoRepository) Find

Find calls the FindFn.

func (*CargoRepository) FindAll

func (r *CargoRepository) FindAll() []*shipping.Cargo

FindAll calls the FindAllFn.

func (*CargoRepository) Store

func (r *CargoRepository) Store(c *shipping.Cargo) error

Store calls the StoreFn.

type HandlingEventRepository

type HandlingEventRepository struct {
	StoreFn      func(shipping.HandlingEvent)
	StoreInvoked bool

	QueryHandlingHistoryFn      func(shipping.TrackingID) shipping.HandlingHistory
	QueryHandlingHistoryInvoked bool
}

HandlingEventRepository is a mock handling events repository.

func (*HandlingEventRepository) QueryHandlingHistory

QueryHandlingHistory calls the QueryHandlingHistoryFn.

func (*HandlingEventRepository) Store

Store calls the StoreFn.

type LocationRepository

type LocationRepository struct {
	FindFn      func(shipping.UNLocode) (*shipping.Location, error)
	FindInvoked bool

	FindAllFn      func() []*shipping.Location
	FindAllInvoked bool
}

LocationRepository is a mock location repository.

func (*LocationRepository) Find

Find calls the FindFn.

func (*LocationRepository) FindAll

func (r *LocationRepository) FindAll() []*shipping.Location

FindAll calls the FindAllFn.

type RoutingService

type RoutingService struct {
	FetchRoutesFn      func(shipping.RouteSpecification) []shipping.Itinerary
	FetchRoutesInvoked bool
}

RoutingService provides a mock routing service.

func (*RoutingService) FetchRoutesForSpecification

func (s *RoutingService) FetchRoutesForSpecification(rs shipping.RouteSpecification) []shipping.Itinerary

FetchRoutesForSpecification calls the FetchRoutesFn.

type VoyageRepository

type VoyageRepository struct {
	FindFn      func(shipping.VoyageNumber) (*shipping.Voyage, error)
	FindInvoked bool
}

VoyageRepository is a mock voyage repository.

func (*VoyageRepository) Find

Find calls the FindFn.

Jump to

Keyboard shortcuts

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