Add test for GenericResponse

This commit is contained in:
Kegan Myers 2014-03-03 14:57:11 -06:00
parent f9dfa3ba91
commit d87e5f41ea

View file

@ -0,0 +1,20 @@
describe("Typertext.GenericResponse", function () {
it("exists", function () {
expect(typeof Typertext.GenericResponse).toEqual("function");
});
it("works", function () {
function hf(input) {
return "TestString" + input;
}
var inputString = "Test message",
inputCode = 239,
inputHttp = Typertext.Http.HttpResponseStatus.clientError,
testClass = new Typertext.Http.HttpResponse(inputHttp, hf, inputCode, inputString);
expect(testClass.GetContent()).toEqual(inputString);
expect(testClass.GetHeader("foo")).toEqual("TestStringfoo");
expect(testClass.GetHttpStatus()).toEqual(inputCode);
expect(testClass.GetStatus()).toEqual(inputHttp);
});
});