< 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        {
 89517            i.Dispose();
 89518            i = new Model(serviceLocator);
 89519            serviceLocator.Initialize();
 89520        }
 21
 22        /// <summary>
 23        /// Dispose() all the current environment systems.
 24        /// </summary>
 25        public static void Dispose()
 26        {
 89327            i?.Dispose();
 89328        }
 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
 89638            public Model (ServiceLocator serviceLocator)
 39            {
 89640                this.serviceLocator = serviceLocator;
 89641                messaging = new MessagingContext(serviceLocator);
 89642                platform = new PlatformContext(serviceLocator);
 89643                world = new WorldRuntimeContext(serviceLocator);
 89644                hud = new HUDContext(serviceLocator);
 89645            }
 46
 47            public void Dispose()
 48            {
 178849                this.serviceLocator.Dispose();
 178850            }
 51        }
 52    }
 53}