Add new unit tests on TrendS

This commit is contained in:
armirveliaj
2024-10-10 11:08:14 -04:00
committed by Dan Christian Bogos
parent 2b8a8676b6
commit 4bf49be2be
2 changed files with 83 additions and 0 deletions

View File

@@ -96,3 +96,16 @@ func TestTrendServiceIsRunning(t *testing.T) {
t.Errorf("Expected IsRunning to return false, got %v", result)
}
}
func TestTrendServiceStartAlreadyRunning(t *testing.T) {
trendService := &TrendService{}
trendService.trs = &engine.TrendS{}
err := trendService.Start()
if err != utils.ErrServiceAlreadyRunning {
t.Errorf("Expected error '%v', got '%v'", utils.ErrServiceAlreadyRunning, err)
}
}