< Summary

Class:DCL.Service[T]
Assembly:ServiceInstance
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Environment/ServiceInstance/Service.cs
Covered lines:1
Uncovered lines:1
Coverable lines:2
Total lines:16
Line coverage:50% (1 of 2)
Covered branches:0
Total branches:0

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
implicit operator T(...)0%2100%

File(s)

/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Environment/ServiceInstance/Service.cs

#LineLine coverage
 1namespace DCL
 2{
 3    /// <summary>
 4    /// Caches an instance of `T` upon the first retrieval
 5    /// </summary>
 6    /// <typeparam name="T"></typeparam>
 7    public struct Service<T> where T: class, IService
 8    {
 9        private T @ref;
 10
 31811        public T Ref => @ref ??= Environment.i.serviceLocator.Get<T>();
 12
 13        public static implicit operator T(Service<T> service) =>
 014            service.Ref;
 15    }
 16}