test_infra

package module
v0.0.0-...-d284103 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2024 License: MPL-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultId        = "00000000-0000-0000-0000-000000000000"
	UserEmail        = "example@example.com"
	Password         = "password"
	BadPassword      = "passwor"
	Username         = "coolguy1234"
	FirstName        = "John"
	LastName         = "Doe"
	PhoneNumber      = "+1234567890"
	MasjidName       = "Masjid 1"
	EventName        = "Event 1"
	EventDescription = "Some Event"
	LivestreamLink   = "http://example.com"
)

Variables

This section is empty.

Functions

func AssertAdhanFileTimestampsCurrent

func AssertAdhanFileTimestampsCurrent(t *testing.T, a *pb.AdhanFile)

AssertAdhanFileTimestampsCurrent asserts that the create and update timestamps of the event are current. By current, it means that the timestamps are within a range of 1 second from now).

func AssertEventTimestampsCurrent

func AssertEventTimestampsCurrent(t *testing.T, e *pb.Event)

AssertEventTimestampsCurrent asserts that the create and update timestamps of the event are current. By current, it means that the timestamps are within a range of 1 second from now).

func AssertMasjidTimestampsCurrent

func AssertMasjidTimestampsCurrent(t *testing.T, m *pb.Masjid)

AssertMasjidTimestampsCurrent asserts that the create and update timestamps of the masjid are current. By current, it means that the timestamps are within a range of 1 second from now).

func AssertProtoEqual

func AssertProtoEqual(t *testing.T, expected, actual, typ interface{}, ignore cmp.Option)

AssertProtoEqual asserts that two protobufs are equal, ignoring the fields specified in `ignoreFields`. An empty proto needs to be passed in as the `typ` argument.

func AssertUserTimestampsCurrent

func AssertUserTimestampsCurrent(t *testing.T, u *pb.User)

AssertUserTimestampsCurrent asserts that the create and update timestamps of the user are current. By current, it means that the timestamps are within a range of 1 second from now).

func GetAdhanFileProto

func GetAdhanFileProto() *pb.AdhanFile

func GetEventProto

func GetEventProto() *pb.Event

func GetMasjidProto

func GetMasjidProto() *pb.Masjid

func GetUserProto

func GetUserProto(email string, username string) *pb.User

Types

type IntegrationTestSuite

type IntegrationTestSuite struct {
	suite.Suite
	DB                  *gorm.DB
	Server              *grpc.Server
	AdhanServiceClient  pb.AdhanServiceClient
	EventServiceClient  pb.EventServiceClient
	MasjidServiceClient pb.MasjidServiceClient
	UserServiceClient   pb.UserServiceClient
}

func (*IntegrationTestSuite) AfterTest

func (suite *IntegrationTestSuite) AfterTest(suiteName, testName string)

func (*IntegrationTestSuite) BeforeTest

func (suite *IntegrationTestSuite) BeforeTest(suiteName, testName string)

type Resource

type Resource struct {
	CreateTime *timestamppb.Timestamp
	UpdateTime *timestamppb.Timestamp
}

type UnitTestSuite

type UnitTestSuite struct {
	suite.Suite
	StorageManager *storage.StorageManager
}

func (*UnitTestSuite) BeforeTest

func (suite *UnitTestSuite) BeforeTest(suiteName, testName string)

Jump to

Keyboard shortcuts

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