MCPcopy Create free account
hub / github.com/astercloud/aster / TestNewEventBusWithConfig

Function TestNewEventBusWithConfig

pkg/events/bus_test.go:22–34  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

20}
21
22func TestNewEventBusWithConfig(t *testing.T) {
23 config := &EventBusConfig{
24 MaxTimelineSize: 100,
25 MaxTimelineAge: 10 * time.Minute,
26 CleanupInterval: 1 * time.Minute,
27 }
28 eb := NewEventBusWithConfig(config)
29 defer eb.Close()
30
31 if eb.config.MaxTimelineSize != 100 {
32 t.Errorf("expected MaxTimelineSize 100, got %d", eb.config.MaxTimelineSize)
33 }
34}
35
36func TestEmitAndSubscribe(t *testing.T) {
37 eb := NewEventBus()

Callers

nothing calls this directly

Calls 2

NewEventBusWithConfigFunction · 0.85
CloseMethod · 0.65

Tested by

no test coverage detected