mock

package
v0.0.0-...-202847b Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package mock implements mocking of the store.Service for tests.

Please import this package as:

import (
	"github.com/corestoreio/pkg/store/storemock"
)

To avoid confusion with other mock packages.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewServiceEuroOZ

func NewServiceEuroOZ(opts ...store.Option) *store.Service

NewServiceEuroOZ creates a fully initialized store.Service with 3 websites, 4 groups and 7 stores used for testing. Panics on error. Website 1 contains Europe and website 2 contains Australia/New Zealand.

func NewServiceEuroW11G11S19

func NewServiceEuroW11G11S19(opts ...store.Option) *store.Service

Types

type Find

type Find struct {
	DefaultStoreIDFn func(runMode scope.TypeID) (websiteID, storeID uint32, err error)

	StoreIDbyCodeFn func(runMode scope.TypeID, storeCode string) (websiteID, storeID uint32, err error)
	// contains filtered or unexported fields
}

Find implements interface store.Finder for mocking in tests. Thread safe.

func NewDefaultStoreID

func NewDefaultStoreID(websiteID, storeID uint32, err error, fs ...*Find) *Find

NewFindDefaultStoreID creates a new closure for the function DefaultStoreID. The last variadic argument allows to append the other NewFind*() function.

func NewStoreIDbyCode

func NewStoreIDbyCode(websiteID, storeID uint32, err error, fs ...*Find) *Find

NewStoreIDbyCode creates a new closure for the function StoreIDbyCode. The last variadic argument allows to append the other NewFind*() function.

func (*Find) DefaultStoreID

func (s *Find) DefaultStoreID(runMode scope.TypeID) (websiteID, storeID uint32, err error)

func (*Find) DefaultStoreIDInvoked

func (s *Find) DefaultStoreIDInvoked() int

DefaultStoreIDInvoked returns the number of DefaultStoreID() call invocations.

func (*Find) StoreIDbyCode

func (s *Find) StoreIDbyCode(runMode scope.TypeID, storeCode string) (websiteID, storeID uint32, err error)

func (*Find) StoreIDbyCodeInvoked

func (s *Find) StoreIDbyCodeInvoked() int

StoreIDbyCodeInvoked returns the number of StoreIDbyCode() call invocations.

Jump to

Keyboard shortcuts

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