< Summary

Class:DCL.Environment
Assembly:Environment
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Environment/Environment.cs
Covered lines:16
Uncovered lines:0
Coverable lines:16
Total lines:53
Line coverage:100% (16 of 16)
Covered branches:0
Total branches:0

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
Environment()0%110100%
Setup(...)0%110100%
Dispose()0%220100%
Model(...)0%110100%
Dispose()0%110100%

File(s)

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

#LineLine coverage
 1using System;
 2using System.ComponentModel;
 3using DCL.Controllers;
 4using UnityEngine.SceneManagement;
 5
 6namespace DCL
 7{
 8    public class Environment
 9    {
 110        public static Model i = new Model(new ServiceLocator());
 11
 12        /// <summary>
 13        /// Setup the environment with the configured builder funcs.
 14        /// </summary>
 15        public static void Setup(ServiceLocator serviceLocator)
 16        {
 88217            i.Dispose();
 88218            i = new Model(serviceLocator);
 88219            serviceLocator.Initialize();
 88220        }
 21
 22        /// <summary>
 23        /// Dispose() all the current environment systems.
 24        /// </summary>
 25        public static void Dispose()
 26        {
 88027            i?.Dispose();
 88028        }
 29
 30        public class Model : IDisposable
 31        {
 32            public readonly ServiceLocator serviceLocator;
 33            public readonly MessagingContext messaging;
 34            public readonly PlatformContext platform;
 35            public readonly WorldRuntimeContext world;
 36            public readonly HUDContext hud;
 37
 88338            public Model (ServiceLocator serviceLocator)
 39            {
 88340                this.serviceLocator = serviceLocator;
 88341                messaging = new MessagingContext(serviceLocator);
 88342                platform = new PlatformContext(serviceLocator);
 88343                world = new WorldRuntimeContext(serviceLocator);
 88344                hud = new HUDContext(serviceLocator);
 88345            }
 46
 47            public void Dispose()
 48            {
 176249                this.serviceLocator.Dispose();
 176250            }
 51        }
 52    }
 53}