Documentation
¶
Overview ¶
Package test has utilities (asserts, mocks, ...) to use cloudevents in your tests
Package test contains test data and generic tests for testing bindings.
Index ¶
- Variables
- func AllVersions(events []event.Event) []event.Event
- func AssertEventContextEquals(t testing.TB, want event.EventContext, have event.EventContext)
- func AssertEventEquals(t testing.TB, want event.Event, have event.Event)
- func ConvertEventExtensionsToString(t testing.TB, e event.Event) event.Event
- func EachEvent(t *testing.T, events []event.Event, f func(*testing.T, event.Event))
- func EachMessage(t *testing.T, messages []binding.Message, f func(*testing.T, binding.Message))
- func Events() []event.Event
- func FullEvent() event.Event
- func MinEvent() event.Event
- func MustJSON(t testing.TB, e event.Event) []byte
- func MustToEvent(t testing.TB, ctx context.Context, m binding.Message) event.Event
- func TestNameOf(x interface{}) string
- func WithoutExtensions(events []event.Event) []event.Event
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func AllVersions ¶
AllVersions returns all versions of each event in events. ID gets a -number suffix so IDs are unique.
func AssertEventContextEquals ¶
func AssertEventContextEquals(t testing.TB, want event.EventContext, have event.EventContext)
AssertEventContextEquals asserts that two event.Event contexts are equals
func AssertEventEquals ¶
AssertEventEquals asserts that two event.Event are equals
func ConvertEventExtensionsToString ¶
ConvertEventExtensionsToString returns a copy of the event.Event where all extensions are converted to strings. Fails the test if conversion fails
func EachMessage ¶
EachMessage runs f as a test for each message in messages
func Events ¶
Events is a set of test events that should be handled correctly by all event-processing code.
func MustToEvent ¶
MustToEvent converts a Message to event.Event
func TestNameOf ¶
func TestNameOf(x interface{}) string
TestNameOf generates a string test name from x, esp. for ce.Event and ce.Message.
Types ¶
This section is empty.