test

package
v0.0.0-...-adf365b Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2016 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

This file was generated by counterfeiter

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadTestData

func LoadTestData(filename string, provider TestDataProvider) ([]byte, error)

LoadTestData attempt to load test data from local disk unless; * It does not exist or, * Variable REFRESH_DATA is present in ENV

Data is stored under examples/test This is done to avoid always depending on remote systems, but also with an option to refresh/retest against the 'current' remote system data without manual copy/paste

func ServiceAsUser

func ServiceAsUser(serviceName string, tm token.Manager, u account.Identity) *goa.Service

ServiceAsUser creates a new service and fill the context with input Identity

func WithIdentity

func WithIdentity(ctx context.Context, ident account.Identity) context.Context

WithIdentity fills the context with token Token is filled using input Identity object

Types

type MockDB

type MockDB struct {
	// contains filtered or unexported fields
}

func NewMockDB

func NewMockDB() *MockDB

func (*MockDB) BeginTransaction

func (db *MockDB) BeginTransaction() (application.Transaction, error)

func (*MockDB) Commit

func (db *MockDB) Commit() error

func (*MockDB) Identities

func (db *MockDB) Identities() application.IdentityRepository

func (*MockDB) Rollback

func (db *MockDB) Rollback() error

func (*MockDB) SearchItems

func (db *MockDB) SearchItems() application.SearchRepository

func (*MockDB) TrackerQueries

func (db *MockDB) TrackerQueries() application.TrackerQueryRepository

func (*MockDB) Trackers

func (db *MockDB) Trackers() application.TrackerRepository

func (*MockDB) WorkItemTypes

func (db *MockDB) WorkItemTypes() application.WorkItemTypeRepository

func (*MockDB) WorkItems

func (db *MockDB) WorkItems() application.WorkItemRepository

type TestDataProvider

type TestDataProvider func() ([]byte, error)

TestDataProvider defines the simple funcion for returning data from a remote provider

type WorkItemRepository

type WorkItemRepository struct {
	LoadStub func(ctx context.Context, ID string) (*app.WorkItem, error)

	SaveStub func(ctx context.Context, wi app.WorkItem) (*app.WorkItem, error)

	DeleteStub func(ctx context.Context, ID string) error

	CreateStub func(ctx context.Context, typeID string, fields map[string]interface{}) (*app.WorkItem, error)

	ListStub func(ctx context.Context, criteria criteria.Expression, start *int, length *int) ([]*app.WorkItem, uint64, error)
	// contains filtered or unexported fields
}

func (*WorkItemRepository) Create

func (fake *WorkItemRepository) Create(ctx context.Context, typeID string, fields map[string]interface{}, creator string) (*app.WorkItem, error)

func (*WorkItemRepository) CreateArgsForCall

func (fake *WorkItemRepository) CreateArgsForCall(i int) (context.Context, string, map[string]interface{})

func (*WorkItemRepository) CreateCallCount

func (fake *WorkItemRepository) CreateCallCount() int

func (*WorkItemRepository) CreateReturns

func (fake *WorkItemRepository) CreateReturns(result1 *app.WorkItem, result2 error)

func (*WorkItemRepository) Delete

func (fake *WorkItemRepository) Delete(ctx context.Context, ID string) error

func (*WorkItemRepository) DeleteArgsForCall

func (fake *WorkItemRepository) DeleteArgsForCall(i int) (context.Context, string)

func (*WorkItemRepository) DeleteCallCount

func (fake *WorkItemRepository) DeleteCallCount() int

func (*WorkItemRepository) DeleteReturns

func (fake *WorkItemRepository) DeleteReturns(result1 error)

func (*WorkItemRepository) Invocations

func (fake *WorkItemRepository) Invocations() map[string][][]interface{}

func (*WorkItemRepository) List

func (fake *WorkItemRepository) List(ctx context.Context, c criteria.Expression, start *int, length *int) ([]*app.WorkItem, uint64, error)

func (*WorkItemRepository) ListArgsForCall

func (fake *WorkItemRepository) ListArgsForCall(i int) (context.Context, criteria.Expression, *int, *int)

func (*WorkItemRepository) ListCallCount

func (fake *WorkItemRepository) ListCallCount() int

func (*WorkItemRepository) ListReturns

func (fake *WorkItemRepository) ListReturns(result1 []*app.WorkItem, result2 uint64, result3 error)

func (*WorkItemRepository) Load

func (fake *WorkItemRepository) Load(ctx context.Context, ID string) (*app.WorkItem, error)

func (*WorkItemRepository) LoadArgsForCall

func (fake *WorkItemRepository) LoadArgsForCall(i int) (context.Context, string)

func (*WorkItemRepository) LoadCallCount

func (fake *WorkItemRepository) LoadCallCount() int

func (*WorkItemRepository) LoadReturns

func (fake *WorkItemRepository) LoadReturns(result1 *app.WorkItem, result2 error)

func (*WorkItemRepository) Save

func (fake *WorkItemRepository) Save(ctx context.Context, wi app.WorkItem) (*app.WorkItem, error)

func (*WorkItemRepository) SaveArgsForCall

func (fake *WorkItemRepository) SaveArgsForCall(i int) (context.Context, app.WorkItem)

func (*WorkItemRepository) SaveCallCount

func (fake *WorkItemRepository) SaveCallCount() int

func (*WorkItemRepository) SaveReturns

func (fake *WorkItemRepository) SaveReturns(result1 *app.WorkItem, result2 error)

Jump to

Keyboard shortcuts

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