refactor: [shitty claude AI first try] restructure server and user services, add new test cases, and improve error handling

This commit is contained in:
2025-08-10 21:40:15 +03:00
parent 588576b82f
commit f503e45be1
23 changed files with 2568 additions and 134 deletions

View File

@ -0,0 +1,34 @@
package repo
import (
"testing"
"git.logidex.ru/fakz9/logidex-id/internal/api/auth/domain"
"github.com/stretchr/testify/assert"
)
func TestNewAuthRepo(t *testing.T) {
// Test with nil client for interface testing
// In real tests, you would use a mock or test container
repo := NewAuthRepo(nil)
assert.NotNil(t, repo)
assert.Implements(t, (*domain.AuthRepository)(nil), repo)
}
func TestAuthRepo_Interface(t *testing.T) {
// Test that our auth repo implements the domain interface
var _ domain.AuthRepository = (*authRepo)(nil)
// Test constructor returns correct interface
repo := NewAuthRepo(nil)
// Verify interface compliance
assert.Implements(t, (*domain.AuthRepository)(nil), repo)
}
// Note: Actual Redis operations testing requires either:
// 1. Test containers with real Redis
// 2. A simpler interface wrapper around Redis
// 3. A Redis mock library specifically designed for rueidis
// For now, we focus on interface compliance and constructor behavior