test

package
v0.0.19 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Test

func Test(testCase TestCase) *test

Types

type BaseTest

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

func NewBaseTest

func NewBaseTest(name string, description string, input interface{}) *BaseTest

func (*BaseTest) Description

func (b *BaseTest) Description(description string) TestCase

func (*BaseTest) Execute

func (b *BaseTest) Execute(ctx *TestContext) *TestResult

func (*BaseTest) GetDescription

func (b *BaseTest) GetDescription() string

func (*BaseTest) GetName

func (b *BaseTest) GetName() string

func (*BaseTest) Name

func (b *BaseTest) Name(name string) TestCase

func (*BaseTest) TearDown

func (b *BaseTest) TearDown(ctx *TestContext)

type TestCase

type TestCase interface {
	GetName() string
	GetDescription() string
	Execute(ctx *TestContext) *TestResult
	TearDown(ctx *TestContext)

	// Builder methods
	Name(name string) TestCase
	Description(description string) TestCase
}

type TestContext

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

func NewTestContext

func NewTestContext() *TestContext

func (*TestContext) Get

func (t *TestContext) Get(key string) interface{}

func (*TestContext) GetStr

func (t *TestContext) GetStr(key string) string

func (*TestContext) Put

func (t *TestContext) Put(key string, value interface{}) *TestContext

type TestFlow

type TestFlow struct {
	Results []*TestResult
	// contains filtered or unexported fields
}

func Flow

func Flow(ctx *TestContext) *TestFlow

func (*TestFlow) Audit

func (t *TestFlow) Audit() error

func (*TestFlow) TearDown

func (t *TestFlow) TearDown() *TestFlow

func (*TestFlow) Test

func (t *TestFlow) Test(testCase TestCase) *TestFlow

type TestResult

type TestResult struct {
	Errors []string
	// contains filtered or unexported fields
}

func Failure

func Failure(errors ...string) *TestResult

func Success

func Success() *TestResult

func (*TestResult) Failed

func (t *TestResult) Failed()

func (*TestResult) IsFailed

func (t *TestResult) IsFailed() bool

func (*TestResult) IsSucceeded

func (t *TestResult) IsSucceeded() bool

func (*TestResult) Succeeded

func (t *TestResult) Succeeded()

Jump to

Keyboard shortcuts

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