mock

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2017 License: MIT Imports: 3 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 *cargo.Cargo) error
	StoreInvoked bool

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

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

CargoRepository is a mock cargo repository.

func (*CargoRepository) Find

func (r *CargoRepository) Find(id cargo.TrackingID) (*cargo.Cargo, error)

Find calls the FindFn.

func (*CargoRepository) FindAll

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

FindAll calls the FindAllFn.

func (*CargoRepository) Store

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

Store calls the StoreFn.

type HandlingEventRepository

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

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

HandlingEventRepository is a mock handling events repository.

func (*HandlingEventRepository) QueryHandlingHistory

func (r *HandlingEventRepository) QueryHandlingHistory(id cargo.TrackingID) cargo.HandlingHistory

QueryHandlingHistory calls the QueryHandlingHistoryFn.

func (*HandlingEventRepository) Store

Store calls the StoreFn.

type LocationRepository

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

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

LocationRepository is a mock location repository.

func (*LocationRepository) Find

Find calls the FindFn.

func (*LocationRepository) FindAll

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

FindAll calls the FindAllFn.

type RoutingService

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

RoutingService provides a mock routing service.

func (*RoutingService) FetchRoutesForSpecification

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

FetchRoutesForSpecification calls the FetchRoutesFn.

type VoyageRepository

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

VoyageRepository is a mock voyage repository.

func (*VoyageRepository) Find

func (r *VoyageRepository) Find(number voyage.Number) (*voyage.Voyage, error)

Find calls the FindFn.

Jump to

Keyboard shortcuts

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