Add test for GenericResponse
This commit is contained in:
parent
f9dfa3ba91
commit
d87e5f41ea
20
test/Typertext/GenericResponse.test.js
Normal file
20
test/Typertext/GenericResponse.test.js
Normal 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);
|
||||
});
|
||||
});
|
Reference in a new issue