public void ResponseBuilder_returns_500_error_on_empty_data()
 {
     var r = new Response("text/html", WebServer.BusinessLogic.Helpers.WebserverConstants.HttpVersion10, data);
     var rb = new ResponseBuilder(r);
     rb.Response.Data = null;
     rb.GetResponseBytes();
     Assert.AreEqual(500, rb.Response.HttpResponseCode, "On nulled data response didn't have 500 Error");
 }
 public void ResponseBuilder_can_be_created()
 {
     var r = new Response("text/html", WebServer.BusinessLogic.Helpers.WebserverConstants.HttpVersion10, data);
     var rb = new ResponseBuilder(r);
     Assert.IsTrue(rb != null, "ResponseBuilder was not created properly");
 }
Beispiel #3
0
 /// <summary>
 /// Converts response to bytes.
 /// </summary>
 /// <param name="response"></param>
 /// <returns></returns>
 private byte[] GetResponseBytes(Response response)
 {
     var responseBuilder = new ResponseBuilder(response);
     var responseBytes = responseBuilder.GetResponseBytes();
     return responseBytes;
 }