< 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:18
Uncovered lines:0
Coverable lines:18
Total lines:78
Line coverage:100% (18 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%220100%
GetWrapMode(...)0%220100%
GetFilterMode(...)0%220100%
GetFilterMode(...)0%220100%

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        {
 139            switch (self.TexCase)
 10            {
 11                case TextureUnion.TexOneofCase.AvatarTexture:
 112                    return self.AvatarTexture.GetTextureUrl();
 13                case TextureUnion.TexOneofCase.Texture:
 14                default:
 1215                    return self.Texture.GetTextureUrl(scene);
 16            }
 17        }
 18
 19        public static UnityEngine.TextureWrapMode GetWrapMode(this TextureUnion self)
 20        {
 1321            switch (self.TexCase)
 22            {
 23                case TextureUnion.TexOneofCase.AvatarTexture:
 124                    return self.AvatarTexture.GetWrapMode();
 25                case TextureUnion.TexOneofCase.Texture:
 26                default:
 1227                    return self.Texture.GetWrapMode();
 28            }
 29        }
 30
 31        public static UnityEngine.FilterMode GetFilterMode(this TextureUnion self)
 32        {
 1333            switch (self.TexCase)
 34            {
 35                case TextureUnion.TexOneofCase.AvatarTexture:
 136                    return self.AvatarTexture.GetFilterMode();
 37                case TextureUnion.TexOneofCase.Texture:
 38                default:
 1239                    return self.Texture.GetFilterMode();
 40            }
 41        }
 42
 43        public static string GetTextureUrl(this ECSComponents.Texture self, IParcelScene scene)
 44        {
 1245            if (string.IsNullOrEmpty(self.Src))
 246                return self.Src;
 47
 1048            scene.contentProvider.TryGetContentsUrl(self.Src, out string textureUrl);
 49
 1050            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        {
 1260            return (UnityEngine.TextureWrapMode)(self.HasWrapMode ? self.WrapMode : TextureWrapMode.TwmClamp);
 61        }
 62
 63        public static UnityEngine.TextureWrapMode GetWrapMode(this AvatarTexture self)
 64        {
 165            return (UnityEngine.TextureWrapMode)(self.HasWrapMode ? self.WrapMode : TextureWrapMode.TwmClamp);
 66        }
 67
 68        public static UnityEngine.FilterMode GetFilterMode(this ECSComponents.Texture self)
 69        {
 1270            return (UnityEngine.FilterMode)(self.HasFilterMode ? self.FilterMode : TextureFilterMode.TfmBilinear);
 71        }
 72
 73        public static UnityEngine.FilterMode GetFilterMode(this AvatarTexture self)
 74        {
 175            return (UnityEngine.FilterMode)(self.HasFilterMode ? self.FilterMode : TextureFilterMode.TfmBilinear);
 76        }
 77    }
 78}