test: add domain LoginType constants test
Add test for LoginType enum constants: - LoginTypePassword (1) - LoginTypeEmailCode (2) - LoginTypeSMSCode (3) - LoginTypeOAuth (4)
This commit is contained in:
26
internal/domain/model_test.go
Normal file
26
internal/domain/model_test.go
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
package domain
|
||||||
|
|
||||||
|
import (
|
||||||
|
"testing"
|
||||||
|
|
||||||
|
"github.com/stretchr/testify/assert"
|
||||||
|
)
|
||||||
|
|
||||||
|
func TestLoginTypeConstants(t *testing.T) {
|
||||||
|
tests := []struct {
|
||||||
|
loginType LoginType
|
||||||
|
expected int
|
||||||
|
name string
|
||||||
|
}{
|
||||||
|
{LoginTypePassword, 1, "Password"},
|
||||||
|
{LoginTypeEmailCode, 2, "EmailCode"},
|
||||||
|
{LoginTypeSMSCode, 3, "SMSCode"},
|
||||||
|
{LoginTypeOAuth, 4, "OAuth"},
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, tt := range tests {
|
||||||
|
t.Run(tt.name, func(t *testing.T) {
|
||||||
|
assert.Equal(t, tt.expected, int(tt.loginType))
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user