< Summary

Class:DCL.MyAccount.MyAccountPlugin
Assembly:MyAccountHUD
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/HUD/MyAccountHUD/MyAccountPlugin.cs
Covered lines:0
Uncovered lines:27
Coverable lines:27
Total lines:109
Line coverage:0% (0 of 27)
Covered branches:0
Total branches:0
Covered methods:0
Total methods:3
Method coverage:0% (0 of 3)

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
MyAccountPlugin()0%2100%
Initialize()0%3801900%
Dispose()0%2100%

File(s)

/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/HUD/MyAccountHUD/MyAccountPlugin.cs

#LineLine coverage
 1using DCL.Browser;
 2using DCL.Providers;
 3using DCL.Social.Friends;
 4using DCL.Tasks;
 5using DCLServices.Lambdas.NamesService;
 6using DCLServices.SubscriptionsAPIService;
 7using SocialFeaturesAnalytics;
 8using System.Threading;
 9
 10namespace DCL.MyAccount
 11{
 12    public class MyAccountPlugin : IPlugin
 13    {
 014        private readonly CancellationTokenSource cts = new ();
 15
 16        private MyAccountSectionHUDController myAccountSectionHUDController;
 17        private MyProfileController myProfileController;
 18        private EmailNotificationsController emailNotificationsController;
 19        private BlockedListController blockedListController;
 20
 021        public MyAccountPlugin()
 22        {
 023            Initialize(cts.Token);
 024        }
 25
 26        private async void Initialize(CancellationToken ct)
 27        {
 028            var myAccountSectionView = await Environment.i.serviceLocator.Get<IAddressableResourceProvider>()
 29                                                        .Instantiate<MyAccountSectionHUDComponentView>("MyAccountSection
 30
 031            var updateEmailConfirmationHUD = await Environment.i.serviceLocator.Get<IAddressableResourceProvider>()
 32                                                              .Instantiate<UpdateEmailConfirmationHUDComponentView>("Upd
 33
 034            ProfileAdditionalInfoValueListScriptableObject countryListProvider = await Environment.i.serviceLocator.Get<
 35                                                                                                  .GetAddressable<Profil
 36
 037            ProfileAdditionalInfoValueListScriptableObject genderListProvider = await Environment.i.serviceLocator.Get<I
 38                                                                                                 .GetAddressable<Profile
 39
 040            ProfileAdditionalInfoValueListScriptableObject sexualOrientationProvider = await Environment.i.serviceLocato
 41                                                                                                        .GetAddressable<
 42
 043            ProfileAdditionalInfoValueListScriptableObject employmentStatusProvider = await Environment.i.serviceLocator
 44                                                                                                       .GetAddressable<P
 45
 046            ProfileAdditionalInfoValueListScriptableObject relationshipStatusProvider = await Environment.i.serviceLocat
 47                                                                                                         .GetAddressable
 48
 049            ProfileAdditionalInfoValueListScriptableObject languageListProvider = await Environment.i.serviceLocator.Get
 50                                                                                                   .GetAddressable<Profi
 51
 052            ProfileAdditionalInfoValueListScriptableObject pronounListProvider = await Environment.i.serviceLocator.Get<
 53                                                                                                  .GetAddressable<Profil
 54
 055            var dataStore = DataStore.i;
 56
 057            var userProfileWebInterfaceBridge = new UserProfileWebInterfaceBridge();
 58
 059            var socialAnalytics = new SocialAnalytics(Environment.i.platform.serviceProviders.analytics, userProfileWebI
 60
 061            myAccountSectionHUDController = new MyAccountSectionHUDController(
 62                myAccountSectionView,
 63                dataStore);
 64
 065            myProfileController = new MyProfileController(
 66                myAccountSectionView.CurrentMyProfileView,
 67                dataStore,
 68                userProfileWebInterfaceBridge,
 69                Environment.i.serviceLocator.Get<INamesService>(),
 70                new WebInterfaceBrowserBridge(),
 71                myAccountSectionHUDController,
 72                KernelConfig.i,
 73                new MyAccountAnalyticsService(Environment.i.platform.serviceProviders.analytics),
 74                socialAnalytics,
 75                countryListProvider,
 76                genderListProvider,
 77                sexualOrientationProvider,
 78                employmentStatusProvider,
 79                relationshipStatusProvider,
 80                languageListProvider,
 81                pronounListProvider);
 82
 083            emailNotificationsController = new EmailNotificationsController(
 84                myAccountSectionView.CurrentEmailNotificationsView,
 85                updateEmailConfirmationHUD,
 86                myAccountSectionHUDController,
 87                dataStore,
 88                Environment.i.serviceLocator.Get<ISubscriptionsAPIService>(),
 89                socialAnalytics);
 90
 091            blockedListController = new BlockedListController(
 92                myAccountSectionView.CurrentBlockedListComponentView,
 93                dataStore,
 94                userProfileWebInterfaceBridge,
 95                new WebInterfaceBlockedListApiBridge(),
 96                socialAnalytics,
 97                Environment.i.serviceLocator.Get<IFriendsController>());
 098        }
 99
 100        public void Dispose()
 101        {
 0102            cts.SafeCancelAndDispose();
 0103            myProfileController.Dispose();
 0104            emailNotificationsController.Dispose();
 0105            myAccountSectionHUDController.Dispose();
 0106            blockedListController.Dispose();
 0107        }
 108    }
 109}