< 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        {
 71417            i.Dispose();
 71418            i = new Model(serviceLocator);
 71419            serviceLocator.Initialize();
 71420        }
 21
 22        /// <summary>
 23        /// Dispose() all the current environment systems.
 24        /// </summary>
 25        public static void Dispose()
 26        {
 64027            i?.Dispose();
 64028        }
 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
 71538            public Model (ServiceLocator serviceLocator)
 39            {
 71540                this.serviceLocator = serviceLocator;
 71541                messaging = new MessagingContext(serviceLocator);
 71542                platform = new PlatformContext(serviceLocator);
 71543                world = new WorldRuntimeContext(serviceLocator);
 71544                hud = new HUDContext(serviceLocator);
 71545            }
 46
 47            public void Dispose()
 48            {
 135449                this.serviceLocator.Dispose();
 135450            }
 51        }
 52    }
 53}