-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinterface_test.go
More file actions
39 lines (31 loc) · 1.16 KB
/
interface_test.go
File metadata and controls
39 lines (31 loc) · 1.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package task_engine
import (
"io"
"log/slog"
"testing"
"github.com/stretchr/testify/suite"
)
// InterfaceTestSuite tests the interface implementations
type InterfaceTestSuite struct {
suite.Suite
}
// TestInterfaceTestSuite runs the Interface test suite
func TestInterfaceTestSuite(t *testing.T) {
suite.Run(t, new(InterfaceTestSuite))
}
// TestTaskManagerImplementsInterface verifies that TaskManager implements TaskManagerInterface
func (suite *InterfaceTestSuite) TestTaskManagerImplementsInterface() {
var _ TaskManagerInterface = (*TaskManager)(nil)
}
// TestTaskImplementsInterface verifies that Task implements TaskInterface
func (suite *InterfaceTestSuite) TestTaskImplementsInterface() {
var _ TaskInterface = (*Task)(nil)
}
// TestNewTaskManagerCreatesValidInterface verifies that NewTaskManager returns a valid TaskManagerInterface
func (suite *InterfaceTestSuite) TestNewTaskManagerCreatesValidInterface() {
// Use a discard logger to prevent test output
discardLogger := slog.New(slog.NewTextHandler(io.Discard, nil))
taskManager := NewTaskManager(discardLogger)
// This should compile and run without errors
var _ TaskManagerInterface = taskManager
}