31 lines
888 B
Go
31 lines
888 B
Go
|
|
package service
|
||
|
|
|
||
|
|
import (
|
||
|
|
"testing"
|
||
|
|
"time"
|
||
|
|
)
|
||
|
|
|
||
|
|
// =============================================================================
|
||
|
|
// Email Configuration Tests
|
||
|
|
// =============================================================================
|
||
|
|
|
||
|
|
func TestDefaultEmailCodeConfig(t *testing.T) {
|
||
|
|
cfg := DefaultEmailCodeConfig()
|
||
|
|
|
||
|
|
if cfg.CodeTTL != 5*time.Minute {
|
||
|
|
t.Errorf("CodeTTL = %v, want %v", cfg.CodeTTL, 5*time.Minute)
|
||
|
|
}
|
||
|
|
if cfg.ResendCooldown != time.Minute {
|
||
|
|
t.Errorf("ResendCooldown = %v, want %v", cfg.ResendCooldown, time.Minute)
|
||
|
|
}
|
||
|
|
if cfg.MaxDailyLimit != 10 {
|
||
|
|
t.Errorf("MaxDailyLimit = %d, want 10", cfg.MaxDailyLimit)
|
||
|
|
}
|
||
|
|
if cfg.SiteURL != "http://localhost:8080" {
|
||
|
|
t.Errorf("SiteURL = %q, want %q", cfg.SiteURL, "http://localhost:8080")
|
||
|
|
}
|
||
|
|
if cfg.SiteName != "User Management System" {
|
||
|
|
t.Errorf("SiteName = %q, want %q", cfg.SiteName, "User Management System")
|
||
|
|
}
|
||
|
|
}
|