tests

package
v0.0.0-...-e3537d7 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2019 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MockUserItemStorage

func MockUserItemStorage() *mongoDB.UserItemStorage

MockUserItemStorage mocks a user's storage in the database

func MockUserSubmissionData

func MockUserSubmissionData() *models.UserSubmission

MockUserSubmissionData mocks a Payload to the POST /userinfo/ endpoint

Types

type ItemInfoTest

type ItemInfoTest struct {
	testing.TestSuite
}

ItemInfoTest is the testing suite for ItemInfo

func (*ItemInfoTest) After

func (t *ItemInfoTest) After()

After tests finishes

func (*ItemInfoTest) Before

func (t *ItemInfoTest) Before()

Before tests initializes

func (*ItemInfoTest) TestIfWebsiteurlCreatesValidURL

func (t *ItemInfoTest) TestIfWebsiteurlCreatesValidURL()

TestIfWebsiteurlCreatesValidURL checks if we're actually creating the correct URL.

func (*ItemInfoTest) TestIfXIVAPIItemEndpointExists

func (t *ItemInfoTest) TestIfXIVAPIItemEndpointExists()

TestIfXIVAPIItemEndpointExists checks if our Item endpoint is still valid.

func (*ItemInfoTest) TestIfXIVAPIRecipeEndpointExists

func (t *ItemInfoTest) TestIfXIVAPIRecipeEndpointExists()

TestIfXIVAPIRecipeEndpointExists checks if our Recipe endpoint is still valid.

type UserInfoResponse

type UserInfoResponse struct {
	UserPrices  map[string]models.UserPrices  `json:"UserPrices"`
	UserProfits map[string]models.UserProfits `json:"UserProfits"`
}

UserInfoResponse is a placeholder to unmarshal the response from /userinfo/Test/recipe/:recipeID

type UserInfoTest

type UserInfoTest struct {
	testing.TestSuite
}

UserInfoTest is a testing Suite for UserInfo

func (*UserInfoTest) After

func (t *UserInfoTest) After()

After shows when tests are completed

func (*UserInfoTest) Before

func (t *UserInfoTest) Before()

Before initializes before our tests runs.

func (*UserInfoTest) TestIfAddUserInfoToMapChangesInfo

func (t *UserInfoTest) TestIfAddUserInfoToMapChangesInfo()

TestIfAddUserInfoToMapChangesInfo checks if we are editing our user's storage.

func (*UserInfoTest) TestIfDatabaseDocumentExistsAfterPOST

func (t *UserInfoTest) TestIfDatabaseDocumentExistsAfterPOST()

TestIfDatabaseDocumentExistsAfterPOST checks if we can obtain data from the database after posting data

func (*UserInfoTest) TestIfPOSTuserinfoSucceeded

func (t *UserInfoTest) TestIfPOSTuserinfoSucceeded()

TestIfPOSTuserinfoSucceeded checks if we can send a proper POST request to the backend server

func (*UserInfoTest) TestQuickSortUserProfits

func (t *UserInfoTest) TestQuickSortUserProfits()

TestQuickSortUserProfits actually sorts our response in descending order.

func (*UserInfoTest) TestifGETuserinfoSucceeded

func (t *UserInfoTest) TestifGETuserinfoSucceeded()

TestifGETuserinfoSucceeded checks if we can send a GET request to the backend server for a user info

Jump to

Keyboard shortcuts

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