Documentation ¶
Index ¶
- type Config
- type Helper
- func (h *Helper) CreatePost(author client.ApiClient, params api.CreatePostParams) *api.Post
- func (h *Helper) CreatePostReaction(postAuthor client.ApiClient, reactionAuthor client.ApiClient, ...) *api.PostReaction
- func (h *Helper) CreatePosts(author client.ApiClient, postContents []string, readers []client.ApiClient) []*api.Post
- func (h *Helper) CreateUser(admin client.ApiClient, params api.CreateUserParams) (*api.User, client.ApiClient)
- func (h *Helper) CreateUserRand(admin client.ApiClient, userType api.UserType) (*api.User, string, client.ApiClient)
- func (h *Helper) RemovePostReactions(clt client.ApiClient, postReactionsIdents []api.Identifier)
- func (h *Helper) RemovePosts(clt client.ApiClient, postsIdents []api.Identifier)
- func (h *Helper) Time(str string) time.Time
- func (h *Helper) VerifyUnauthErr(err error)
- func (h *Helper) VerifyWrongCredsErr(err error)
- type Statistics
- type StatisticsRecorder
- type TestSetup
- func (ts *TestSetup) MaxCreationTimeDeviation() time.Duration
- func (ts *TestSetup) NewAdminClient(username, password string) client.ApiClient
- func (ts *TestSetup) NewGuestClient() client.ApiClient
- func (ts *TestSetup) NewUserClient(username, password string) client.ApiClient
- func (ts *TestSetup) Teardown()
- type TestStatistics
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
Config represents the test setup configuration
type Helper ¶
type Helper struct {
// contains filtered or unexported fields
}
Helper represents a test helper helping perform routine testing tasks
func (*Helper) CreatePost ¶
CreatePost creates a new post using the given client and parameters and verifies whether the post can be retrieved as well as whether the individual fields are correct
func (*Helper) CreatePostReaction ¶
func (h *Helper) CreatePostReaction( postAuthor client.ApiClient, reactionAuthor client.ApiClient, postIdent api.Identifier, reactionType api.PostReactionType, description string, ) *api.PostReaction
CreatePostReaction posts a new reaction to any given post using the given client and contents and verifies whether the reaction correctly created
func (*Helper) CreatePosts ¶
func (h *Helper) CreatePosts( author client.ApiClient, postContents []string, readers []client.ApiClient, ) []*api.Post
CreatePosts creates several new posts using the given client and contents and verifies whether the posts are correct and can be read by the given reader clients
func (*Helper) CreateUser ¶
func (h *Helper) CreateUser( admin client.ApiClient, params api.CreateUserParams, ) (*api.User, client.ApiClient)
CreateUser creates a user profile expecting the operation to be successful, retrieves the profile and verifies whether all fields of the profile are correct
func (*Helper) CreateUserRand ¶
func (h *Helper) CreateUserRand( admin client.ApiClient, userType api.UserType, ) (*api.User, string, client.ApiClient)
CreateUserRand creates a random user profile with random fields expecting the operation to be successful, retrieves the profile and verifies whether all fields of the profile are correct
func (*Helper) RemovePostReactions ¶
func (h *Helper) RemovePostReactions( clt client.ApiClient, postReactionsIdents []api.Identifier, )
RemovePostReactions removes several post reactions using the given client and verifies whether the post reactions can't be retrieved individually
func (*Helper) RemovePosts ¶
func (h *Helper) RemovePosts( clt client.ApiClient, postsIdents []api.Identifier, )
RemovePosts removes several posts using the given client and verifies whether the posts can't be retrieved individually
func (*Helper) Time ¶
Time returns a time.Time object parsed from the given RFC3339 string like: "2014-11-12T11:45:26.371Z"
func (*Helper) VerifyUnauthErr ¶
VerifyUnauthErr helps ensuring that the given error is an unauth-error with an error message included
func (*Helper) VerifyWrongCredsErr ¶
VerifyWrongCredsErr helps ensuring that the given error is a wrong-credentials error with an error message included
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
func (*Statistics) Print ¶
func (st *Statistics) Print()
Print prints the statistics to the standard output
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 TestSetup ¶
type TestSetup struct { ApiServer apisrv.ApiServer Helper *Helper // contains filtered or unexported fields }
TestSetup represents the prepared setup of an individual test
func (*TestSetup) MaxCreationTimeDeviation ¶
MaxCreationTimeDeviation returns the configured maximum accepted entity creation time deviation duration
func (*TestSetup) NewAdminClient ¶
NewAdminClient creates and connects a new administrator client verifying whether the connection was successfully established and whether the session is correct
func (*TestSetup) NewGuestClient ¶
NewGuestClient creates and connects a new guest client verifying whether the connection was successfully established
func (*TestSetup) NewUserClient ¶
NewUserClient creates and connects a new regular user client verifying whether the connection was successfully established and whether the session is correct
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