Documentation ¶
Index ¶
- type JSONSerializationTestCase
- func (o *JSONSerializationTestCase) AsFuncs(_ astmodel.TypeName, genContext *astmodel.CodeGenerationContext) ([]dst.Decl, error)
- func (o *JSONSerializationTestCase) Equals(other astmodel.TestCase, overrides astmodel.EqualityOverrides) bool
- func (o *JSONSerializationTestCase) Name() string
- func (o *JSONSerializationTestCase) References() astmodel.TypeNameSet
- func (o *JSONSerializationTestCase) RequiredImports() *astmodel.PackageImportSet
- func (o *JSONSerializationTestCase) SetMinSuccessfulTests(minSuccessfulTests int)
- func (o *JSONSerializationTestCase) Subject() *dst.Ident
- type PropertyAssignmentTestCase
- func (p *PropertyAssignmentTestCase) AsFuncs(receiver astmodel.TypeName, ...) ([]dst.Decl, error)
- func (p *PropertyAssignmentTestCase) Equals(other astmodel.TestCase, override astmodel.EqualityOverrides) bool
- func (p *PropertyAssignmentTestCase) Name() string
- func (p *PropertyAssignmentTestCase) References() astmodel.TypeNameSet
- func (p *PropertyAssignmentTestCase) RequiredImports() *astmodel.PackageImportSet
- type ResourceConversionTestCase
- func (tc *ResourceConversionTestCase) AsFuncs(receiver astmodel.TypeName, ...) ([]dst.Decl, error)
- func (tc *ResourceConversionTestCase) Equals(other astmodel.TestCase, override astmodel.EqualityOverrides) bool
- func (tc *ResourceConversionTestCase) Name() string
- func (tc *ResourceConversionTestCase) References() astmodel.TypeNameSet
- func (tc *ResourceConversionTestCase) RequiredImports() *astmodel.PackageImportSet
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 ¶
func (o *JSONSerializationTestCase) AsFuncs( _ astmodel.TypeName, genContext *astmodel.CodeGenerationContext, ) ([]dst.Decl, error)
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 ¶
func (o *JSONSerializationTestCase) Equals(other astmodel.TestCase, overrides astmodel.EqualityOverrides) bool
Equals determines if this TestCase is equal to another one
func (*JSONSerializationTestCase) Name ¶
func (o *JSONSerializationTestCase) Name() string
Name returns the unique name of this test case
func (*JSONSerializationTestCase) References ¶
func (o *JSONSerializationTestCase) References() astmodel.TypeNameSet
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 ¶
func (p *PropertyAssignmentTestCase) Equals(other astmodel.TestCase, override astmodel.EqualityOverrides) bool
Equals determines if this TestCase is equal to another one
func (*PropertyAssignmentTestCase) Name ¶
func (p *PropertyAssignmentTestCase) Name() string
Name returns the unique name of this test case
func (*PropertyAssignmentTestCase) References ¶
func (p *PropertyAssignmentTestCase) References() astmodel.TypeNameSet
References returns the set of types to which this test case refers.
func (*PropertyAssignmentTestCase) RequiredImports ¶
func (p *PropertyAssignmentTestCase) RequiredImports() *astmodel.PackageImportSet
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 ¶
func (tc *ResourceConversionTestCase) Equals(other astmodel.TestCase, override astmodel.EqualityOverrides) bool
Equals determines if this TestCase is equal to another one
func (*ResourceConversionTestCase) Name ¶
func (tc *ResourceConversionTestCase) Name() string
Name returns the unique name of this test case
func (*ResourceConversionTestCase) References ¶
func (tc *ResourceConversionTestCase) References() astmodel.TypeNameSet
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