< Summary

Class:DCL.WebRequestAssetBundle
Assembly:WebRequest
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/WebRequest/WebRequestAssetBundle.cs
Covered lines:5
Uncovered lines:1
Coverable lines:6
Total lines:28
Line coverage:83.3% (5 of 6)
Covered branches:0
Total branches:0

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
SetHash(...)0%110100%
CreateWebRequest(...)0%2.152066.67%

File(s)

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

#LineLine coverage
 1using UnityEngine;
 2using UnityEngine.Networking;
 3
 4namespace DCL
 5{
 6    /// <summary>
 7    /// Our custom implementation of the UnityWebRequestAssetBundle.
 8    /// </summary>
 9    public class WebRequestAssetBundle : IWebRequestAssetBundle
 10    {
 11        private bool useHash = false;
 12        private Hash128 hash;
 13
 14        public void SetHash(Hash128 hash)
 15        {
 2716            useHash = true;
 2717            this.hash = hash;
 2718        }
 19
 20        public UnityWebRequest CreateWebRequest(string url)
 21        {
 2722            if (useHash)
 2723                return UnityWebRequestAssetBundle.GetAssetBundle(url, hash);
 24            else
 025                return UnityWebRequestAssetBundle.GetAssetBundle(url);
 26        }
 27    }
 28}