tests

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

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

Go to latest
Published: Aug 19, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitBaseSuite

func InitBaseSuite[T BaseSuiteInterface](realSuite T)

func InitBaseSuiteWithServer

func InitBaseSuiteWithServer[T BaseSuiteWithServerInterface](srv T)

Types

type BaseSuite

type BaseSuite struct {
	suite.Suite
	Repository *repositories.Repository
}

func (*BaseSuite) GetRepository

func (suite *BaseSuite) GetRepository() *repositories.Repository

func (*BaseSuite) SetRepository

func (suite *BaseSuite) SetRepository(repo *repositories.Repository)

func (*BaseSuite) SetupTest

func (suite *BaseSuite) SetupTest()

func (*BaseSuite) TearDownTest

func (suite *BaseSuite) TearDownTest()

type BaseSuiteInterface

type BaseSuiteInterface interface {
	HasLifecycleMethods
	HasRepo
}

type BaseSuiteWithServer

type BaseSuiteWithServer struct {
	BaseSuite
	TestHTTPServer
}

func (*BaseSuiteWithServer) GetRepository

func (s *BaseSuiteWithServer) GetRepository() *repositories.Repository

func (*BaseSuiteWithServer) GetServer

func (s *BaseSuiteWithServer) GetServer() *httptest.Server

func (*BaseSuiteWithServer) SetRepository

func (s *BaseSuiteWithServer) SetRepository(repo *repositories.Repository)

func (*BaseSuiteWithServer) SetServer

func (s *BaseSuiteWithServer) SetServer(srv *httptest.Server)

type BaseSuiteWithServerInterface

type BaseSuiteWithServerInterface interface {
	BaseSuiteInterface
	HasServer
}

type HasLifecycleMethods

type HasLifecycleMethods interface {
	SetupTest()
	TearDownTest()
}

type HasRepo

type HasRepo interface {
	SetRepository(repo *repositories.Repository)
	GetRepository() *repositories.Repository
}

type HasServer

type HasServer interface {
	SetServer(srv *httptest.Server)
	GetServer() *httptest.Server
}

type TestHTTPServer

type TestHTTPServer struct {
	Server *httptest.Server
}

Jump to

Keyboard shortcuts

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