mirror of
https://github.com/netbirdio/netbird.git
synced 2025-03-13 06:08:48 +01:00
29 lines
477 B
Go
29 lines
477 B
Go
package flowstore_test
|
|
|
|
import (
|
|
"context"
|
|
"testing"
|
|
|
|
"github.com/netbirdio/netbird/client/internal/flowstore"
|
|
)
|
|
|
|
func TestStore(t *testing.T) {
|
|
store := flowstore.New(context.Background())
|
|
t.Cleanup(func() {
|
|
store.Close()
|
|
})
|
|
|
|
event := flowstore.Event{
|
|
ID: "1",
|
|
FlowID: "1",
|
|
}
|
|
|
|
store.StoreEvent(event)
|
|
allEvents := store.GetEvents()
|
|
for _, e := range allEvents {
|
|
if e.ID != event.ID {
|
|
t.Errorf("expected event ID %s, got %s", event.ID, e.ID)
|
|
}
|
|
}
|
|
}
|