private Credential GetAccessTokenWithScopes(HashSet <string> scopes)
        {
            string target = string.Join(" ", scopes);
            var    token  = MockTestConstants.GetAccessToken();

            token.Target = target;
            return(token);
        }
        private Credential EmplaceAccessToken(JObject j, HashSet <string> scopes)
        {
            string target = string.Join(" ", scopes);
            var    token  = MockTestConstants.GetAccessToken();

            token.Target = target;
            j[target]    = StorageJsonUtils.CredentialToJson(token);
            return(token);
        }
        public void GetAppMetadataPath()
        {
            string path = "AppMetadata";

            path = Path.Combine(path, "e_" + _credentialPathManager.ToSafeFilename(MockTestConstants.Environment));
            path = Path.Combine(path, "c_" + _credentialPathManager.ToSafeFilename(MockTestConstants.ClientId) + ".bin");
            path = PathUtils.Normalize(path);

            Assert.AreEqual(path, _credentialPathManager.GetAppMetadataPath(MockTestConstants.GetAppMetadata()));
        }
        public void GetAccountPath()
        {
            string path = "UD";

            path = Path.Combine(path, "u_" + _credentialPathManager.ToSafeFilename(MockTestConstants.GetHomeAccountId()));
            path = Path.Combine(path, "e_" + _credentialPathManager.ToSafeFilename(MockTestConstants.Environment));
            path = Path.Combine(path, "Accounts");
            path = Path.Combine(path, "r_" + _credentialPathManager.ToSafeFilename(MockTestConstants.Realm) + ".bin");
            path = PathUtils.Normalize(path);

            Assert.AreEqual(path, _credentialPathManager.GetAccountPath(MockTestConstants.GetAccount()));
        }
        public void GetFamilyRefreshTokenPath()
        {
            string path = "UD";

            path = Path.Combine(path, "u_" + _credentialPathManager.ToSafeFilename(MockTestConstants.GetHomeAccountId()));
            path = Path.Combine(path, "e_" + _credentialPathManager.ToSafeFilename(MockTestConstants.Environment));
            path = Path.Combine(path, "FRT");
            path = Path.Combine(path, "f_" + _credentialPathManager.ToSafeFilename(MockTestConstants.FamilyId) + ".bin");
            path = PathUtils.Normalize(path);

            Assert.AreEqual(path, _storageWorker.GetCredentialPath(MockTestConstants.GetFamilyRefreshToken()));
        }