storetest

package
v0.0.0-...-7c66ffc Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2020 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SequenceTest

func SequenceTest(t *testing.T, s1 storage.SequenceStore)

SequenceTest runs tests on a SequenceStore implementation. For unit testing only.

func StorageTest

func StorageTest(t *testing.T, s storage.DataStore)

StorageTest ensures the implementation of the DataStore interface is done properly

func TestAPNStore

func TestAPNStore(store storage.APNStore, t *testing.T)

TestAPNStore tests an APN store. The store is expected to be empty by the test. Test data will be removed by the test.

Types

type TestEnvironment

type TestEnvironment struct {
	U1  model.User
	U2  model.User
	U3  model.User
	T1  model.Team       // U1's private team
	T2  model.Team       // U2's private team
	T12 model.Team       // Team containing both U1 (admin) and U2 (member)
	T21 model.Team       // Team containing both U2 (admin) and U1 (member)
	T3  model.Team       // A team that doesn't contain U1 or U2 at all
	C1  model.Collection // U1's private collection
	C2  model.Collection // U2's private collection
	C12 model.Collection // Collection owned by team T12
	C21 model.Collection // Collection owned by team T21
	C3  model.Collection // Collection owned by team T3s
}

TestEnvironment holds basics for the storage tests. They operate a lot on users and teams.

func NewTestEnvironment

func NewTestEnvironment(t *testing.T, s storage.DataStore) TestEnvironment

NewTestEnvironment creates a new testing environment

Jump to

Keyboard shortcuts

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