spechelper

package
v0.74.0 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const ErrIDRequired errs.Error = `` /* 174-byte string literal not displayed */

Variables

View Source
var ContextVar = testcase.Var[context.Context]{
	ID: "context.Context",
	Init: func(t *testcase.T) context.Context {
		return context.Background()
	},
}
View Source
var (
	SubscriberFilter = testcase.Var[func(interface{}) bool]{
		ID: `subscriber event filter`,
		Init: func(t *testcase.T) func(interface{}) bool {
			return func(interface{}) bool { return true }
		},
	}
)

Functions

func Base added in v0.71.0

func Base(e interface{}) interface{}

func Cleanup added in v0.71.0

func Cleanup[T any, ID any](tb testing.TB, ctx context.Context, t crud.Deleter[ID])

func Contains added in v0.71.0

func Contains[Ent any](tb testing.TB, slice []Ent, contains Ent, msgAndArgs ...interface{})

func CreateSubscriptionFilter added in v0.71.0

func CreateSubscriptionFilter[Ent any](event interface{}) bool

func DeleteSubscriptionFilter added in v0.71.0

func DeleteSubscriptionFilter[ID any](event interface{}) bool

func GenEntities added in v0.71.0

func GenEntities[T any](t *testcase.T, MakeEnt func(testing.TB) T) []*T

func LetSubscriber added in v0.71.0

func LetSubscriber[Ent, ID any](s *testcase.Spec, filter func(interface{}) bool) testcase.Var[*eventSubscriber[Ent, ID]]

func LetSubscription added in v0.71.0

func LetSubscription[Ent, ID any](s *testcase.Spec) testcase.Var[pubsub.Subscription]

func NewEventSubscriber added in v0.71.0

func NewEventSubscriber[Ent, ID any](tb testing.TB, filter func(interface{}) bool) *eventSubscriber[Ent, ID]

func NewT added in v0.71.0

func NewT(T interface{}) interface{}

func NewTFunc added in v0.71.0

func NewTFunc(T interface{}) func() interface{}

func RequireContainsList added in v0.71.0

func RequireContainsList(tb testing.TB, list interface{}, listOfContainedElements interface{}, msgAndArgs ...interface{})

func RequireNotContainsList added in v0.71.0

func RequireNotContainsList(tb testing.TB, list interface{}, listOfNotContainedElements interface{}, msgAndArgs ...interface{})

func ToPtr added in v0.71.0

func ToPtr[T any](v T) *T

func TypeAssertTo added in v0.71.0

func TypeAssertTo[ToType any](in []any) (out []ToType)

func UpdateSubscriptionFilter added in v0.71.0

func UpdateSubscriptionFilter[Ent any](event interface{}) bool

Types

type CRD added in v0.71.0

type CRD[T any, ID any] interface {
	crud.Creator[T]
	crud.Finder[T, ID]
	crud.Deleter[ID]
}

CRD is the minimum requirements to write easily behavioral specification for a resource.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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