Documentation ¶
Index ¶
- type TD
- func (c *TD) Error(args ...interface{})
- func (c *TD) Errorf(format string, args ...interface{})
- func (c *TD) Fail()
- func (c *TD) FailNow()
- func (c *TD) Failed() bool
- func (c *TD) Fatal(args ...interface{})
- func (c *TD) Fatalf(format string, args ...interface{})
- func (c *TD) Helper()
- func (c *TD) Log(args ...interface{})
- func (c *TD) Logf(format string, args ...interface{})
- func (c *TD) Name() string
- func (c *TD) Parallel()
- func (c *TD) Skip(args ...interface{})
- func (c *TD) SkipNow()
- func (c *TD) Skipf(format string, args ...interface{})
- func (c *TD) Skipped() bool
- type TestCase
- type TestCaseDelegate
- type TestConfig
- type TestingT
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TD ¶
type TD struct { T TestingT // wrapper on testing.T // contains filtered or unexported fields }
TD contains a testdeck test case + statistics to save to the DB later It allows us to capture functionality from testing.T
func Test ¶
func Test(t TestingT, tc TestCaseDelegate, options ...TestConfig) *TD
This method starts the test t is the interface for testing.T tc is the interface for testdeck test cases options is an optional parameter for passing in special test configurations
type TestCase ¶
type TestCase struct { Arrange func(t *TD) // setup stage before the test Act func(t *TD) // the code you actually want to test Assert func(t *TD) // the outcomes you want to verify After func(t *TD) // clean-up steps deferrer.DefaultDeferrer // deferred steps that you want to run after clean-up }
A struct that represents a testdeck test case
func (*TestCase) AfterMethod ¶
func (*TestCase) AssertMethod ¶
type TestCaseDelegate ¶
type TestCaseDelegate interface { ArrangeMethod(t *TD) ActMethod(t *TD) AssertMethod(t *TD) AfterMethod(t *TD) }
An interface for testdeck test cases; it is implemented by the TestCase struct below
type TestConfig ¶
type TestConfig struct { // tests run in parallel by default but you can force it to run in sequential by using ParallelOff = true ParallelOff bool }
TestConfig is for passing special configurations for the test case
type TestingT ¶
type TestingT interface { Error(args ...interface{}) Errorf(format string, args ...interface{}) Fail() FailNow() Failed() bool Fatal(args ...interface{}) Fatalf(format string, args ...interface{}) Log(args ...interface{}) Logf(format string, args ...interface{}) Name() string Skip(args ...interface{}) SkipNow() Skipf(format string, args ...interface{}) Skipped() bool Helper() Parallel() }
methods from testing.T
Click to show internal directories.
Click to hide internal directories.