testcases

package
v0.0.0-...-8ad424e Latest Latest
Warning

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

Go to latest
Published: May 1, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JSONSerializationTestCase

type JSONSerializationTestCase struct {
	// contains filtered or unexported fields
}

JSONSerializationTestCase represents a test that the object can be losslessly serialized to JSON and back again

func NewJSONSerializationTestCase

func NewJSONSerializationTestCase(
	name astmodel.TypeName,
	container astmodel.PropertyContainer,
	isOneOf bool,
	idFactory astmodel.IdentifierFactory,
) *JSONSerializationTestCase

NewJSONSerializationTestCase creates a new test case for the JSON serialization round-trip-ability of the specified object type

func (*JSONSerializationTestCase) AsFuncs

AsFuncs renders the current test case and supporting methods as Go abstract syntax trees subject is the name of the type under test codeGenerationContext contains reference material to use when generating

func (*JSONSerializationTestCase) Equals

Equals determines if this TestCase is equal to another one

func (*JSONSerializationTestCase) Name

Name returns the unique name of this test case

func (*JSONSerializationTestCase) References

References returns the set of types to which this test case refers.

func (*JSONSerializationTestCase) RequiredImports

func (o *JSONSerializationTestCase) RequiredImports() *astmodel.PackageImportSet

RequiredImports returns a set of the package imports required by this test case

func (*JSONSerializationTestCase) SetMinSuccessfulTests

func (o *JSONSerializationTestCase) SetMinSuccessfulTests(minSuccessfulTests int)

SetMinSuccessfulTests configures the minimum number of successful tests required for this test case

func (*JSONSerializationTestCase) Subject

func (o *JSONSerializationTestCase) Subject() *dst.Ident

type PropertyAssignmentTestCase

type PropertyAssignmentTestCase struct {
	// contains filtered or unexported fields
}

PropertyAssignmentTestCase represents a test that verifies we can convert from one object in our conversion graph to the next one, and back again, with no loss of data (lossless conversion via the PropertyBag)

func NewPropertyAssignmentTestCase

func NewPropertyAssignmentTestCase(
	name astmodel.TypeName,
	container astmodel.FunctionContainer,
	idFactory astmodel.IdentifierFactory,
) *PropertyAssignmentTestCase

func (*PropertyAssignmentTestCase) AsFuncs

func (p *PropertyAssignmentTestCase) AsFuncs(
	receiver astmodel.TypeName,
	codeGenerationContext *astmodel.CodeGenerationContext,
) ([]dst.Decl, error)

AsFuncs renders the current test case and any supporting methods as Go abstract syntax trees subject is the name of the type under test codeGenerationContext contains reference material to use when generating

func (*PropertyAssignmentTestCase) Equals

Equals determines if this TestCase is equal to another one

func (*PropertyAssignmentTestCase) Name

Name returns the unique name of this test case

func (*PropertyAssignmentTestCase) References

References returns the set of types to which this test case refers.

func (*PropertyAssignmentTestCase) RequiredImports

RequiredImports returns a set of the package imports required by this test case

type ResourceConversionTestCase

type ResourceConversionTestCase struct {
	// contains filtered or unexported fields
}

ResourceConversionTestCase represents a test that verifies we can convert from one resource to the hub resource (based on our conversion graph), and back again, with no loss of data (lossless conversion via the PropertyBag). This will be a multistep conversion, building on the PropertyAssignment functions.

func NewResourceConversionTestCase

func NewResourceConversionTestCase(
	name astmodel.TypeName,
	resourceType *astmodel.ResourceType,
	idFactory astmodel.IdentifierFactory,
) (*ResourceConversionTestCase, error)

NewResourceConversionTestCase creates a new test case for the specified resource

func (*ResourceConversionTestCase) AsFuncs

func (tc *ResourceConversionTestCase) AsFuncs(
	receiver astmodel.TypeName,
	codeGenerationContext *astmodel.CodeGenerationContext,
) ([]dst.Decl, error)

AsFuncs renders the current test case and any supporting methods as Go abstract syntax trees subject is the name of the type under test codeGenerationContext contains reference material to use when generating

func (*ResourceConversionTestCase) Equals

Equals determines if this TestCase is equal to another one

func (*ResourceConversionTestCase) Name

Name returns the unique name of this test case

func (*ResourceConversionTestCase) References

References returns the set of types to which this test case refers.

func (*ResourceConversionTestCase) RequiredImports

func (tc *ResourceConversionTestCase) RequiredImports() *astmodel.PackageImportSet

RequiredImports returns a set of the package imports required by this test case

Jump to

Keyboard shortcuts

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