You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficcontrol.apache.org by da...@apache.org on 2018/02/22 23:10:04 UTC
[incubator-trafficcontrol] 06/10: added TestInterfaces test
This is an automated email from the ASF dual-hosted git repository.
dangogh pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-trafficcontrol.git
commit cca777e045d36ee9682b41115330ca1ece494296
Author: Dewayne Richardson <de...@apache.org>
AuthorDate: Tue Feb 20 14:42:16 2018 -0700
added TestInterfaces test
---
.../traffic_ops_golang/region/regions_test.go | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/traffic_ops/traffic_ops_golang/region/regions_test.go b/traffic_ops/traffic_ops_golang/region/regions_test.go
index 6eb4761..aa41fa5 100644
--- a/traffic_ops/traffic_ops_golang/region/regions_test.go
+++ b/traffic_ops/traffic_ops_golang/region/regions_test.go
@@ -24,6 +24,7 @@ import (
"time"
"github.com/apache/incubator-trafficcontrol/lib/go-tc"
+ "github.com/apache/incubator-trafficcontrol/traffic_ops/traffic_ops_golang/api"
"github.com/apache/incubator-trafficcontrol/traffic_ops/traffic_ops_golang/auth"
"github.com/apache/incubator-trafficcontrol/traffic_ops/traffic_ops_golang/test"
"github.com/jmoiron/sqlx"
@@ -84,3 +85,24 @@ func TestReadRegions(t *testing.T) {
t.Errorf("region.Read expected: len(regions) == 2, actual: %v", len(regions))
}
}
+
+func TestInterfaces(t *testing.T) {
+ var i interface{}
+ i = &TORegion{}
+
+ if _, ok := i.(api.Inserter); !ok {
+ t.Errorf("Region must be Inserter")
+ }
+ if _, ok := i.(api.Reader); !ok {
+ t.Errorf("Region must be Reader")
+ }
+ if _, ok := i.(api.Updater); !ok {
+ t.Errorf("Region must be Updater")
+ }
+ if _, ok := i.(api.Deleter); !ok {
+ t.Errorf("Region must be Deleter")
+ }
+ if _, ok := i.(api.Identifier); !ok {
+ t.Errorf("Region must be Identifier")
+ }
+}
--
To stop receiving notification emails like this one, please contact
dangogh@apache.org.