Skip to content

Commit

Permalink
add test for bridge package
Browse files Browse the repository at this point in the history
  • Loading branch information
0x46616c6b committed Dec 21, 2019
1 parent 515f7a0 commit 279edb4
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
5 changes: 0 additions & 5 deletions internal/bridge/bridge.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,6 @@ func NewTwitterBridge(key, secret string) *TwitterBridge {
}
}

//
func (tb *TwitterBridge) Initialized() bool {
return tb.ConsumerKey != "" && tb.ConsumerSecret != ""
}

//
func (tb *TwitterBridge) Update(ticker model.Ticker, message model.Message) (*twitter.Tweet, error) {
client := tb.client(ticker.Twitter.Token, ticker.Twitter.Secret)
Expand Down
16 changes: 16 additions & 0 deletions internal/bridge/bridge_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package bridge_test

import (
"testing"

"github.com/stretchr/testify/assert"

"github.com/systemli/ticker/internal/bridge"
)

func TestNewTwitterBridge(t *testing.T) {
tb := bridge.NewTwitterBridge("key", "secret")

assert.Equal(t, "key", tb.ConsumerKey)
assert.Equal(t, "secret", tb.ConsumerSecret)
}

0 comments on commit 279edb4

Please sign in to comment.