diff --git a/server/auth_test.go b/server/auth_test.go index e9ba5f9..f442420 100644 --- a/server/auth_test.go +++ b/server/auth_test.go @@ -169,6 +169,11 @@ func TestServerValidateAuthRequest(t *testing.T) { t.Fatalf("Expected AuthRequest with email with unexpected formatting to not successfully validate") } + authRequest = AuthRequest{DeviceId: "dId", Password: "aoeu"} + if authRequest.validate() { + t.Fatalf("Expected AuthRequest with missing email to not successfully validate") + } + authRequest = AuthRequest{DeviceId: "dId", Email: "joe@example.com"} if authRequest.validate() { t.Fatalf("Expected AuthRequest with missing password to not successfully validate") diff --git a/server/register_test.go b/server/register_test.go index c5aac5e..2cfc93c 100644 --- a/server/register_test.go +++ b/server/register_test.go @@ -59,6 +59,11 @@ func TestServerValidateRegisterRequest(t *testing.T) { t.Fatalf("Expected RegisterRequest with email with unexpected formatting to not successfully validate") } + registerRequest = RegisterRequest{Password: "aoeu"} + if registerRequest.validate() { + t.Fatalf("Expected RegisterRequest with missing email to not successfully validate") + } + registerRequest = RegisterRequest{Email: "joe@example.com"} if registerRequest.validate() { t.Fatalf("Expected RegisterRequest with missing password to not successfully validate")