Ejemplo n.º 1
0
        public async Task DownloadPhotoAsync_UrlIdDestination_ReturnsTheSizeOfTheDownloadedFile()
        {
            var buffer = new byte[] { 1, 2 };

            ClientTestUtilities.ShimGetByteArrayAsync(buffer);
            ClientTestUtilities.ShimFileCreate();
            ClientTestUtilities.ShimGetAsync <DownloadPhotoRequest, PhotoDownloadMarker>();
            PoseContext.Isolate(async() =>
            {
                long fileSize = await client.DownloadPhotoAsync(new Uri("http://a.b.c"), "1", @"C:\1.jpg").ConfigureAwait(false);
                Assert.Equal(buffer.Length, fileSize);
            });
        }