mirror of
https://github.com/TwiN/gatus.git
synced 2024-11-25 01:13:40 +01:00
9d151fcdb4
* refactor: Partially break core package into dns, result and ssh packages * refactor: Move core package to config/endpoint * refactor: Fix warning about overlapping imported package name with endpoint variable * refactor: Rename EndpointStatus to Status * refactor: Merge result pkg back into endpoint pkg, because it makes more sense * refactor: Rename parameter r to result in Condition.evaluate * refactor: Rename parameter r to result * refactor: Revert accidental change to endpoint.TypeDNS * refactor: Rename parameter r to result * refactor: Merge util package into endpoint package * refactor: Rename parameter r to result
20 lines
449 B
Go
20 lines
449 B
Go
package endpoint
|
|
|
|
import (
|
|
"testing"
|
|
)
|
|
|
|
func TestNewEndpointStatus(t *testing.T) {
|
|
ep := &Endpoint{Name: "name", Group: "group"}
|
|
status := NewStatus(ep.Group, ep.Name)
|
|
if status.Name != ep.Name {
|
|
t.Errorf("expected %s, got %s", ep.Name, status.Name)
|
|
}
|
|
if status.Group != ep.Group {
|
|
t.Errorf("expected %s, got %s", ep.Group, status.Group)
|
|
}
|
|
if status.Key != "group_name" {
|
|
t.Errorf("expected %s, got %s", "group_name", status.Key)
|
|
}
|
|
}
|