< Summary

Class:MainScripts.DCL.AssetsEmbedment.Editor.EditorTexturesDownloader
Assembly:AssetsEmbedmentEditor
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/AssetsEmbedment/Editor/EditorTexturesDownloader.cs
Covered lines:0
Uncovered lines:10
Coverable lines:10
Total lines:31
Line coverage:0% (0 of 10)
Covered branches:0
Total branches:0

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
EditorTexturesDownloader()0%2100%
DownloadTexture2DAsync()0%30500%

File(s)

/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/AssetsEmbedment/Editor/EditorTexturesDownloader.cs

#LineLine coverage
 1using Cysharp.Threading.Tasks;
 2using DCL;
 3using MainScripts.DCL.Controllers.AssetManager;
 4using System.Collections.Generic;
 5using UnityEngine;
 6
 7namespace MainScripts.DCL.AssetsEmbedment.Editor
 8{
 9    public static class EditorTexturesDownloader
 10    {
 011        private static readonly AssetTextureWebLoader WEB_LOADER = new ();
 12
 13        public static async UniTask DownloadTexture2DAsync(string baseUrl, string hash, Dictionary<string, Texture2D> re
 14        {
 015            if (results.ContainsKey(hash))
 016                return;
 17
 018            var url = $"{baseUrl}{hash}";
 19
 020            var response = await WEB_LOADER.GetTextureAsync(url);
 21
 022            if (response)
 23            {
 024                results.Add(hash, response);
 025                return;
 26            }
 27
 028            throw new AssetNotFoundException(AssetSource.WEB, hash);
 029        }
 30    }
 31}