Skip to content

Commit

Permalink
Add tests for the GenerateId function
Browse files Browse the repository at this point in the history
  • Loading branch information
Dobefu committed Nov 24, 2024
1 parent f667b38 commit 32023e4
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions cmd/cs_sdk/utils/generate-id_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package utils

import (
"testing"

"github.com/Dobefu/csb/cmd/cs_sdk/structs"
"github.com/stretchr/testify/assert"
)

func TestGenerateId(t *testing.T) {
assert.Equal(t, "testen", GenerateId(structs.Route{Uid: "test", Locale: "en"}))
assert.Equal(t, "testnl-nl", GenerateId(structs.Route{Uid: "test", Locale: "nl-nl"}))
assert.Equal(t, "test", GenerateId(structs.Route{Uid: "test"}))
assert.Equal(t, "en", GenerateId(structs.Route{Locale: "en"}))
}

0 comments on commit 32023e4

Please sign in to comment.