From b93da8ccc83e0471c9489ff7c0efa4f100aea4db Mon Sep 17 00:00:00 2001 From: claudemiro Date: Sat, 17 Jan 2015 08:21:49 -0300 Subject: [PATCH] Fixed Tests --- app_test.go | 12 ++++++------ conn_test.go | 10 ---------- 2 files changed, 6 insertions(+), 16 deletions(-) diff --git a/app_test.go b/app_test.go index 0e960b1..437eabc 100644 --- a/app_test.go +++ b/app_test.go @@ -76,24 +76,24 @@ func Test_AllChannels(t *testing.T) { func Test_New_Subscriber(t *testing.T) { app := newApp() - if len(app.Subscribers) != 0 { + if len(app.Connections) != 0 { t.Error("Length of subscribers before test must be 0") } - conn := NewSubscriber("1", nil) + conn := NewConnection("1", nil) app.Connect(conn) - if len(app.Subscribers) != 1 { + if len(app.Connections) != 1 { t.Error("Length os subscribers after test must be 1") } } func Test_find_subscriber(t *testing.T) { app := newApp() - conn := NewSubscriber("1", nil) + conn := NewConnection("1", nil) app.Connect(conn) - conn, err := app.FindSubscriber("1") + conn, err := app.FindConnection("1") if err != nil { t.Error(err) @@ -105,7 +105,7 @@ func Test_find_subscriber(t *testing.T) { // Find a wrong subscriber - conn, err = app.FindSubscriber("DoesNotExists") + conn, err = app.FindConnection("DoesNotExists") if err == nil { t.Error("Opps, Must be nil") diff --git a/conn_test.go b/conn_test.go index 8e41e6c..92318a5 100644 --- a/conn_test.go +++ b/conn_test.go @@ -3,13 +3,3 @@ // license that can be found in the LICENSE file. package main - -import "testing" - -func Test_New_ID(t *testing.T) { - _, id := newID() - - if _, i := newID(); i != id+1 { - t.Errorf("Every call to newID must increment the id by one, got: %s", i) - } -}