< Summary

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

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
SetHash(...)0%2100%
CreateWebRequest(...)0%220100%

File(s)

/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/WebRequest/WebRequestAssetBundleFactory.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 WebRequestAssetBundleFactory : IWebRequestAssetBundleFactory
 10    {
 11        private bool useHash = false;
 12        private Hash128 hash;
 13
 14        public void SetHash(Hash128 hash)
 15        {
 016            useHash = true;
 017            this.hash = hash;
 018        }
 19
 20        public UnityWebRequest CreateWebRequest(string url) =>
 2921            useHash
 22                ? UnityWebRequestAssetBundle.GetAssetBundle(url, hash)
 23                : UnityWebRequestAssetBundle.GetAssetBundle(url);
 24    }
 25}