mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-07 13:32:17 -07:00
IHttpController/HttpController Added (So we can Mock SABnzbd requests)
More unit tests for SabController
This commit is contained in:
parent
50f97e824e
commit
a2967f4658
9 changed files with 407 additions and 23 deletions
27
NzbDrone.Core/Controllers/HttpController.cs
Normal file
27
NzbDrone.Core/Controllers/HttpController.cs
Normal file
|
@ -0,0 +1,27 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Text;
|
||||
|
||||
namespace NzbDrone.Core.Controllers
|
||||
{
|
||||
class HttpController : IHttpController
|
||||
{
|
||||
public string GetRequest(string request)
|
||||
{
|
||||
//Get the request and return as String Array
|
||||
|
||||
try
|
||||
{
|
||||
var webClient = new WebClient();
|
||||
return webClient.DownloadString(request);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine(ex);
|
||||
return String.Empty;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue