Moved to internal

This commit is contained in:
Héctor Hurtado
2019-10-08 08:54:07 +02:00
parent 9266f48c7e
commit 56db1ce2ac
4 changed files with 95 additions and 35 deletions
+27
View File
@@ -0,0 +1,27 @@
package control
import (
"testing"
)
func TestNewControlServerFillsTheStructCorrectly(t *testing.T) {
server, err := NewControlServer("0.0.0.0", 8080, "/certfile.pem", "/keyfile.pem")
if err != nil {
}
if server.bindAddr != "0.0.0.0:8080" {
t.Errorf("BindAddress incorrectly composed. Expected: %s, got: %s", "0.0.0.0:8080", server.bindAddr)
}
if server.certfile != "/certfile.pem" {
t.Errorf("BindAddress incorrectly composed. Expected: %s, got: %s", "/certfile.pem", server.certfile)
}
if server.keyfile != "/keyfile.pem" {
t.Errorf("BindAddress incorrectly composed. Expected: %s, got: %s", "/keyfile.pem", server.keyfile)
}
}