test

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GenericTask

type GenericTask interface {
	GetTaskID() string
	RunTask(t *testing.T) error
}

type TaskStatus

type TaskStatus struct {
	TimesCalled int
	CreatedAt   time.Time
	ExecutedAt  []time.Time
}

type TestTask

type TestTask struct {
	TaskTime time.Duration
	TaskID   string
}

func CreateTestTask

func CreateTestTask(te *TestTaskExecutor) *TestTask

func (*TestTask) GetTaskID

func (task *TestTask) GetTaskID() string

func (*TestTask) RunTask

func (task *TestTask) RunTask(t *testing.T) error

func (*TestTask) WithTaskTime

func (task *TestTask) WithTaskTime(d time.Duration) *TestTask

type TestTaskExecutor

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

func NewTaskExecutor

func NewTaskExecutor(t *testing.T) *TestTaskExecutor

func (*TestTaskExecutor) AllExecutionTimeStamps

func (te *TestTaskExecutor) AllExecutionTimeStamps(taskID string) []time.Time

func (*TestTaskExecutor) AssertAllTasksExecutedAtleastOnce

func (te *TestTaskExecutor) AssertAllTasksExecutedAtleastOnce() bool

func (*TestTaskExecutor) AssertAllTasksExecutedExactlyOnce

func (te *TestTaskExecutor) AssertAllTasksExecutedExactlyOnce() bool

func (*TestTaskExecutor) CheckTaskExecutionCount

func (te *TestTaskExecutor) CheckTaskExecutionCount(expected int) bool

func (*TestTaskExecutor) Execute

func (te *TestTaskExecutor) Execute(t interface{}) error

func (*TestTaskExecutor) GetExecutionCount

func (te *TestTaskExecutor) GetExecutionCount(taskID string) int

func (*TestTaskExecutor) GetTaskCreatedAt

func (te *TestTaskExecutor) GetTaskCreatedAt(taskID string) time.Time

func (*TestTaskExecutor) GetTaskExecutedAt

func (te *TestTaskExecutor) GetTaskExecutedAt(taskID string) time.Time

func (*TestTaskExecutor) GetTaskExecutionCount

func (te *TestTaskExecutor) GetTaskExecutionCount() int64

func (*TestTaskExecutor) InitTask

func (te *TestTaskExecutor) InitTask(taskID string)

func (*TestTaskExecutor) PrintStatus

func (te *TestTaskExecutor) PrintStatus()

func (*TestTaskExecutor) TaskCount

func (te *TestTaskExecutor) TaskCount() int

Jump to

Keyboard shortcuts

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