remove_test

package
v0.0.0-...-dcd9214 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExecuteTestCases

func ExecuteTestCases(t *testing.T, testCases []Case, collectionName string,
	newRemoveCmdToTest func(filesys.FileSystem) *cobra.Command)

ExecuteTestCases executes the provided test cases against the specified command for a particular collection (e.g. ) tests a command defined by the provided collection Name (e.g. transformers or resources) and newRemoveCmdToTest function.

Types

type Case

type Case struct {
	// Description is the description of the test case.
	Description string
	// Given is the provided inputs for the test case.
	Given Given
	// Expected is the expected outputs for the test case.
	Expected Expected
}

Case represents a test case to execute.

type Expected

type Expected struct {
	// Expected is the collection of expected output items.
	Items []string
	// Deleted is the collection of expected Deleted items (if any).
	Deleted []string
	// Err represents the error that is expected in the output (if any).
	Err error
}

Expected represents the expected outputs of the test case.

type Given

type Given struct {
	// Items is the given input items.
	Items []string
	// RemoveArgs are the arguments to pass to the remove command.
	RemoveArgs []string
}

Given represents the provided inputs for the test case.

Jump to

Keyboard shortcuts

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