open-consul/agent/consul/stream/event_test.go

18 lines
343 B
Go

package stream
import (
"testing"
"github.com/stretchr/testify/require"
)
func TestEvent_IsEndOfSnapshot(t *testing.T) {
e := Event{Payload: endOfSnapshot{}}
require.True(t, e.IsEndOfSnapshot())
t.Run("not EndOfSnapshot", func(t *testing.T) {
e := Event{Payload: newSnapshotToFollow{}}
require.False(t, e.IsEndOfSnapshot())
})
}