Commit 53c47976 authored by Karthic Rao's avatar Karthic Rao

Initial setup of test for recorder.go of middleware package

parent 60b6c0c0
package middleware
import (
"net/http"
"net/http/httptest"
"reflect"
"testing"
)
func TestNewResponseRecorder(t *testing.T) {
w := httptest.NewRecorder()
recordRequest := NewResponseRecorder(w)
if !reflect.DeepEqual(recordRequest.ResponseWriter, w) {
t.Fatalf("Expected Response writer in the Recording to be same as the one sent")
}
if recordRequest.status != http.StatusOK {
t.Fatalf("Expected recorded status to be http.StatusOK")
}
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment