From 23bfed3b611c10d0bb8d0faa2b0dc07e786a486f Mon Sep 17 00:00:00 2001 From: Your Name Date: Fri, 29 May 2026 20:29:08 +0800 Subject: [PATCH] test: add domain LoginType constants test Add test for LoginType enum constants: - LoginTypePassword (1) - LoginTypeEmailCode (2) - LoginTypeSMSCode (3) - LoginTypeOAuth (4) --- internal/domain/model_test.go | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 internal/domain/model_test.go diff --git a/internal/domain/model_test.go b/internal/domain/model_test.go new file mode 100644 index 0000000..dc18e12 --- /dev/null +++ b/internal/domain/model_test.go @@ -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)) + }) + } +}