mirror of
https://github.com/sphildreth/roadie
synced 2024-11-10 06:44:12 +00:00
27 lines
703 B
C#
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);
|
|
|
|
}
|
|
}
|
|
}
|