1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2025-07-15 01:25:05 +02:00
Files
Sonarr/NzbDrone.Core.Test/UpdateTests/UpdatePackageProviderFixture.cs

29 lines
934 B
C#
Raw Normal View History

using FluentAssertions;
using NUnit.Framework;
using NzbDrone.Core.Configuration;
using NzbDrone.Core.Test.Framework;
using NzbDrone.Core.Update;
2013-04-15 17:08:06 -07:00
using System.Linq;
namespace NzbDrone.Core.Test.UpdateTests
{
public class UpdatePackageProviderFixture : CoreTest<UpdatePackageProvider>
{
2013-04-15 17:08:06 -07:00
[Test]
public void should_get_list_of_available_updates()
2013-04-15 17:08:06 -07:00
{
UseRealHttp();
Mocker.GetMock<IConfigFileProvider>().SetupGet(c => c.Branch).Returns("master");
2013-04-15 17:08:06 -07:00
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);
2013-08-09 22:10:09 -07:00
updates.Should().OnlyContain(c => c.Version.Major == 2);
2013-04-15 17:08:06 -07:00
}
}
}