< Summary

Class:DCL.ECSComponents.Texture_Defaults
Assembly:DCL.ECSComponents.Defaults
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/DCLPlugins/ECS7/ECSComponents/Defaults/Texture_Defaults.cs
Covered lines:14
Uncovered lines:4
Coverable lines:18
Total lines:78
Line coverage:77.7% (14 of 18)
Covered branches:0
Total branches:0

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
GetTextureUrl(...)0%330100%
GetWrapMode(...)0%330100%
GetFilterMode(...)0%330100%
GetTextureUrl(...)0%220100%
GetTextureUrl(...)0%110100%
GetWrapMode(...)0%6200%
GetWrapMode(...)0%6200%
GetFilterMode(...)0%6200%
GetFilterMode(...)0%6200%

File(s)

/tmp/workspace/unity-renderer/unity-renderer/Assets/DCLPlugins/ECS7/ECSComponents/Defaults/Texture_Defaults.cs

#LineLine coverage
 1using DCL.Controllers;
 2
 3namespace DCL.ECSComponents
 4{
 5    public static class Texture_Defaults
 6    {
 7        public static string GetTextureUrl(this TextureUnion self, IParcelScene scene)
 8        {
 129            switch (self.TexCase)
 10            {
 11                case TextureUnion.TexOneofCase.AvatarTexture:
 112                    return self.AvatarTexture.GetTextureUrl();
 13                case TextureUnion.TexOneofCase.Texture:
 14                default:
 1115                    return self.Texture.GetTextureUrl(scene);
 16            }
 17        }
 18
 19        public static UnityEngine.TextureWrapMode GetWrapMode(this TextureUnion self)
 20        {
 1221            switch (self.TexCase)
 22            {
 23                case TextureUnion.TexOneofCase.AvatarTexture:
 124                    return self.AvatarTexture.GetWrapMode();
 25                case TextureUnion.TexOneofCase.Texture:
 26                default:
 1127                    return self.Texture.GetWrapMode();
 28            }
 29        }
 30
 31        public static UnityEngine.FilterMode GetFilterMode(this TextureUnion self)
 32        {
 1233            switch (self.TexCase)
 34            {
 35                case TextureUnion.TexOneofCase.AvatarTexture:
 136                    return self.AvatarTexture.GetFilterMode();
 37                case TextureUnion.TexOneofCase.Texture:
 38                default:
 1139                    return self.Texture.GetFilterMode();
 40            }
 41        }
 42
 43        public static string GetTextureUrl(this ECSComponents.Texture self, IParcelScene scene)
 44        {
 1145            if (string.IsNullOrEmpty(self.Src))
 246                return self.Src;
 47
 948            scene.contentProvider.TryGetContentsUrl(self.Src, out string textureUrl);
 49
 950            return textureUrl;
 51        }
 52
 53        public static string GetTextureUrl(this AvatarTexture self)
 54        {
 155            return KernelConfig.i.Get().avatarTextureAPIBaseUrl + self.UserId;
 56        }
 57
 58        public static UnityEngine.TextureWrapMode GetWrapMode(this ECSComponents.Texture self)
 59        {
 060            return (UnityEngine.TextureWrapMode)(self.HasWrapMode ? self.WrapMode : TextureWrapMode.TwmClamp);
 61        }
 62
 63        public static UnityEngine.TextureWrapMode GetWrapMode(this AvatarTexture self)
 64        {
 065            return (UnityEngine.TextureWrapMode)(self.HasWrapMode ? self.WrapMode : TextureWrapMode.TwmClamp);
 66        }
 67
 68        public static UnityEngine.FilterMode GetFilterMode(this ECSComponents.Texture self)
 69        {
 070            return (UnityEngine.FilterMode)(self.HasFilterMode ? self.FilterMode : TextureFilterMode.TfmBilinear);
 71        }
 72
 73        public static UnityEngine.FilterMode GetFilterMode(this AvatarTexture self)
 74        {
 075            return (UnityEngine.FilterMode)(self.HasFilterMode ? self.FilterMode : TextureFilterMode.TfmBilinear);
 76        }
 77    }
 78}