广汽安道拓Acura项目MES后台
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
522 B

  1. package container
  2. import (
  3. "testing"
  4. )
  5. func TestElementHandler_New(t *testing.T) {
  6. elementHandler := NewElementHandler(serviceInstance)
  7. if elementHandler == nil {
  8. t.Fatalf("创建失败!")
  9. }
  10. if elementHandler.instance != serviceInstance {
  11. t.Fatalf("设置实例错误!")
  12. }
  13. }
  14. func TestElementHandler_Instance(t *testing.T) {
  15. elementHandler := NewElementHandler(ZeroInstance)
  16. elementHandler.instance = serviceInstance
  17. if elementHandler.Instance() != serviceInstance {
  18. t.Fatalf("获取实例错误!")
  19. }
  20. }