Sfoglia il codice sorgente

Added TestGETNoServer

Piotr Czajkowski 4 anni fa
parent
commit
8dec70b522
1 ha cambiato i file con 11 aggiunte e 0 eliminazioni
  1. 11 0
      rest_test.go

+ 11 - 0
rest_test.go

@@ -107,3 +107,14 @@ func TestGET404(t *testing.T) {
 		t.Errorf("Wrong result, %v", resultString)
 	}
 }
+
+func TestGETNoServer(t *testing.T) {
+	data, err := GET("/")
+	if data != nil {
+		t.Error("Data should be nil!")
+	}
+
+	if err == nil {
+		t.Error("There should be an error!")
+	}
+}