Add basic tests for providers
This commit is contained in:
@ -1,6 +1,9 @@
|
||||
package twilio
|
||||
|
||||
import "testing"
|
||||
import (
|
||||
"github.com/TwinProduction/gatus/core"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestTwilioAlertProvider_IsValid(t *testing.T) {
|
||||
invalidProvider := AlertProvider{}
|
||||
@ -17,3 +20,16 @@ func TestTwilioAlertProvider_IsValid(t *testing.T) {
|
||||
t.Error("provider should've been valid")
|
||||
}
|
||||
}
|
||||
|
||||
func TestAlertProvider_ToCustomAlertProvider(t *testing.T) {
|
||||
provider := AlertProvider{
|
||||
SID: "1",
|
||||
Token: "1",
|
||||
From: "1",
|
||||
To: "1",
|
||||
}
|
||||
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