roadie/Roadie.Api.Library.Tests/WebHelperTests.cs
Steven Hildreth ca5db4cb17 resolves #16
2019-07-06 22:16:33 -05:00

27 lines
703 B
C#

using Roadie.Library.Imaging;
using Roadie.Library.Utility;
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using Xunit;
namespace Roadie.Library.Tests
{
public class WebHelperTests
{
[Fact]
public void DownloadTestImage()
{
var testImageUrl = @"https://i.ytimg.com/vi/OiH5YMXQwYg/maxresdefault.jpg";
var imageBytes = WebHelper.BytesForImageUrl(testImageUrl);
Assert.NotNull(imageBytes);
Assert.NotEmpty(imageBytes);
var coverFileName = Path.Combine(@"C:\roadie_dev_root", "testImage.jpg");
File.WriteAllBytes(coverFileName, imageBytes);
}
}
}