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 2b0ea08457349e0ec78f6064819d8b59786cb5b2 Author: Dewayne Richardson <dewr...@apache.org> AuthorDate: Tue Feb 20 14:33:07 2018 -0700 added TestInterfaces test --- .../traffic_ops_golang/division/divisions_test.go | 28 +++++++++++++++------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/traffic_ops/traffic_ops_golang/division/divisions_test.go b/traffic_ops/traffic_ops_golang/division/divisions_test.go index dd6a9a7..10ab007 100644 --- a/traffic_ops/traffic_ops_golang/division/divisions_test.go +++ b/traffic_ops/traffic_ops_golang/division/divisions_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/test" "github.com/jmoiron/sqlx" @@ -81,14 +82,23 @@ func TestGetDivisions(t *testing.T) { } -type SortableDivisions []tc.Division +func TestInterfaces(t *testing.T) { + var i interface{} + i = &TODivision{} -func (s SortableDivisions) Len() int { - return len(s) -} -func (s SortableDivisions) Swap(i, j int) { - s[i], s[j] = s[j], s[i] -} -func (s SortableDivisions) Less(i, j int) bool { - return s[i].Name < s[j].Name + if _, ok := i.(api.Creator); !ok { + t.Errorf("division must be creator") + } + if _, ok := i.(api.Reader); !ok { + t.Errorf("division must be reader") + } + if _, ok := i.(api.Updater); !ok { + t.Errorf("division must be updater") + } + if _, ok := i.(api.Deleter); !ok { + t.Errorf("division must be deleter") + } + if _, ok := i.(api.Identifier); !ok { + t.Errorf("division must be Identifier") + } } -- To stop receiving notification emails like this one, please contact dang...@apache.org.