test

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2017 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Overview

This file was generated by counterfeiter

Package test was generated by counterfeiter

Index

Constants

This section is empty.

Variables

View Source
var TestIdentity = account.Identity{
	ID:       uuid.NewV4(),
	Username: "TestDeveloper",
	User:     TestUser,
}

TestIdentity only creates in memory obj for testing purposes

View Source
var TestIdentity2 = account.Identity{
	ID:       uuid.NewV4(),
	Username: "TestDeveloper2",
	User:     TestUser2,
}

TestIdentity2 only creates in memory obj for testing purposes

View Source
var TestObserverIdentity = account.Identity{
	ID:       uuid.NewV4(),
	Username: "TestObserver",
	User:     TestUser,
}

TestObserverIdentity only creates in memory obj for testing purposes

View Source
var TestOversizedNameObj = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
View Source
var TestUser = account.User{
	ID:       uuid.NewV4(),
	Email:    "testdeveloper@testalm.io",
	FullName: "Test Developer",
}

TestUser only creates in memory obj for testing purposes

View Source
var TestUser2 = account.User{
	ID:       uuid.NewV4(),
	Email:    "testdeveloper2@testalm.io",
	FullName: "Test Developer 2",
}

TestUser2 only creates in memory obj for testing purposes. This TestUser2 can be used to verify that some entity created by TestUser can be later updated or deleted (or not) by another user.

Functions

func CreateRandomValidTestName

func CreateRandomValidTestName(name string) string

CreateRandomValidTestName functions creates a valid lenght name

func CreateTestIdentity

func CreateTestIdentity(db *gorm.DB, username, providerType string) (account.Identity, error)

CreateTestIdentity creates an identity with the given `username` in the database. For testing purpose only.

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 ServiceAsSpaceUser

func ServiceAsSpaceUser(serviceName string, tm token.Manager, u account.Identity, authzSrv authz.AuthzService) *goa.Service

ServiceAsSpaceUser creates a new service and fill the context with input Identity and space authz service

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 ServiceAsUserWithAuthz

func ServiceAsUserWithAuthz(serviceName string, tm token.Manager, key interface{}, u account.Identity, authorizationPayload authz.AuthorizationPayload) *goa.Service

ServiceAsUserWithAuthz creates a new service and fill the context with input Identity and resource authorization information

func WithAuthz

func WithAuthz(ctx context.Context, key interface{}, ident account.Identity, authz authz.AuthorizationPayload) context.Context

WithAuthz fills the context with token Token is filled using input Identity object and resource authorization information

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) Areas

func (db *MockDB) Areas() area.Repository

func (*MockDB) BeginTransaction

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

func (*MockDB) Codebases

func (db *MockDB) Codebases() codebase.Repository

func (*MockDB) Comments

func (db *MockDB) Comments() comment.Repository

func (*MockDB) Commit

func (db *MockDB) Commit() error

func (*MockDB) Identities

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

func (*MockDB) Iterations

func (db *MockDB) Iterations() iteration.Repository

func (*MockDB) OauthStates

func (g *MockDB) OauthStates() auth.OauthStateReferenceRepository

func (*MockDB) Rollback

func (db *MockDB) Rollback() error

func (*MockDB) SearchItems

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

func (*MockDB) SpaceResources

func (db *MockDB) SpaceResources() space.ResourceRepository

func (*MockDB) Spaces

func (db *MockDB) Spaces() space.Repository

func (*MockDB) TrackerQueries

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

func (*MockDB) Trackers

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

func (*MockDB) Users

func (db *MockDB) Users() account.UserRepository

func (*MockDB) WorkItemLinkCategories

func (db *MockDB) WorkItemLinkCategories() link.WorkItemLinkCategoryRepository

func (*MockDB) WorkItemLinkTypes

func (db *MockDB) WorkItemLinkTypes() link.WorkItemLinkTypeRepository
func (db *MockDB) WorkItemLinks() link.WorkItemLinkRepository

func (*MockDB) WorkItemTypes

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

func (*MockDB) WorkItems

func (db *MockDB) WorkItems() workitem.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, spaceID uuid.UUID, ID string) (*workitem.WorkItem, error)

	LoadByIDStub func(ctx context.Context, ID string) (*workitem.WorkItem, error)

	SaveStub func(ctx context.Context, spaceID uuid.UUID, wi workitem.WorkItem, modifierID uuid.UUID) (*workitem.WorkItem, error)

	ReorderStub func(ctx context.Context, direction workitem.DirectionType, targetID *string, wi workitem.WorkItem, modifierID uuid.UUID) (*workitem.WorkItem, error)

	DeleteStub func(ctx context.Context, spaceID uuid.UUID, ID string, suppressorID uuid.UUID) error

	CreateStub func(ctx context.Context, spaceID uuid.UUID, typeID uuid.UUID, fields map[string]interface{}, creatorID uuid.UUID) (*workitem.WorkItem, error)

	CountStub func(ctx context.Context, spaceID uuid.UUID, criteria criteria.Expression) (int, error)

	ListStub func(ctx context.Context, spaceID uuid.UUID, criteria criteria.Expression, start *int, length *int) ([]workitem.WorkItem, uint64, error)

	FetchStub func(ctx context.Context, spaceID uuid.UUID, criteria criteria.Expression) (*workitem.WorkItem, error)

	GetCountsPerIterationStub func(ctx context.Context, spaceID uuid.UUID) (map[string]workitem.WICountsPerIteration, error)

	GetCountsForIterationStub func(ctx context.Context, iterationID uuid.UUID) (map[string]workitem.WICountsPerIteration, error)
	// contains filtered or unexported fields
}

func (*WorkItemRepository) Count

