Add basic tests for providers
This commit is contained in:
@ -1,6 +1,9 @@
|
||||
package pagerduty
|
||||
|
||||
import "testing"
|
||||
import (
|
||||
"github.com/TwinProduction/gatus/core"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestAlertProvider_IsValid(t *testing.T) {
|
||||
invalidProvider := AlertProvider{IntegrationKey: ""}
|
||||
@ -12,3 +15,11 @@ func TestAlertProvider_IsValid(t *testing.T) {
|
||||
t.Error("provider should've been valid")
|
||||
}
|
||||
}
|
||||
|
||||
func TestAlertProvider_ToCustomAlertProvider(t *testing.T) {
|
||||
provider := AlertProvider{IntegrationKey: "00000000000000000000000000000000"}
|
||||
customAlertProvider := provider.ToCustomAlertProvider(&core.Service{}, &core.Alert{}, &core.Result{}, true)
|
||||
if customAlertProvider == nil {
|
||||
t.Error("customAlertProvider shouldn't have been nil")
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user