2013-04-15 03:41:39 +02:00
|
|
|
using FluentAssertions;
|
|
|
|
using NUnit.Framework;
|
|
|
|
using NzbDrone.Core.Configuration;
|
|
|
|
using NzbDrone.Core.Test.Framework;
|
|
|
|
using NzbDrone.Core.Update;
|
2013-04-16 02:08:06 +02:00
|
|
|
using System.Linq;
|
2013-04-15 03:41:39 +02:00
|
|
|
|
|
|
|
namespace NzbDrone.Core.Test.UpdateTests
|
|
|
|
{
|
|
|
|
public class UpdatePackageProviderFixture : CoreTest<UpdatePackageProvider>
|
|
|
|
{
|
2013-04-16 02:08:06 +02:00
|
|
|
[Test]
|
|
|
|
public void should_get_list_of_avilable_updates()
|
|
|
|
{
|
|
|
|
UseRealHttp();
|
2013-04-15 03:41:39 +02:00
|
|
|
|
2013-04-16 02:08:06 +02:00
|
|
|
Mocker.GetMock<IConfigService>().SetupGet(c => c.UpdateUrl).Returns("http://update.nzbdrone.com/_release/");
|
|
|
|
|
|
|
|
var updates = Subject.GetAvailablePackages().ToList();
|
|
|
|
|
|
|
|
updates.Should().NotBeEmpty();
|
|
|
|
updates.Should().OnlyContain(c => !string.IsNullOrWhiteSpace(c.FileName));
|
|
|
|
updates.Should().OnlyContain(c => !string.IsNullOrWhiteSpace(c.Url));
|
|
|
|
updates.Should().OnlyContain(c => c.Version != null);
|
|
|
|
updates.Should().OnlyContain(c => c.Version.Minor != 0);
|
|
|
|
}
|
2013-04-15 03:41:39 +02:00
|
|
|
}
|
|
|
|
}
|