< Summary

Class:DCL.World.PortableExperiences.PlayerPrefsConfirmedExperiencesRepository
Assembly:DCL.Runtime
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/WorldRuntime/PlayerPrefsConfirmedExperiencesRepository.cs
Covered lines:3
Uncovered lines:4
Coverable lines:7
Total lines:28
Line coverage:42.8% (3 of 7)
Covered branches:0
Total branches:0
Covered methods:1
Total methods:5
Method coverage:20% (1 of 5)

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
PlayerPrefsConfirmedExperiencesRepository(...)0%110100%
Get(...)0%2100%
Set(...)0%2100%
Contains(...)0%2100%
GetKey(...)0%2100%

File(s)

/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/WorldRuntime/PlayerPrefsConfirmedExperiencesRepository.cs

#LineLine coverage
 1using DCL.Helpers;
 2
 3namespace DCL.World.PortableExperiences
 4{
 5    public class PlayerPrefsConfirmedExperiencesRepository : IConfirmedExperiencesRepository
 6    {
 7        private const string KEY_PREFIX = "PortableExperiences.Confirmation.";
 8
 9        private readonly IPlayerPrefs playerPrefs;
 10
 42511        public PlayerPrefsConfirmedExperiencesRepository(IPlayerPrefs playerPrefs)
 12        {
 42513            this.playerPrefs = playerPrefs;
 42514        }
 15
 16        public bool Get(string pxId) =>
 017            playerPrefs.GetBool(GetKey(pxId), false);
 18
 19        public void Set(string pxId, bool confirmed) =>
 020            playerPrefs.Set(GetKey(pxId), confirmed);
 21
 22        public bool Contains(string pxId) =>
 023            playerPrefs.ContainsKey(GetKey(pxId));
 24
 25        private string GetKey(string pxId) =>
 026            $"{KEY_PREFIX}{pxId}";
 27    }
 28}