mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-12 07:17:34 +00:00
chore: move the go code into a subfolder
This commit is contained in:
42
apps/api/internal/domain/user_agent_test.go
Normal file
42
apps/api/internal/domain/user_agent_test.go
Normal file
@@ -0,0 +1,42 @@
|
||||
package domain
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/muhlemmer/gu"
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestUserAgent_GetFingerprintID(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
fields *UserAgent
|
||||
want string
|
||||
}{
|
||||
{
|
||||
name: "nil useragent",
|
||||
fields: nil,
|
||||
want: "",
|
||||
},
|
||||
{
|
||||
name: "nil fingerprintID",
|
||||
fields: &UserAgent{
|
||||
FingerprintID: nil,
|
||||
},
|
||||
want: "",
|
||||
},
|
||||
{
|
||||
name: "value",
|
||||
fields: &UserAgent{
|
||||
FingerprintID: gu.Ptr("fp"),
|
||||
},
|
||||
want: "fp",
|
||||
},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
got := tt.fields.GetFingerprintID()
|
||||
assert.Equal(t, tt.want, got)
|
||||
})
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user