utils

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2020 License: MPL-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// utility constants
	LoggerID = "terraform-provider-vra7"
)

terraform provider constants

Variables

This section is empty.

Functions

func AssertContainsString

func AssertContainsString(t *testing.T, expectedSubstring, actual string)

AssertContainsString asserts when the actual string contains the expectedSubString

func AssertEqualsInt

func AssertEqualsInt(t *testing.T, expected, actual int)

AssertEqualsInt asserts when expected and actual integer valus are equal

func AssertEqualsString

func AssertEqualsString(t *testing.T, expected, actual string)

AssertEqualsString asserts when the expected and actual strings are qual

func AssertFalse

func AssertFalse(t *testing.T, message string, expression bool)

AssertFalse asserts when the message is true

func AssertNil

func AssertNil(t *testing.T, obj interface{})

AssertNil asserts when the objectType is nil

func AssertNilError

func AssertNilError(t *testing.T, err error)

AssertNilError asserts when the error is nil

func AssertNotNil

func AssertNotNil(t *testing.T, obj interface{})

AssertNotNil asserts when the objectType is not nil

func AssertNotNilError

func AssertNotNilError(t *testing.T, err error)

AssertNotNilError asserts when the error is not nil

func AssertPrefixString

func AssertPrefixString(t *testing.T, expectedPrefix, actual string)

AssertPrefixString asserts when the actual string contains the prefix expectedPrefix

func AssertStringNotEmpty

func AssertStringNotEmpty(t *testing.T, message, str string)

AssertStringNotEmpty asserts when the string is not empty

func AssertTrue

func AssertTrue(t *testing.T, message string, expression bool)

AssertTrue asserts when the message is true

func ConvertInterfaceToString

func ConvertInterfaceToString(interfaceData interface{}) string

ConvertInterfaceToString cpnverts interface to string

func InitLog

func InitLog()

InitLog - initializes the log

func MarshalToJSON

func MarshalToJSON(v interface{}) (*bytes.Buffer, error)

MarshalToJSON the object to JSON and convert to *bytes.Buffer

func UnmarshalJSON

func UnmarshalJSON(data []byte, v interface{}) error

UnmarshalJSON decodes json

func UnmarshalJSONStringIfNecessary

func UnmarshalJSONStringIfNecessary(field string, value interface{}) interface{}

UnmarshalJSONStringIfNecessary parses value and if it's JSON string, unmarshal it

Types

This section is empty.

Jump to

Keyboard shortcuts

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