package testutil import ( "context" graph "tercul/internal/adapters/graphql" "tercul/internal/app/work" "tercul/internal/domain" "github.com/stretchr/testify/suite" ) // SimpleTestSuite provides a minimal test environment with just the essentials type SimpleTestSuite struct { suite.Suite WorkRepo *UnifiedMockWorkRepository WorkCommands *work.WorkCommands WorkQueries *work.WorkQueries MockAnalyzer *MockAnalyzer } // MockAnalyzer is a mock implementation of the analyzer interface. type MockAnalyzer struct{} // AnalyzeWork is the mock implementation of the AnalyzeWork method. func (m *MockAnalyzer) AnalyzeWork(ctx context.Context, workID uint) error { return nil } // SetupSuite sets up the test suite func (s *SimpleTestSuite) SetupSuite() { s.WorkRepo = NewUnifiedMockWorkRepository() s.MockAnalyzer = &MockAnalyzer{} s.WorkCommands = work.NewWorkCommands(s.WorkRepo, s.MockAnalyzer) s.WorkQueries = work.NewWorkQueries(s.WorkRepo) } // SetupTest resets test data for each test func (s *SimpleTestSuite) SetupTest() { s.WorkRepo.Reset() } // GetResolver returns a minimal GraphQL resolver for testing func (s *SimpleTestSuite) GetResolver() *graph.Resolver { // This needs to be updated to reflect the new resolver structure // For now, we'll return a resolver with the work commands and queries return &graph.Resolver{ // WorkRepo: s.WorkRepo, // This should be removed from resolver // WorkService: s.WorkService, // This is replaced by commands/queries } } // CreateTestWork creates a test work with optional content func (s *SimpleTestSuite) CreateTestWork(title, language string, content string) *domain.Work { work := &domain.Work{ Title: title, Language: language, } // Add work to the mock repository s.WorkRepo.AddWork(work) // If content is provided, we'll need to handle it differently // since the mock repository doesn't support translations yet // For now, just return the work return work }