From 9c8bfcd19f1da48408c9b0d487522120b65a2484 Mon Sep 17 00:00:00 2001 From: TwinProduction Date: Thu, 26 Nov 2020 23:45:17 -0500 Subject: [PATCH] Add service-status_test.go --- core/service-status_test.go | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 core/service-status_test.go diff --git a/core/service-status_test.go b/core/service-status_test.go new file mode 100644 index 00000000..4e833dfd --- /dev/null +++ b/core/service-status_test.go @@ -0,0 +1,22 @@ +package core + +import "testing" + +func TestNewServiceStatus(t *testing.T) { + service := &Service{Group: "test"} + serviceStatus := NewServiceStatus(service) + if serviceStatus.Group != service.Group { + t.Errorf("expected %s, got %s", service.Group, serviceStatus.Group) + } +} + +func TestServiceStatus_AddResult(t *testing.T) { + service := &Service{Group: "test"} + serviceStatus := NewServiceStatus(service) + for i := 0; i < 50; i++ { + serviceStatus.AddResult(&Result{}) + } + if len(serviceStatus.Results) != 20 { + t.Errorf("expected serviceStatus.Results to not exceed a length of 20") + } +}