-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain_test.go
38 lines (30 loc) · 978 Bytes
/
main_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package main
import (
"testing"
/*"bytes"
"net/http/httptest"
"net/http"*/
)
func TestDummy(t* testing.T) {
}
// TODO: FIX Rest Endpoint test
/*
func TestMXLookupRestSuccess(t* testing.T) {
req, err := http.NewRequest("GET", "/mx", bytes.NewBuffer([]byte("hauptj.com")))
if err != nil {
t.Fatal(err)
}
rr := httptest.NewRecorder()
handler := http.HandlerFunc(MXLookupEndPt)
handler.ServeHTTP(rr, req)
if status := rr.Code; status != http.StatusOK {
t.Errorf("Handler returned wrong status code: actual: %v expected: %v",
status, http.StatusOK)
}
var expectedResult string = '[{"Host":"aspmx.l.google.com.","Pref":10},{"Host":"alt1.aspmx.l.google.com.","Pref":20},{"Host":"alt2.aspmx.l.google.com.","Pref":30},{"Host":"alt3.aspmx.l.google.com.","Pref":40},{"Host":"alt4.aspmx.l.google.com.","Pref":50}]'
if rr.Body.String() != expectedResult {
t.Errorf("Handler returned wrong body: actual %v want %v",
rr.Body.String(), expectedResult)
}
}
*/