2020-11-26 23:45:17 -05:00
|
|
|
package core
|
|
|
|
|
|
2020-12-29 20:22:17 -05:00
|
|
|
import (
|
|
|
|
|
"testing"
|
|
|
|
|
)
|
2020-11-26 23:45:17 -05:00
|
|
|
|
|
|
|
|
func TestNewServiceStatus(t *testing.T) {
|
2020-11-30 08:44:58 -05:00
|
|
|
service := &Service{Name: "name", Group: "group"}
|
2021-07-14 01:53:14 -04:00
|
|
|
serviceStatus := NewServiceStatus(service.Key(), service.Group, service.Name)
|
2020-11-30 08:44:58 -05:00
|
|
|
if serviceStatus.Name != service.Name {
|
|
|
|
|
t.Errorf("expected %s, got %s", service.Name, serviceStatus.Name)
|
|
|
|
|
}
|
2020-11-26 23:45:17 -05:00
|
|
|
if serviceStatus.Group != service.Group {
|
|
|
|
|
t.Errorf("expected %s, got %s", service.Group, serviceStatus.Group)
|
|
|
|
|
}
|
2021-01-27 18:25:37 -05:00
|
|
|
if serviceStatus.Key != "group_name" {
|
|
|
|
|
t.Errorf("expected %s, got %s", "group_name", serviceStatus.Key)
|
|
|
|
|
}
|
2020-11-26 23:45:17 -05:00
|
|
|
}
|