Documentation ¶
Index ¶
- type AssumeFailure
- func (notOk AssumeFailure) Authenticate(expectedErrorCode errors.Code, sessionKey string)
- func (notOk AssumeFailure) CloseAllSessions(expectedErrorCode errors.Code, user store.ID)
- func (notOk AssumeFailure) CloseSession(expectedErrorCode errors.Code, key string)
- func (notOk AssumeFailure) CreatePost(expectedErrorCode errors.Code, authorID store.ID, title string, ...)
- func (notOk AssumeFailure) CreateReaction(expectedErrorCode errors.Code, author store.ID, subject store.ID, ...)
- func (notOkay AssumeFailure) CreateSession(expectedErrorCode errors.Code, email string, password string)
- func (notOkay AssumeFailure) CreateUser(expectedErrorCode errors.Code, displayName, email, password string)
- func (notOk AssumeFailure) EditPost(expectedErrorCode errors.Code, postID store.ID, editorID store.ID, ...)
- func (notOk AssumeFailure) EditReaction(expectedErrorCode errors.Code, reactionID store.ID, editorID store.ID, ...)
- func (notOk AssumeFailure) EditUser(expectedErrorCode errors.Code, userID store.ID, editorID store.ID, ...)
- type AssumeSuccess
- func (ok AssumeSuccess) Authenticate(sessionKey string) *gqlmod.Session
- func (ok AssumeSuccess) CloseAllSessions(user store.ID) []string
- func (ok AssumeSuccess) CloseSession(key string) bool
- func (ok AssumeSuccess) CreatePost(authorID store.ID, title string, contents string) *gqlmod.Post
- func (ok AssumeSuccess) CreateReaction(author store.ID, subject store.ID, emotion emotion.Emotion, message string) *gqlmod.Reaction
- func (ok AssumeSuccess) CreateSession(email string, password string) *gqlmod.Session
- func (ok AssumeSuccess) CreateUser(displayName, email, password string) *gqlmod.User
- func (ok AssumeSuccess) EditPost(postID store.ID, editorID store.ID, newTitle *string, newContents *string) *gqlmod.Post
- func (ok AssumeSuccess) EditReaction(reactionID store.ID, editorID store.ID, newMessage string) *gqlmod.Reaction
- func (ok AssumeSuccess) EditUser(userID store.ID, editorID store.ID, newEmail *string, newPassword *string) *gqlmod.User
- type Client
- type Helper
- type Statistics
- type StatisticsRecorder
- type TestContext
- type TestSetup
- type TestStatistics
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AssumeFailure ¶
type AssumeFailure struct {
// contains filtered or unexported fields
}
AssumeFailure wraps failable helper functions
func (AssumeFailure) Authenticate ¶
func (notOk AssumeFailure) Authenticate( expectedErrorCode errors.Code, sessionKey string, )
Authenticate helps closing a session
func (AssumeFailure) CloseAllSessions ¶
func (notOk AssumeFailure) CloseAllSessions( expectedErrorCode errors.Code, user store.ID, )
CloseAllSessions helps closing all sessions of a user
func (AssumeFailure) CloseSession ¶
func (notOk AssumeFailure) CloseSession( expectedErrorCode errors.Code, key string, )
CloseSession helps closing a session
func (AssumeFailure) CreatePost ¶
func (notOk AssumeFailure) CreatePost( expectedErrorCode errors.Code, authorID store.ID, title string, contents string, )
CreatePost helps creating a user
func (AssumeFailure) CreateReaction ¶
func (notOk AssumeFailure) CreateReaction( expectedErrorCode errors.Code, author store.ID, subject store.ID, emotion emotion.Emotion, message string, )
CreateReaction helps creating a reaction
func (AssumeFailure) CreateSession ¶
func (notOkay AssumeFailure) CreateSession( expectedErrorCode errors.Code, email string, password string, )
CreateSession helps creating a new session
func (AssumeFailure) CreateUser ¶
func (notOkay AssumeFailure) CreateUser( expectedErrorCode errors.Code, displayName, email, password string, )
CreateUser helps creating a user
func (AssumeFailure) EditPost ¶
func (notOk AssumeFailure) EditPost( expectedErrorCode errors.Code, postID store.ID, editorID store.ID, newTitle *string, newContents *string, )
EditPost helps edit a post
type AssumeSuccess ¶
type AssumeSuccess struct {
// contains filtered or unexported fields
}
AssumeSuccess wraps failable helper functions
func (AssumeSuccess) Authenticate ¶
func (ok AssumeSuccess) Authenticate( sessionKey string, ) *gqlmod.Session
Authenticate helps closing a session and assumes success
func (AssumeSuccess) CloseAllSessions ¶
func (ok AssumeSuccess) CloseAllSessions( user store.ID, ) []string
CloseAllSessions helps closing all sessions of a user and assumes success
func (AssumeSuccess) CloseSession ¶
func (ok AssumeSuccess) CloseSession( key string, ) bool
CloseSession helps closing a session and assumes success
func (AssumeSuccess) CreatePost ¶
func (ok AssumeSuccess) CreatePost( authorID store.ID, title string, contents string, ) *gqlmod.Post
CreatePost helps creating a user and assumes success
func (AssumeSuccess) CreateReaction ¶
func (ok AssumeSuccess) CreateReaction( author store.ID, subject store.ID, emotion emotion.Emotion, message string, ) *gqlmod.Reaction
CreateReaction helps creating a reaction and assumes success
func (AssumeSuccess) CreateSession ¶
func (ok AssumeSuccess) CreateSession( email string, password string, ) *gqlmod.Session
CreateSession helps creating a new session and assumes success
func (AssumeSuccess) CreateUser ¶
func (ok AssumeSuccess) CreateUser( displayName, email, password string, ) *gqlmod.User
CreateUser helps creating a user and assumes success
func (AssumeSuccess) EditPost ¶
func (ok AssumeSuccess) EditPost( postID store.ID, editorID store.ID, newTitle *string, newContents *string, ) *gqlmod.Post
EditPost helps edit a post and assumes success
type Client ¶
type Client struct { Help Helper // contains filtered or unexported fields }
Client represents an API client
func (*Client) Query ¶
Query performs an API query
type Helper ¶
type Helper struct { OK AssumeSuccess ERR AssumeFailure // contains filtered or unexported fields }
Helper represents a test helper
type Statistics ¶
type Statistics struct { Tests []*TestStatistics MinSetupTime time.Duration MinSetupTimeTest string MaxSetupTime time.Duration MaxSetupTimeTest string MinTeardownTime time.Duration MinTeardownTimeTest string MaxTeardownTime time.Duration MaxTeardownTimeTest string AvgSetupTime time.Duration AvgTeardownTime time.Duration }
Statistics represents the final computed statistics
type StatisticsRecorder ¶
type StatisticsRecorder struct {
// contains filtered or unexported fields
}
StatisticsRecorder represents the statistics recorder and computer
func NewStatisticsRecorder ¶
func NewStatisticsRecorder() *StatisticsRecorder
NewStatisticsRecorder constructs a new statistics recorder instance
func (*StatisticsRecorder) Compute ¶
func (sr *StatisticsRecorder) Compute() *Statistics
Compute will compute and return the final statistics based on the recordings
func (*StatisticsRecorder) Set ¶
func (sr *StatisticsRecorder) Set( t *testing.T, mutator func(*TestStatistics), )
Set allows to safely modify a certain tests statistics. It will automatically create a test if it's not yet registered
type TestContext ¶
type TestContext struct { Stats *StatisticsRecorder DBHost string SrvHost string }
TestContext represents a test context
type TestSetup ¶
type TestSetup struct {
// contains filtered or unexported fields
}
TestSetup represents the ArangoDB-based setup of an individual test
func (*TestSetup) Client ¶
Client creates a new authenticated API client
func (*TestSetup) Debug ¶
Debug creates a new authenticated API debug client
func (*TestSetup) Guest ¶
Guest creates a new unauthenticated API client
type TestStatistics ¶
TestStatistics represents the statistics of a specific test
func (*TestStatistics) Clone ¶
func (ts *TestStatistics) Clone() *TestStatistics
Clone returns an exact deep copy of the object