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 18:26:14 UTC

[incubator-trafficcontrol] 06/08: 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 2bb816ba3f118c155d0ad0c17c4582aa58c52b96
Author: Dewayne Richardson <de...@apache.org>
AuthorDate: Tue Feb 20 14:43:43 2018 -0700

    added TestInterfaces test
---
 .../traffic_ops_golang/status/statuses_test.go     | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/traffic_ops/traffic_ops_golang/status/statuses_test.go b/traffic_ops/traffic_ops_golang/status/statuses_test.go
index a7c0f24..16bbe13 100644
--- a/traffic_ops/traffic_ops_golang/status/statuses_test.go
+++ b/traffic_ops/traffic_ops_golang/status/statuses_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"
@@ -85,3 +86,24 @@ func TestReadStatuses(t *testing.T) {
 		t.Errorf("status.Read expected: len(statuses) == 2, actual: %v", len(statuses))
 	}
 }
+
+func TestInterfaces(t *testing.T) {
+	var i interface{}
+	i = &TOStatus{}
+
+	if _, ok := i.(api.Inserter); !ok {
+		t.Errorf("Status must be Inserter")
+	}
+	if _, ok := i.(api.Reader); !ok {
+		t.Errorf("Status must be Reader")
+	}
+	if _, ok := i.(api.Updater); !ok {
+		t.Errorf("Status must be Updater")
+	}
+	if _, ok := i.(api.Deleter); !ok {
+		t.Errorf("Status must be Deleter")
+	}
+	if _, ok := i.(api.Identifier); !ok {
+		t.Errorf("Status must be Identifier")
+	}
+}

-- 
To stop receiving notification emails like this one, please contact
dangogh@apache.org.