Documentation ¶
Overview ¶
Package testfixture provides an implementation of testing.FixtureImpl to be used in unit tests.
Index ¶
- type Fixture
- func (f *Fixture) PostTest(ctx context.Context, s *testing.FixtTestState)
- func (f *Fixture) PreTest(ctx context.Context, s *testing.FixtTestState)
- func (f *Fixture) Reset(ctx context.Context) error
- func (f *Fixture) SetUp(ctx context.Context, s *testing.FixtState) interface{}
- func (f *Fixture) TearDown(ctx context.Context, s *testing.FixtState)
- type Option
- func WithPostTest(f func(ctx context.Context, s *testing.FixtTestState)) Option
- func WithPreTest(f func(ctx context.Context, s *testing.FixtTestState)) Option
- func WithReset(f func(ctx context.Context) error) Option
- func WithSetUp(f func(ctx context.Context, s *testing.FixtState) interface{}) Option
- func WithTearDown(f func(ctx context.Context, s *testing.FixtState)) Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Fixture ¶
type Fixture struct {
// contains filtered or unexported fields
}
Fixture is a customizable implementation of testing.FixtureImpl.
func (*Fixture) PostTest ¶
func (f *Fixture) PostTest(ctx context.Context, s *testing.FixtTestState)
PostTest implements the fixture lifecycle method by a user-supplied callback.
func (*Fixture) PreTest ¶
func (f *Fixture) PreTest(ctx context.Context, s *testing.FixtTestState)
PreTest implements the fixture lifecycle method by a user-supplied callback.
type Option ¶
type Option func(tf *Fixture)
Option is an option passed to New to customize a constructed Fixture.
func WithPostTest ¶
func WithPostTest(f func(ctx context.Context, s *testing.FixtTestState)) Option
WithPostTest returns an option to set a function called back on PostTest.
func WithPreTest ¶
func WithPreTest(f func(ctx context.Context, s *testing.FixtTestState)) Option
WithPreTest returns an option to set a function called back on PreTest.
Click to show internal directories.
Click to hide internal directories.