add tests for both client and server

pull/562/head
Minh Doan 6 years ago committed by Minh Doan
parent b49a28cbda
commit e67ee92244
  1. 18
      api/proto/message/client_test.go
  2. 13
      api/proto/message/server_test.go

@ -0,0 +1,18 @@
package message
import (
"testing"
)
const (
testIP = "127.0.0.1"
)
func TestClient(t *testing.T) {
s := NewServer()
s.Start(testIP, "")
client := NewClient(testIP)
client.Process(&Message{})
s.Stop()
}

@ -0,0 +1,13 @@
package message
import (
"testing"
"time"
)
func TestServerStart(t *testing.T) {
s := NewServer()
s.Start("127.0.0.1", "")
time.Sleep(time.Second)
s.Stop()
}
Loading…
Cancel
Save