First test

This commit is contained in:
Héctor Hurtado
2019-10-07 16:00:14 +02:00
parent bbda43b193
commit 9266f48c7e
2 changed files with 51 additions and 0 deletions
+20
View File
@@ -0,0 +1,20 @@
package control
import "testing"
func TestNewControlServerFillsTheStruct(t *testing.T) {
server := NewControlServer("0.0.0.0", 8080, "/certfile.pem", "/keyfile.pem")
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)
}
}