* Implement Startable and Stoppable lifecycle interfaces * Refactor tests: remove redundant method overrides in MockLifecycle --------- Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
18 lines
380 B
Go
18 lines
380 B
Go
package core
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestNewWithFactories_EmptyName(t *testing.T) {
|
|
factories := map[string]ServiceFactory{
|
|
"": func() (any, error) {
|
|
return &MockService{Name: "test"}, nil
|
|
},
|
|
}
|
|
_, err := NewWithFactories(nil, factories)
|
|
assert.Error(t, err)
|
|
assert.Contains(t, err.Error(), "service name cannot be empty")
|
|
}
|