public async Task When_GetStorageFile()
        {
            LogoSource image = null;

            try
            {
                var directData = await PrepareDataAsync().ConfigureAwait(false);

                var imageStream = new MemoryStream(directData);
                image = new LogoSource(imageStream);

                var file = await image.GetStorageFileAsync().ConfigureAwait(false);

                var folder = await file.GetParentAsync();

                var name   = file.Name;
                var stream = await file.OpenStreamForReadAsync();

                var fileData = stream.ReadToEnd();

                Assert.IsTrue(fileData.SequenceEqual(directData));

                imageStream.Dispose();
                stream.Dispose();
                image.Dispose();
                image = null;

                // Wait for the file to finish deleting...
                await Task.Delay(2000).ConfigureAwait(false);

                try
                {
                    var file2 = await folder.GetItemAsync(name);

                    Assert.IsNull(file2);
                }
                catch (FileNotFoundException)
                {
                    // This is expected.
                    Assert.IsTrue(true);
                }
            }
            finally
            {
                image?.Dispose();
            }
        }
        public async Task When_GetStorageFile()
        {
            LogoSource image = null;

            try
            {
                image = new LogoSource(new Uri(AssetPath));

                var file = await image.GetStorageFileAsync().ConfigureAwait(false);

                var folder = await file.GetParentAsync();

                var name   = file.Name;
                var stream = await file.OpenStreamForReadAsync();

                var fileData = $"data:;base64,{Convert.ToBase64String(stream.ReadToEnd())}";

                System.Diagnostics.Debug.WriteLine(file.Name);
                System.Diagnostics.Debug.WriteLine(folder.Name);
                Assert.IsTrue(fileData == Helpers.DataUrl);

                stream.Dispose();
                image.Dispose();

                // Wait for the file to delete.
                await Task.Delay(2000).ConfigureAwait(false);

                image = null;
                try
                {
                    var file2 = await folder.GetItemAsync(name);

                    Assert.IsNull(file2);
                }
                catch (FileNotFoundException)
                {
                    // This is expected.
                    Assert.IsTrue(true);
                }
            }
            finally
            {
                image?.Dispose();
            }
        }
        public async Task When_GetStorageFile()
        {
            LogoSource image = null;

            try
            {
                using var wc = new WebClient();
                byte[] directData = wc.DownloadData(Helpers.Sample);

                using var imageStream = new MemoryStream(directData);
                image = new LogoSource(imageStream);

                var file = await image.GetStorageFileAsync().ConfigureAwait(false);

                var folder = await file.GetParentAsync();

                var name   = file.Name;
                var stream = await file.OpenStreamForReadAsync();

                var fileData = stream.ReadToEnd();

                Assert.IsTrue(fileData.SequenceEqual(directData));

                stream.Dispose();
                image.Dispose();
                image = null;
                try
                {
                    var file2 = await folder.GetItemAsync(name);

                    Assert.IsNull(file2);
                }
                catch (FileNotFoundException)
                {
                    // This is expected.
                    Assert.Pass();
                }
            }
            finally
            {
                image?.Dispose();
            }
        }