colltest

package
v0.0.0-...-095f669 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MockStore

func MockStore() (store.KVStoreService, context.Context)

MockStore returns a mock store.KVStoreService and a mock context.Context. They can be used to test collections.

func MockValueCodec

func MockValueCodec[T any]() codec.ValueCodec[T]

MockValueCodec returns a mock of collections.ValueCodec for type T, it can be used for collections Values testing. It also supports interfaces. For the interfaces cases, in order for an interface to be decoded it must have been encoded first. Not concurrency safe. EG: Let's say the value is interface Animal if I want to decode Dog which implements Animal, then I need to first encode it in order to make the type known by the MockValueCodec.

func TestKeyCodec

func TestKeyCodec[T any](t *testing.T, keyCodec codec.KeyCodec[T], key T)

TestKeyCodec asserts the correct behaviour of a KeyCodec over the type T.

func TestValueCodec

func TestValueCodec[T any](t *testing.T, encoder codec.ValueCodec[T], value T)

TestValueCodec asserts the correct behaviour of a ValueCodec over the type T.

Types

This section is empty.

Jump to

Keyboard shortcuts

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