Documentation ¶
Index ¶
- func FakeAttendeeJWT(t *testing.T, userID string) string
- func FakeTrainerJWT(t *testing.T, userID string) string
- func RelativeDate(days int, hour int) time.Time
- func WaitForPort(address string) bool
- type TrainerHTTPClient
- type TrainingsHTTPClient
- func (c TrainingsHTTPClient) CancelTraining(t *testing.T, trainingUUID string, expectedStatusCode int)
- func (c TrainingsHTTPClient) CreateTraining(t *testing.T, note string, hour time.Time) string
- func (c TrainingsHTTPClient) CreateTrainingShouldFail(t *testing.T, note string, hour time.Time)
- func (c TrainingsHTTPClient) GetTrainings(t *testing.T) trainings.Trainings
- type UsersHTTPClient
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RelativeDate ¶
RelativeDate returns a date in the future in specified days and hours. This allows running the tests in parallel, since each test uses different date and hour.
The downside of this approach is that you need to be aware of used dates when adding a new test. In our case this is not an issue, as it's trivial to see all usages and there's just a few of them.
Another, more complex approach, would be to use random dates and retry in case of an error.
func WaitForPort ¶
Types ¶
type TrainerHTTPClient ¶
type TrainerHTTPClient struct {
// contains filtered or unexported fields
}
func NewTrainerHTTPClient ¶
func NewTrainerHTTPClient(t *testing.T, token string) TrainerHTTPClient
func (TrainerHTTPClient) GetTrainerAvailableHours ¶
func (TrainerHTTPClient) MakeHourAvailable ¶
func (TrainerHTTPClient) MakeHourUnavailable ¶
func (c TrainerHTTPClient) MakeHourUnavailable(t *testing.T, hour time.Time)
type TrainingsHTTPClient ¶
type TrainingsHTTPClient struct {
// contains filtered or unexported fields
}
func NewTrainingsHTTPClient ¶
func NewTrainingsHTTPClient(t *testing.T, token string) TrainingsHTTPClient
func (TrainingsHTTPClient) CancelTraining ¶
func (c TrainingsHTTPClient) CancelTraining(t *testing.T, trainingUUID string, expectedStatusCode int)
func (TrainingsHTTPClient) CreateTraining ¶
func (TrainingsHTTPClient) CreateTrainingShouldFail ¶
func (TrainingsHTTPClient) GetTrainings ¶
func (c TrainingsHTTPClient) GetTrainings(t *testing.T) trainings.Trainings
type UsersHTTPClient ¶
type UsersHTTPClient struct {
// contains filtered or unexported fields
}
func NewUsersHTTPClient ¶
func NewUsersHTTPClient(t *testing.T, token string) UsersHTTPClient
func (UsersHTTPClient) GetCurrentUser ¶
func (c UsersHTTPClient) GetCurrentUser(t *testing.T) users.User
Click to show internal directories.
Click to hide internal directories.