testutils

package
v1.0.0-beta.228 Latest Latest
Warning

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

Go to latest
Published: May 19, 2026 License: Apache-2.0 Imports: 34 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MonthPeriod = datetime.NewISODuration(0, 1, 0, 0, 0, 0, 0)
View Source
var NewTestNamespace = NewTestULID

Functions

func NewTestAddon

func NewTestAddon(t *testing.T, namespace string, rateCards ...productcatalog.RateCard) addon.CreateAddonInput

func NewTestFeature

func NewTestFeature(t *testing.T, namespace string) feature.CreateFeatureInputs

func NewTestFeatureFromMeter

func NewTestFeatureFromMeter(t *testing.T, meter *meter.Meter) feature.CreateFeatureInputs

func NewTestMeters

func NewTestMeters(t *testing.T, namespace string) []meter.Meter

func NewTestPlan

func NewTestPlan(t *testing.T, namespace string, transformers ...TransformerFunc[productcatalog.Plan]) plan.CreatePlanInput

func NewTestULID

func NewTestULID(t *testing.T) string

Types

type TestEnv

type TestEnv struct {
	Logger              *slog.Logger
	Publisher           eventbus.Publisher
	Meter               *meteradapter.TestAdapter
	Feature             feature.FeatureConnector
	TaxCode             taxcode.Service
	Plan                plan.Service
	PlanRepository      plan.Repository
	PlanAddon           planaddon.Service
	PlanAddonRepository planaddon.Repository
	Addon               addon.Service
	AddonRepository     addon.Repository

	Client *entdb.Client
	// contains filtered or unexported fields
}

func NewTestEnv

func NewTestEnv(t *testing.T) *TestEnv

func (*TestEnv) Close

func (e *TestEnv) Close(t *testing.T)

func (*TestEnv) DBSchemaMigrate

func (e *TestEnv) DBSchemaMigrate(t *testing.T)

type TransformerFunc

type TransformerFunc[T any] func(*testing.T, *T)

func WithPlanKey

func WithPlanKey(key string) TransformerFunc[productcatalog.Plan]

Jump to

Keyboard shortcuts

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