public async Task PostGetImage() { var dataStream = GenerateDataStream(); var uploadImageResponsePost = await Upload(dataStream); var downloadImageResponseGet = await _imageServiceClient.DownloadImage(uploadImageResponsePost.ImageId); Assert.Equal(dataStream.ToArray(), downloadImageResponseGet.ImageData); }
public async Task UploadDownloadImage() { var stream = CreateRandomStream(); var uploadImageResponse = await _chatServiceClient.UploadImage(stream); _profilePicturesToCleanup.Add(uploadImageResponse.ImageId); var fetchedProfilePicture = await _chatServiceClient.DownloadImage(uploadImageResponse.ImageId); var imageStream = new MemoryStream(fetchedProfilePicture.Image); Assert.Equal(stream.ToArray(), imageStream.ToArray()); }