test

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2023 License: MIT Imports: 12 Imported by: 0

README

Equinox tests

Integration

Integration tests are meant to be run manually.

The objective of these tests is to test some methods from different games against the live Riot Games API, making sure the different http methods are working as intended.

Run tests using:

RIOT_GAMES_API_KEY=RGAPI... go test -v -tags=integration ./test/integration

or if using PowerShell:

$env:RIOT_GAMES_API_KEY="RGAPI..."; go test -v -tags=integration ./test/integration; Remove-Item Env:RIOT_GAMES_API_KEY

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TestingNewLOLClient

func TestingNewLOLClient() (*lol.LOLClient, error)

func TestingNewLORClient

func TestingNewLORClient() (*lor.LORClient, error)

func TestingNewRiotClient

func TestingNewRiotClient() (*riot.RiotClient, error)

func TestingNewTFTClient

func TestingNewTFTClient() (*tft.TFTClient, error)

func TestingNewVALClient

func TestingNewVALClient() (*val.VALClient, error)

Types

type TestCase

type TestCase[Model any, Parameters any] struct {
	Name        string
	Code        int
	Want        *Model
	WantError   error
	AccessToken string
	Parameters  *Parameters
	Options     map[string]interface{}
}

func GetEndpointTestCases

func GetEndpointTestCases[Model any, Parameters any](model Model, parameters *Parameters) []TestCase[Model, Parameters]

func (TestCase[Model, Parameters]) CheckResponse

func (testCase TestCase[Model, Parameters]) CheckResponse(t *testing.T, gotData *Model, gotErr error)

func (TestCase[Model, Parameters]) MockGetResponse

func (testCase TestCase[Model, Parameters]) MockGetResponse(url string, region string, accessToken string)

func (TestCase[Model, Parameters]) MockPostResponse

func (testCase TestCase[Model, Parameters]) MockPostResponse(url string, region string, accessToken string)

Directories

Path Synopsis
This package only contains integration tests.
This package only contains integration tests.

Jump to

Keyboard shortcuts

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