< Summary

Class:DCL.WebRequestExtensions
Assembly:WebRequest
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/WebRequest/WebRequestExtensions.cs
Covered lines:3
Uncovered lines:0
Coverable lines:3
Total lines:29
Line coverage:100% (3 of 3)
Covered branches:0
Total branches:0

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
WebRequestSucceded(...)0%220100%
WebRequestServerError(...)0%330100%
WebRequestAborted(...)0%550100%

File(s)

/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/WebRequest/WebRequestExtensions.cs

#LineLine coverage
 1using UnityEngine.Networking;
 2
 3namespace DCL
 4{
 5    public static class WebRequestExtensions
 6    {
 7        public static bool WebRequestSucceded(this UnityWebRequest request)
 8        {
 3159            return request != null &&
 10                   request.result == UnityWebRequest.Result.Success;
 11        }
 12
 13        public static bool WebRequestServerError(this UnityWebRequest request)
 14        {
 5915            return request != null &&
 16                   request.responseCode >= 500 &&
 17                   request.responseCode < 600;
 18        }
 19
 20        public static bool WebRequestAborted(this UnityWebRequest request)
 21        {
 5922            return request != null &&
 23                   request.result == UnityWebRequest.Result.ConnectionError &&
 24                   request.result == UnityWebRequest.Result.ProtocolError &&
 25                   !string.IsNullOrEmpty(request.error) &&
 26                   request.error.ToLower().Contains("aborted");
 27        }
 28    }
 29}