You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
41 lines
1.1 KiB
41 lines
1.1 KiB
8 years ago
|
using System.Linq;
|
||
8 years ago
|
using FluentAssertions;
|
||
8 years ago
|
using Moq;
|
||
8 years ago
|
using NUnit.Framework;
|
||
|
using NzbDrone.Common.Http;
|
||
4 years ago
|
using NzbDrone.Core.ImportLists.RSSImport;
|
||
8 years ago
|
using NzbDrone.Core.Test.Framework;
|
||
|
|
||
4 years ago
|
namespace NzbDrone.Core.Test.ImportList
|
||
8 years ago
|
{
|
||
8 years ago
|
[TestFixture]
|
||
|
public class RSSImportFixture : CoreTest<RSSImport>
|
||
8 years ago
|
{
|
||
8 years ago
|
[SetUp]
|
||
|
public void Setup()
|
||
|
{
|
||
5 years ago
|
Subject.Definition = Subject.DefaultDefinitions.First();
|
||
8 years ago
|
}
|
||
5 years ago
|
|
||
8 years ago
|
private void GivenRecentFeedResponse(string rssXmlFile)
|
||
|
{
|
||
|
var recentFeed = ReadAllText(@"Files/" + rssXmlFile);
|
||
8 years ago
|
|
||
8 years ago
|
Mocker.GetMock<IHttpClient>()
|
||
|
.Setup(o => o.Execute(It.IsAny<HttpRequest>()))
|
||
|
.Returns<HttpRequest>(r => new HttpResponse(r, new HttpHeader(), recentFeed));
|
||
|
}
|
||
8 years ago
|
|
||
|
[Test]
|
||
8 years ago
|
public void should_fetch_imdb_list()
|
||
8 years ago
|
{
|
||
8 years ago
|
GivenRecentFeedResponse("imdb_watchlist.xml");
|
||
8 years ago
|
|
||
8 years ago
|
var result = Subject.Fetch();
|
||
8 years ago
|
|
||
7 years ago
|
result.Movies.First().Title.Should().Be("Think Like a Man Too");
|
||
|
result.Movies.First().ImdbId.Should().Be("tt2239832");
|
||
8 years ago
|
}
|
||
|
}
|
||
5 years ago
|
}
|