package container
|
|
|
|
import (
|
|
"testing"
|
|
)
|
|
|
|
func TestElementHandler_New(t *testing.T) {
|
|
|
|
elementHandler := NewElementHandler(serviceInstance)
|
|
if elementHandler == nil {
|
|
t.Fatalf("创建失败!")
|
|
}
|
|
if elementHandler.instance != serviceInstance {
|
|
t.Fatalf("设置实例错误!")
|
|
}
|
|
}
|
|
|
|
func TestElementHandler_Instance(t *testing.T) {
|
|
elementHandler := NewElementHandler(ZeroInstance)
|
|
elementHandler.instance = serviceInstance
|
|
if elementHandler.Instance() != serviceInstance {
|
|
t.Fatalf("获取实例错误!")
|
|
}
|
|
}
|