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 0b3960289fe80f3284d0a2a8f315713e8e27611a Author: Dewayne Richardson <dewr...@apache.org> AuthorDate: Tue Feb 20 14:35:51 2018 -0700 added TestInterfaces test --- traffic_ops/traffic_ops_golang/cdn/cdns_test.go | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/traffic_ops/traffic_ops_golang/cdn/cdns_test.go b/traffic_ops/traffic_ops_golang/cdn/cdns_test.go index ff60aae..38c9abd 100644 --- a/traffic_ops/traffic_ops_golang/cdn/cdns_test.go +++ b/traffic_ops/traffic_ops_golang/cdn/cdns_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" @@ -66,8 +67,6 @@ func TestReadCDNs(t *testing.T) { cols := test.ColsFromStructByTag("db", tc.CDN{}) rows := sqlmock.NewRows(cols) - //TODO: drichardson - build helper to add these Rows from the struct values - // or by CSV if types get in the way for _, ts := range testCDNs { rows = rows.AddRow( ts.DNSSECEnabled, @@ -89,3 +88,24 @@ func TestReadCDNs(t *testing.T) { t.Errorf("cdn.Read expected: len(servers) == 2, actual: %v", len(servers)) } } + +func TestInterfaces(t *testing.T) { + var i interface{} + i = &TOCDN{} + + if _, ok := i.(api.Creator); !ok { + t.Errorf("cdn must be creator") + } + if _, ok := i.(api.Reader); !ok { + t.Errorf("cdn must be reader") + } + if _, ok := i.(api.Updater); !ok { + t.Errorf("cdn must be updater") + } + if _, ok := i.(api.Deleter); !ok { + t.Errorf("cdn must be deleter") + } + if _, ok := i.(api.Identifier); !ok { + t.Errorf("cdn must be Identifier") + } +} -- To stop receiving notification emails like this one, please contact dang...@apache.org.