< 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:20
Uncovered lines:0
Coverable lines:20
Total lines:66
Line coverage:100% (20 of 20)
Covered branches:0
Total branches:0

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
PlacesAndEventsSectionComponentController(...)0%110100%
RequestExploreV2Closing()0%220100%
OnAnyActionExecutedInAnySubSection()0%220100%
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 ExploreV2Analytics;
 2using System;
 3
 4public interface IPlacesAndEventsSectionComponentController : IDisposable
 5{
 6    /// <summary>
 7    /// It will be triggered when the section want to request to close the ExploreV2 main menu.
 8    /// </summary>
 9    event Action OnCloseExploreV2;
 10
 11    /// <summary>
 12    /// It will be triggered when any action is executed inside the places and events section.
 13    /// </summary>
 14    event Action OnAnyActionExecuted;
 15}
 16
 17public class PlacesAndEventsSectionComponentController : IPlacesAndEventsSectionComponentController
 18{
 19    public event Action OnCloseExploreV2;
 20    public event Action OnAnyActionExecuted;
 21
 22    internal IPlacesAndEventsSectionComponentView view;
 23    internal IPlacesSubSectionComponentController placesSubSectionComponentController;
 24    internal IEventsSubSectionComponentController eventsSubSectionComponentController;
 25
 426    public PlacesAndEventsSectionComponentController(IPlacesAndEventsSectionComponentView view, IExploreV2Analytics expl
 27    {
 428        this.view = view;
 29
 430        placesSubSectionComponentController = new PlacesSubSectionComponentController(
 31            view.currentPlacesSubSectionComponentView,
 32            new PlacesAPIController(),
 33            FriendsController.i,
 34            exploreV2Analytics);
 35
 436        placesSubSectionComponentController.OnCloseExploreV2 += RequestExploreV2Closing;
 37
 438        eventsSubSectionComponentController = new EventsSubSectionComponentController(
 39            view.currentEventsSubSectionComponentView,
 40            new EventsAPIController(),
 41            exploreV2Analytics);
 42
 443        eventsSubSectionComponentController.OnCloseExploreV2 += RequestExploreV2Closing;
 44
 445        view.OnAnyActionExecuted += OnAnyActionExecutedInAnySubSection;
 446        placesSubSectionComponentController.OnAnyActionExecuted += OnAnyActionExecutedInAnySubSection;
 447        eventsSubSectionComponentController.OnAnyActionExecuted += OnAnyActionExecutedInAnySubSection;
 448    }
 49
 250    internal void RequestExploreV2Closing() { OnCloseExploreV2?.Invoke(); }
 51
 252    internal void OnAnyActionExecutedInAnySubSection() { OnAnyActionExecuted?.Invoke(); }
 53
 54    public void Dispose()
 55    {
 456        view.OnAnyActionExecuted -= OnAnyActionExecutedInAnySubSection;
 57
 458        placesSubSectionComponentController.OnCloseExploreV2 -= RequestExploreV2Closing;
 459        placesSubSectionComponentController.OnAnyActionExecuted -= OnAnyActionExecutedInAnySubSection;
 460        placesSubSectionComponentController.Dispose();
 61
 462        eventsSubSectionComponentController.OnCloseExploreV2 -= RequestExploreV2Closing;
 463        eventsSubSectionComponentController.OnAnyActionExecuted -= OnAnyActionExecutedInAnySubSection;
 464        eventsSubSectionComponentController.Dispose();
 465    }
 66}