di/registry/registry_test.go
crusader 4a4e7cdfdd ing
2017-12-05 22:28:42 +09:00

19 lines
370 B
Go

package registry
import (
"reflect"
"testing"
cda "git.loafle.net/commons_go/di/annotation"
)
func TestRegisterType(t *testing.T) {
RegisterType(reflect.TypeOf((*TestStruct)(nil)), &cda.ComponentAnnotation{})
}
type TestStruct struct {
Name1 string `annotation:"@Inject"`
Name2 string `annotation:"@Inject()"`
Name3 string `annotation:"@Inject(name=test)"`
}