protected async Task ZipStringCore()
        {
            string tempDir         = GetTempDirectory();
            string dummyFileName   = "dummy.txt";
            string dummyFolderPath = Utils.CreateDummyDirectory(_mockData.ResourceFolder, tempDir, cleanFolder: true);

            Utils.CreateDummyFile(dummyFolderPath, dummyFileName, cleanFolder: true);
            string originalString = await KFile.ReadAllTextAsync(Path.Combine(dummyFolderPath, dummyFileName));

            string zippedString = Zipper.ZipString(originalString);

            Assert.Equal(Zipper.UnZipString(zippedString), originalString);
            Utils.RemoveDir(dummyFolderPath);
        }
Exemplo n.º 2
0
        private static async Task <string> _GetAPIKey()
        {
            string APIkeyFilename = "api_key.txt";

            try
            {
                return(await KFile.ReadAllTextAsync(APIkeyFilename).ConfigureAwait(false));
            }
            catch (Exception exception)
            {
                await Console.Out.WriteLineAsync($"Could not read admin APIs key from {APIkeyFilename}: {exception.Message}").ConfigureAwait(false);

                return(string.Empty);
            }
        }