gatus/core/service_status_test.go

20 lines
549 B
Go
Raw Normal View History

2020-11-27 05:45:17 +01:00
package core
import (
"testing"
)
2020-11-27 05:45:17 +01:00
func TestNewServiceStatus(t *testing.T) {
service := &Service{Name: "name", Group: "group"}
2021-07-14 07:53:14 +02:00
serviceStatus := NewServiceStatus(service.Key(), service.Group, service.Name)
if serviceStatus.Name != service.Name {
t.Errorf("expected %s, got %s", service.Name, serviceStatus.Name)
}
2020-11-27 05:45:17 +01:00
if serviceStatus.Group != service.Group {
t.Errorf("expected %s, got %s", service.Group, serviceStatus.Group)
}
if serviceStatus.Key != "group_name" {
t.Errorf("expected %s, got %s", "group_name", serviceStatus.Key)
}
2020-11-27 05:45:17 +01:00
}