HttpClient

This commit is contained in:
Keivan Beigi
2014-09-11 16:49:41 -07:00
parent 3a287bf7e7
commit 2c1d3339d0
55 changed files with 995 additions and 582 deletions
@@ -1,6 +1,7 @@
using System;
using FluentAssertions;
using NUnit.Framework;
using NzbDrone.Common;
using NzbDrone.Core.Test.Framework;
using NzbDrone.Core.Update;
@@ -12,7 +13,7 @@ namespace NzbDrone.Core.Test.UpdateTests
public void no_update_when_version_higher()
{
UseRealHttp();
Subject.GetLatestUpdate("master", new Version(10,0)).Should().BeNull();
Subject.GetLatestUpdate("master", new Version(10, 0)).Should().BeNull();
}
[Test]
@@ -21,5 +22,21 @@ namespace NzbDrone.Core.Test.UpdateTests
UseRealHttp();
Subject.GetLatestUpdate("master", new Version(2, 0)).Should().NotBeNull();
}
[Test]
public void should_get_recent_updates()
{
const string branch = "master";
UseRealHttp();
var recent = Subject.GetRecentUpdates(branch, 2);
recent.Should().NotBeEmpty();
recent.Should().OnlyContain(c => c.Hash.IsNotNullOrWhiteSpace());
recent.Should().OnlyContain(c => c.FileName.Contains("Drone.master.2"));
recent.Should().OnlyContain(c => c.ReleaseDate.Year == 2014);
recent.Should().OnlyContain(c => c.Changes.New != null);
recent.Should().OnlyContain(c => c.Changes.Fixed != null);
}
}
}