storemock

package
v0.0.0-...-6f8fa1e Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2016 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

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

Please import this package as:

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

To avoid confusion with other mock packages.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MustNewStoreAU

func MustNewStoreAU(cg config.Getter) store.Store

MustNewStoreAU creates a new Store with an attached config. Store ID 5, Code "au"; Website ID 2, Code "oz"; GroupID 3.

func NewEurozzyService

func NewEurozzyService(cfg config.Getter, opts ...store.Option) *store.Service

NewEurozzyService 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 NewStoreAU

func NewStoreAU(cfg config.Getter) (store.Store, error)

NewStoreAU creates a new Store with an attached config. Store ID 5, Code "au"; Website ID 2, Code "oz"; GroupID 3.

Types

type Find

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

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

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

func NewDefaultStoreID

func NewDefaultStoreID(storeID, websiteID int64, 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(storeID, websiteID int64, 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) (storeID, websiteID int64, 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) (storeID, websiteID int64, 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