-
Notifications
You must be signed in to change notification settings - Fork 17
/
message_test.go
27 lines (18 loc) · 689 Bytes
/
message_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
//go:build unit
package goengine_test
import (
"testing"
"github.com/stretchr/testify/assert"
"github.com/hellofresh/goengine/v2"
)
func TestGenerateUUID(t *testing.T) {
zeroID := goengine.UUID([16]byte{})
asserts := assert.New(t)
firstID := goengine.GenerateUUID()
asserts.NotEmpty(firstID, "A goengine.UUID should not be empty")
asserts.NotEqual(zeroID, firstID, "A goengine.UUID should not be zero")
secondID := goengine.GenerateUUID()
asserts.NotEmpty(secondID, "A goengine.UUID should not be empty")
asserts.NotEqual(zeroID, secondID, "A goengine.UUID should not be zero")
asserts.NotEqual(firstID, secondID, "Expected GenerateUUID() to return a different ID")
}