Notice the logic in the ternary operation of var status at line 557:
var status = (context.Response.StatusCode == HttpStatusCode.Ok) ? HttpStatusCode.InternalServerError : context.Response.StatusCode;
I believe that it should be the following:
var status = (context.Response.StatusCode != HttpStatusCode.Ok) ? HttpStatusCode.InternalServerError : context.Response.StatusCode;
Otherwise, status is set to 0 (the value of context.Response.StatusCode) and the test fails because it does not receive the proper HttpStatusCode.InternalServerError.
Besides, if I'm not mistaken, when an exception is countered, context.Response.StatusCode would never be HttpStatusCode.Ok and if it were, should it return HttpStatusCode.InternalServerError?
The fix for #188 causes the SendsInternalServerErrorResponseWhenExceptionThrown test to fail.
The relevant diff is here: https://github.com/sukona/Grapevine/commit/4003de2dcad909925c6bd4e803b4b4b495cc681f#diff-989c985080ab75fc3eac435c40f43432
Notice the logic in the ternary operation of
var status
at line 557:var status = (context.Response.StatusCode == HttpStatusCode.Ok) ? HttpStatusCode.InternalServerError : context.Response.StatusCode;
I believe that it should be the following:
var status = (context.Response.StatusCode != HttpStatusCode.Ok) ? HttpStatusCode.InternalServerError : context.Response.StatusCode;
Otherwise, status is set to 0 (the value of context.Response.StatusCode) and the test fails because it does not receive the proper HttpStatusCode.InternalServerError.
Besides, if I'm not mistaken, when an exception is countered, context.Response.StatusCode would never be HttpStatusCode.Ok and if it were, should it return HttpStatusCode.InternalServerError?