Documentation ¶
Index ¶
- type AllDeleter
- type AllDeleterSubject
- type AllFinder
- type AllFinderSubject
- type ByIDDeleter
- type ByIDDeleterSubject
- type ByIDFinder
- type ByIDFinderSubject
- type Creator
- type CreatorSubject
- type Deleter
- type DeleterSubject
- type FindOne
- type FindOneSubject
- type Finder
- type FinderSubject
- type OnePhaseCommitProtocol
- type OnePhaseCommitProtocolSubject
- type Purger
- type PurgerSubject
- type QueryOne
- type Updater
- type UpdaterSubject
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AllDeleter ¶ added in v0.84.0
type AllDeleter[Ent, ID any] struct { Subject func(testing.TB) AllDeleterSubject[Ent, ID] MakeCtx func(testing.TB) context.Context MakeEnt func(testing.TB) Ent }
func (AllDeleter[Ent, ID]) Benchmark ¶ added in v0.84.0
func (c AllDeleter[Ent, ID]) Benchmark(b *testing.B)
func (AllDeleter[Ent, ID]) Spec ¶ added in v0.84.0
func (c AllDeleter[Ent, ID]) Spec(s *testcase.Spec)
func (AllDeleter[Ent, ID]) Test ¶ added in v0.84.0
func (c AllDeleter[Ent, ID]) Test(t *testing.T)
type AllDeleterSubject ¶ added in v0.84.0
type AllDeleterSubject[Ent, ID any] interface { spechelper.CRD[Ent, ID] crud.AllDeleter }
type AllFinder ¶ added in v0.84.0
type AllFinder[Ent, ID any] struct { Subject func(testing.TB) AllFinderSubject[Ent, ID] Context func(testing.TB) context.Context MakeEnt func(testing.TB) Ent }
AllFinder can return business entities from a given resource that implement it's test The "EntityTypeName" is a Empty struct for the specific entity (struct) type that should be returned.
NewEntityForTest used only for testing and should not be provided outside of testing
type AllFinderSubject ¶ added in v0.84.0
type AllFinderSubject[Ent, ID any] interface { spechelper.CRD[Ent, ID] crud.AllFinder[Ent, ID] }
type ByIDDeleter ¶ added in v0.84.0
type ByIDDeleter[Ent, ID any] struct { Subject func(testing.TB) ByIDDeleterSubject[Ent, ID] MakeCtx func(testing.TB) context.Context MakeEnt func(testing.TB) Ent }
func (ByIDDeleter[Ent, ID]) Benchmark ¶ added in v0.84.0
func (c ByIDDeleter[Ent, ID]) Benchmark(b *testing.B)
func (ByIDDeleter[Ent, ID]) Spec ¶ added in v0.84.0
func (c ByIDDeleter[Ent, ID]) Spec(s *testcase.Spec)
func (ByIDDeleter[Ent, ID]) Test ¶ added in v0.84.0
func (c ByIDDeleter[Ent, ID]) Test(t *testing.T)
type ByIDDeleterSubject ¶ added in v0.84.0
type ByIDDeleterSubject[Ent, ID any] spechelper.CRD[Ent, ID]
type ByIDFinder ¶ added in v0.84.0
type ByIDFinder[Ent, ID any] struct { Subject func(testing.TB) ByIDFinderSubject[Ent, ID] Context func(testing.TB) context.Context MakeEnt func(testing.TB) Ent }
func (ByIDFinder[Ent, ID]) Benchmark ¶ added in v0.84.0
func (c ByIDFinder[Ent, ID]) Benchmark(b *testing.B)
func (ByIDFinder[Ent, ID]) Name ¶ added in v0.84.0
func (c ByIDFinder[Ent, ID]) Name() string
func (ByIDFinder[Ent, ID]) Spec ¶ added in v0.84.0
func (c ByIDFinder[Ent, ID]) Spec(s *testcase.Spec)
func (ByIDFinder[Ent, ID]) Test ¶ added in v0.84.0
func (c ByIDFinder[Ent, ID]) Test(t *testing.T)
type ByIDFinderSubject ¶ added in v0.84.0
type ByIDFinderSubject[Ent, ID any] spechelper.CRD[Ent, ID]
type Creator ¶
type CreatorSubject ¶
type CreatorSubject[Ent, ID any] spechelper.CRD[Ent, ID]
type Deleter ¶
type DeleterSubject ¶
type DeleterSubject[Ent, ID any] interface { AllDeleterSubject[Ent, ID] ByIDDeleterSubject[Ent, ID] }
type FindOne ¶
type FindOne[Ent, ID any] struct { Subject func(testing.TB) FindOneSubject[Ent, ID] MakeCtx func(testing.TB) context.Context MakeEnt func(testing.TB) Ent // MethodName is the name of the test subject QueryOne method of this contract specification. MethodName string // ToQuery takes an entity ptr and returns with a closure that has the knowledge about how to query on the Subject resource to find the entity. // // By convention, any preparation action that affect the resource must take place prior to returning the closure. // The QueryOne closure should only have the Method call with the already mapped values. // ToQuery will be evaluated in the beginning of the testing, // and executed after all the test Context preparation is done. ToQuery func(tb testing.TB, resource FindOneSubject[Ent, ID], ent Ent) QueryOne[Ent] // Specify allow further specification describing for a given FindOne query function. // If none specified, this field will be ignored Specify func(testing.TB) }
type FindOneSubject ¶ added in v0.84.0
type FindOneSubject[Ent, ID any] spechelper.CRD[Ent, ID]
type Finder ¶
type FinderSubject ¶
type FinderSubject[Ent, ID any] interface { ByIDFinderSubject[Ent, ID] AllFinderSubject[Ent, ID] }
type OnePhaseCommitProtocol ¶ added in v0.72.0
type OnePhaseCommitProtocol[Ent, ID any] struct { Subject func(testing.TB) OnePhaseCommitProtocolSubject[Ent, ID] MakeCtx func(testing.TB) context.Context MakeEnt func(testing.TB) Ent }
func (OnePhaseCommitProtocol[Ent, ID]) Benchmark ¶ added in v0.72.0
func (c OnePhaseCommitProtocol[Ent, ID]) Benchmark(b *testing.B)
func (OnePhaseCommitProtocol[Ent, ID]) Spec ¶ added in v0.72.0
func (c OnePhaseCommitProtocol[Ent, ID]) Spec(s *testcase.Spec)
func (OnePhaseCommitProtocol[Ent, ID]) Test ¶ added in v0.72.0
func (c OnePhaseCommitProtocol[Ent, ID]) Test(t *testing.T)
type OnePhaseCommitProtocolSubject ¶ added in v0.72.0
type OnePhaseCommitProtocolSubject[Ent, ID any] struct { Resource spechelper.CRD[Ent, ID] CommitManager comproto.OnePhaseCommitProtocol }
type Purger ¶
type PurgerSubject ¶
type PurgerSubject[Ent, ID any] interface { spechelper.CRD[Ent, ID] crud.Purger }
type QueryOne ¶
QueryOne is the generic representation of a query that meant to find one result. It is really similar to resources.Finder#FindByID, with the exception that the closure meant to know the query method name on the subject and the inputs it requires.
QueryOne is generated through ToQuery factory function in FindOne resource contract specification.
type Updater ¶
type Updater[Ent any, ID any] struct { Subject func(testing.TB) UpdaterSubject[Ent, ID] MakeCtx func(testing.TB) context.Context MakeEnt func(testing.TB) Ent // ChangeEnt is an optional option that allows fine control over // what will be changed on an Entity during the test of Update method. ChangeEnt func(testing.TB, *Ent) }
Updater will request an update for a wrapped entity object in the Resource