func (fake *WorkItemRepository) Count(ctx context.Context, spaceID uuid.UUID, c criteria.Expression) (int, error)

func (*WorkItemRepository) Create

func (fake *WorkItemRepository) Create(ctx context.Context, spaceID uuid.UUID, typeID uuid.UUID, fields map[string]interface{}, creatorID uuid.UUID) (*workitem.WorkItem, error)

func (*WorkItemRepository) CreateArgsForCall

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

func (*WorkItemRepository) CreateCallCount

func (fake *WorkItemRepository) CreateCallCount() int

func (*WorkItemRepository) CreateReturns

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

func (*WorkItemRepository) Delete

func (fake *WorkItemRepository) Delete(ctx context.Context, spaceID uuid.UUID, ID string, suppressorID uuid.UUID) error

func (*WorkItemRepository) DeleteArgsForCall

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

func (*WorkItemRepository) DeleteCallCount

func (fake *WorkItemRepository) DeleteCallCount() int

func (*WorkItemRepository) DeleteReturns

func (fake *WorkItemRepository) DeleteReturns(result1 error)

func (*WorkItemRepository) Fetch

func (*WorkItemRepository) FetchArgsForCall

func (fake *WorkItemRepository) FetchArgsForCall(i int) (context.Context, uuid.UUID, criteria.Expression)

func (*WorkItemRepository) FetchCallCount

func (fake *WorkItemRepository) FetchCallCount() int

func (*WorkItemRepository) FetchReturns

func (fake *WorkItemRepository) FetchReturns(result1 *workitem.WorkItem, result2 error)

func (*WorkItemRepository) GetCountsForIteration

func (fake *WorkItemRepository) GetCountsForIteration(ctx context.Context, iterationID uuid.UUID) (map[string]workitem.WICountsPerIteration, error)

func (*WorkItemRepository) GetCountsForIterationArgsForCall

func (fake *WorkItemRepository) GetCountsForIterationArgsForCall(i int) (context.Context, uuid.UUID)

func (*WorkItemRepository) GetCountsForIterationCallCount

func (fake *WorkItemRepository) GetCountsForIterationCallCount() int

func (*WorkItemRepository) GetCountsForIterationReturns

func (fake *WorkItemRepository) GetCountsForIterationReturns(result1 map[string]workitem.WICountsPerIteration, result2 error)

func (*WorkItemRepository) GetCountsPerIteration

func (fake *WorkItemRepository) GetCountsPerIteration(ctx context.Context, spaceID uuid.UUID) (map[string]workitem.WICountsPerIteration, error)

func (*WorkItemRepository) GetCountsPerIterationArgsForCall

func (fake *WorkItemRepository) GetCountsPerIterationArgsForCall(i int) (context.Context, uuid.UUID)

func (*WorkItemRepository) GetCountsPerIterationCallCount

func (fake *WorkItemRepository) GetCountsPerIterationCallCount() int

func (*WorkItemRepository) GetCountsPerIterationReturns

func (fake *WorkItemRepository) GetCountsPerIterationReturns(result1 map[string]workitem.WICountsPerIteration, result2 error)

func (*WorkItemRepository) Invocations

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

func (*WorkItemRepository) List

func (fake *WorkItemRepository) List(ctx context.Context, spaceID uuid.UUID, c criteria.Expression, parentExists *bool, start *int, length *int) ([]workitem.WorkItem, uint64, error)

func (*WorkItemRepository) ListArgsForCall

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

func (*WorkItemRepository) ListCallCount

func (fake *WorkItemRepository) ListCallCount() int

func (*WorkItemRepository) ListReturns

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

func (*WorkItemRepository) Load

func (fake *WorkItemRepository) Load(ctx context.Context, spaceID uuid.UUID, ID string) (*workitem.WorkItem, error)

func (*WorkItemRepository) LoadArgsForCall

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

func (*WorkItemRepository) LoadByID

func (fake *WorkItemRepository) LoadByID(ctx context.Context, ID string) (*workitem.WorkItem, error)

func (*WorkItemRepository) LoadByIDReturns

func (fake *WorkItemRepository) LoadByIDReturns(result1 *workitem.WorkItem, result2 error)

func (*WorkItemRepository) LoadCallCount

func (fake *WorkItemRepository) LoadCallCount() int

func (*WorkItemRepository) LoadReturns

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

func (*WorkItemRepository) Reorder

func (fake *WorkItemRepository) Reorder(ctx context.Context, direction workitem.DirectionType, targetID *string, wi workitem.WorkItem, modifierID uuid.UUID) (*workitem.WorkItem, error)

Reorder is a fake function for reordering of workitems Used for testing purpose

func (*WorkItemRepository) ReorderArgsForCall

ReorderArgsForCall returns fake arguments for Reorder function

func (*WorkItemRepository) ReorderCallCount

func (fake *WorkItemRepository) ReorderCallCount() int

ReorderCallCount returns the length of fake arguments

func (*WorkItemRepository) ReorderReturns

func (fake *WorkItemRepository) ReorderReturns(workItem *workitem.WorkItem, errr error)

ReorderReturns returns fake values for Reorder function

func (*WorkItemRepository) Save

func (fake *WorkItemRepository) Save(ctx context.Context, spaceID uuid.UUID, wi workitem.WorkItem, modifierID uuid.UUID) (*workitem.WorkItem, error)

func (*WorkItemRepository) SaveArgsForCall

func (fake *WorkItemRepository) SaveArgsForCall(i int) (context.Context, uuid.UUID, workitem.WorkItem, uuid.UUID)

func (*WorkItemRepository) SaveCallCount

func (fake *WorkItemRepository) SaveCallCount() int

func (*WorkItemRepository) SaveReturns

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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