|
|
@ -11,12 +11,11 @@ func TestEventManager(t *testing.T) { |
|
|
|
eventManager := NewEventManager() |
|
|
|
|
|
|
|
// We need to make this buffer at least 1, otherwise we will log an error!
|
|
|
|
testChan := make(chan Event, 1) |
|
|
|
simpleQueue := NewQueue() |
|
|
|
eventManager.Subscribe("TEST", simpleQueue) |
|
|
|
eventManager.Publish(Event{EventType: "TEST", Data: map[Field]string{"Value": "Hello World"}}) |
|
|
|
|
|
|
|
event := <-testChan |
|
|
|
event := simpleQueue.Next() |
|
|
|
if event.EventType == "TEST" && event.Data["Value"] == "Hello World" { |
|
|
|
|
|
|
|
} else { |
|
|
|