Add basic tests for providers

This commit is contained in:
TwinProduction
2020-10-21 21:18:06 -04:00
parent ce6cc9e18d
commit aa671bc72d
4 changed files with 53 additions and 3 deletions

View File

@ -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")
}
}