First non-working version of server package

This commit is contained in:
Héctor Hurtado
2019-10-07 13:48:35 +02:00
parent bbda43b193
commit 81379c22e2
2 changed files with 101 additions and 0 deletions
+39
View File
@@ -0,0 +1,39 @@
package server_test
import (
"testing"
"github.com/BBVA/kapow/server"
)
func TestStartServerWhenInvalidBindAddrReturnsError(t *testing.T) {
err := server.StartServer("foo;bar", "", "", true)
if err == nil {
t.Errorf("Expected error not found")
}
}
func TestStartServerWhenInvalidPortNumberReturnsError(t *testing.T) {
err := server.StartServer("0.0.0.0:bar", "", "", true)
if err == nil {
t.Errorf("Expected error not found")
}
}
func TestStartServerWhenCertfileDontExistReturnsError(t *testing.T) {
err := server.StartServer("0.0.0.0:8080", "/notExist", "", true)
if err == nil {
t.Errorf("Expected error not found")
}
}
func TestStartServerWhenKeyfileDontExistReturnsError(t *testing.T) {
err := server.StartServer("0.0.0.0:8080", "", "/notExist", true)
if err == nil {
t.Errorf("Expected error not found")
}
}