testing

package
v0.0.0-...-5abe684 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DisabledChannelID domain.ChannelID = "disabled-channel"

DisabledChannelID is ChannelID that StubChannelProvider always rejects.

View Source
var StubChannelExpire = dspstesting.MakeDuration("5m")

StubChannelExpire is expire (TTL) of any channels pro

View Source
var StubChannelProvider domain.ChannelProvider = dspstesting.ChannelProviderFunc(func(id domain.ChannelID) (domain.Channel, error) {
	if id == DisabledChannelID {
		return nil, domain.ErrInvalidChannel
	}
	return &stubChannel{
		id:     id,
		expire: StubChannelExpire,
	}, nil
})

StubChannelProvider is simple stub implementation of ChannelProvider

Functions

func CoreFunctionTest

func CoreFunctionTest(t *testing.T, storageCtor StorageCtor)

CoreFunctionTest tests common Storage behaviors

func JwtTest

func JwtTest(t *testing.T, storageCtor StorageCtor)

JwtTest tests common Storage behaviors

func PubSubTest

func PubSubTest(t *testing.T, storageCtor StorageCtor)

PubSubTest tests common Storage behaviors

Types

type StorageCtor

type StorageCtor func(ctx context.Context, systemClock domain.SystemClock, channelProvider domain.ChannelProvider) (domain.Storage, error)

StorageCtor should construct Storage instance to test

Jump to

Keyboard shortcuts

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