Пример #1
0
        public void GetAsync_NotFound()
        {
            var storage = new AzureBlobStorage(Configuration);
            var uri     = new Uri(storage.BaseUri, "does/not/exist.txt");

            async Task <string> GetAsync()
            => await ReadUtf8Async(await storage.GetAsync(uri));

            Awaiting(GetAsync).Should()
            .Throw <RequestFailedException>()
            .Which.Status.Should().Be(404);
        }
Пример #2
0
        public async Task GetAsync()
        {
            var storage = new AzureBlobStorage(Configuration);
            var uri     = new Uri(storage.BaseUri, "a/file.txt");

            await WriteBlobAsync("a/file.txt");

            using var stream = await storage.GetAsync(uri);

            var text = await ReadUtf8Async(stream);

            text.Should().Be(TestText);
        }