test

package
v0.0.0-...-3e52749 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

README

This directory contains end to end and milestone validation tests.

The directories that are named MileStoneX each contain the end to end test that is used to validate the completion of that milestone.

  • Milestone1: This milestone shows the creation of a CloudChamber simulation, logging in on the admin account, listing the simulated inventory (racks, blades, and the details on the blades), and then logging out.

  • Milestone2: TBD

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Arguments

type Arguments struct {
	mock.Arguments
}

Arguments extends the testify/Arguments type

func (Arguments) BoolIf

func (a Arguments) BoolIf(index int, defValue bool) bool

BoolIf returns the value at the specified index, or the supplied default boolean value, if that argument is not present.

func (Arguments) Count

func (a Arguments) Count() int

Count returns the number of arguments held by this Arguments instance.

func (Arguments) ErrorIf

func (a Arguments) ErrorIf(index int, err error) error

ErrorIf returns the error at the specified index, or the supplied default error value, if that argument is not present.

func (Arguments) GetIf

func (a Arguments) GetIf(index int, defValue interface{}) interface{}

GetIf returns the argument at the specified index, or the supplied default value, if the argument is not present.

func (Arguments) Int64

func (a Arguments) Int64(index int) int64

Int64 returns the argument at the specified index, as an in64 type. It panics if there is no argument at that index, or if it is not of the expected type.

func (Arguments) Int64If

func (a Arguments) Int64If(index int, defValue int64) int64

Int64If returns the value at the specified index, or the supplied default int64 value, if that argument is not present.

func (Arguments) StringIf

func (a Arguments) StringIf(index int, defValue string) string

StringIf returns the value at the specified index, or the supplied default string value, if that argument is not present.

type Mock

type Mock struct {
	mock.Mock
}

Mock extends the testify/Mock type.

func (*Mock) Called

func (m *Mock) Called(args ...interface{}) Arguments

Called overrides the standard Called mock implementation for two purposes. It automatically traces all mock calls for debugging, and it extends the returned Arguments type to support Int64 types, and conditional return values.

func (*Mock) ListUnusedCalls

func (m *Mock) ListUnusedCalls() string

ListUnusedCalls returns a formatted string describing the expected calls that have specific call limits that have not yet been made.

func (*Mock) UnusedExpectedCallCount

func (m *Mock) UnusedExpectedCallCount() int

UnusedExpectedCallCount returns the number of expected calls that were registered via an On call with a specific call limit, via, say, the Once function.

This can be used in a unit test at a known quiet point to verify that calls that the test expects to have been made actually were.

type Require

type Require struct {
	*require.Assertions
}

func (*Require) HTTPRContentTypeEqual

func (rq *Require) HTTPRContentTypeEqual(match string, r *http.Response)

HTTPRContentTypeEqual verifies that the content type attribute in the supplied response object matches the expected string.

func (*Require) HTTPRContentTypeJson

func (rq *Require) HTTPRContentTypeJson(r *http.Response)

HTTPRContentTypeJson verifies that the content type attribute in the supplied response object matches the json specifier ('application/json')

func (*Require) HTTPRContentTypeNotEqual

func (rq *Require) HTTPRContentTypeNotEqual(match string, r *http.Response)

HTTPRContentTypeNotEqual verifies that the content type attribute in the supplied response object does not match the expected string.

func (*Require) HTTPRContentTypeNotJson

func (rq *Require) HTTPRContentTypeNotJson(r *http.Response)

HTTPRContentTypeNotJson verifies that the content type attribute in the supplied response object does not match the json specifier ('application/json')

func (*Require) HTTPRHasCookiesExact

func (rq *Require) HTTPRHasCookiesExact(r *http.Response, matches ...string)

HTTPRHasCookiesExact verifies that the supplied response carries the cookies with the expected names, and no other.

func (*Require) HTTPRStatusEqual

func (rq *Require) HTTPRStatusEqual(status int, r *http.Response)

HTTPRStatusEqual verifies that the HTTP status code in the response matches the expected status.

func (*Require) HTTPRSuccess

func (rq *Require) HTTPRSuccess(r *http.Response)

HTTPRSuccess verifies that the HTTP status code in the response is OK (200).

type Suite

type Suite struct {
	suite.Suite
	// contains filtered or unexported fields
}

Suite contains extensions to the testify Suite package.

func (*Suite) AfterTest

func (ts *Suite) AfterTest()

AfterTest poisons the test name, as a safety operation.

func (*Suite) BeforeTest

func (ts *Suite) BeforeTest(_, name string)

BeforeTest sets up the name of the current test to enable the TestName function.

func (*Suite) Require

func (ts *Suite) Require() *Require

Require returns the extended set of assertions, which include both those provided by the testify package as well as those provided in this module.

func (*Suite) TestName

func (ts *Suite) TestName() string

TestName returns the name of the current test.

Directories

Path Synopsis
Milestone1

Jump to

Keyboard shortcuts

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