github.com/stakater/IngressMonitorController@v1.0.103/pkg/monitors/monitor-proxy_test.go (about)

     1  package monitors
     2  
     3  import (
     4  	"testing"
     5  
     6  	"github.com/stakater/IngressMonitorController/pkg/util"
     7  )
     8  
     9  func TestMonitorServiceProxyOfTypeWithCorrectType(t *testing.T) {
    10  	monitorType := "UptimeRobot"
    11  	uptime := (&MonitorServiceProxy{}).OfType(monitorType)
    12  
    13  	if uptime.monitorType != monitorType {
    14  		t.Error("Monitor type is not the same")
    15  	}
    16  }
    17  
    18  func TestMonitorServiceProxyOfTypeWithWrongType(t *testing.T) {
    19  	util.AssertPanic(t, func() {
    20  		monitorType := "Testing"
    21  		uptime := (&MonitorServiceProxy{}).OfType(monitorType)
    22  
    23  		if uptime.monitorType != monitorType {
    24  			t.Error("Monitor type is not the same")
    25  		}
    26  	})
    27  }