BrowserTestResults.cs 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. // /* **********************************************************************************
  2. // *
  3. // * Copyright (c) Sky Sanders. All rights reserved.
  4. // *
  5. // * This source code is subject to terms and conditions of the Microsoft Public
  6. // * License (Ms-PL). A copy of the license can be found in the license.htm file
  7. // * included in this distribution.
  8. // *
  9. // * You must not remove this notice, or any other, from this software.
  10. // *
  11. // * **********************************************************************************/
  12. using System;
  13. using System.Text;
  14. namespace CassiniDev
  15. {
  16. public class BrowserTestResults
  17. {
  18. public BrowserTestResults()
  19. {
  20. }
  21. public BrowserTestResults(RequestEventArgs eventArgs)
  22. {
  23. Id = eventArgs.Id;
  24. if (eventArgs.RequestLog.Body.Length > 0)
  25. {
  26. Log = Encoding.UTF8.GetString(eventArgs.RequestLog.Body);
  27. }
  28. Error = eventArgs.RequestLog.Exception;
  29. StatusCode = eventArgs.RequestLog.StatusCode;
  30. Url = eventArgs.RequestLog.Url;
  31. Success = Url.IndexOf("success", StringComparison.InvariantCultureIgnoreCase) > -1;
  32. }
  33. public bool Success { get; set; }
  34. public string Url { get; set; }
  35. public long? StatusCode { get; set; }
  36. public string Error { get; set; }
  37. public string Log { get; set; }
  38. public Guid Id { get; set; }
  39. }
  40. }