< Summary

Class:PlacesAndEventsSectionComponentController
Assembly:ExploreV2
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/ExploreV2/Scripts/Sections/PlacesAndEventsSection/PlacesAndEventsSectionComponentController.cs
Covered lines:8
Uncovered lines:1
Coverable lines:9
Total lines:36
Line coverage:88.8% (8 of 9)
Covered branches:0
Total branches:0

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
PlacesAndEventsSectionComponentController(...)0%110100%
RequestExploreV2Closing()0%6200%
Dispose()0%110100%

File(s)

/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/ExploreV2/Scripts/Sections/PlacesAndEventsSection/PlacesAndEventsSectionComponentController.cs

#LineLine coverage
 1using System;
 2
 3public interface IPlacesAndEventsSectionComponentController : IDisposable
 4{
 5    /// <summary>
 6    /// It will be triggered when the section want to request to close the ExploreV2 main menu.
 7    /// </summary>
 8    event Action OnCloseExploreV2;
 9}
 10
 11public class PlacesAndEventsSectionComponentController : IPlacesAndEventsSectionComponentController
 12{
 13    public event Action OnCloseExploreV2;
 14
 15    internal IPlacesAndEventsSectionComponentView view;
 16    internal IEventsSubSectionComponentController eventsSubSectionComponentController;
 17
 118    public PlacesAndEventsSectionComponentController(IPlacesAndEventsSectionComponentView view)
 19    {
 120        this.view = view;
 21
 122        eventsSubSectionComponentController = new EventsSubSectionComponentController(
 23            view.currentEventsSubSectionComponentView,
 24            new EventsAPIController());
 25
 126        eventsSubSectionComponentController.OnCloseExploreV2 += RequestExploreV2Closing;
 127    }
 28
 029    private void RequestExploreV2Closing() { OnCloseExploreV2?.Invoke(); }
 30
 31    public void Dispose()
 32    {
 133        eventsSubSectionComponentController.OnCloseExploreV2 -= RequestExploreV2Closing;
 134        eventsSubSectionComponentController.Dispose();
 135    }
 36}