|
|
|
@ -28,31 +28,30 @@ namespace NzbDrone.Core.Test.UpdateTests
|
|
|
|
|
public void finds_update_when_version_lower()
|
|
|
|
|
{
|
|
|
|
|
UseRealHttp();
|
|
|
|
|
Subject.GetLatestUpdate("master", new Version(2, 0)).Should().NotBeNull();
|
|
|
|
|
Subject.GetLatestUpdate("master", new Version(3, 0)).Should().NotBeNull();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
|
public void should_get_master_if_branch_doesnt_exit()
|
|
|
|
|
{
|
|
|
|
|
UseRealHttp();
|
|
|
|
|
Subject.GetLatestUpdate("invalid_branch", new Version(2, 0)).Should().NotBeNull();
|
|
|
|
|
Subject.GetLatestUpdate("invalid_branch", new Version(3, 0)).Should().NotBeNull();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
|
public void should_get_recent_updates()
|
|
|
|
|
{
|
|
|
|
|
const string branch = "master";
|
|
|
|
|
const string branch = "main";
|
|
|
|
|
UseRealHttp();
|
|
|
|
|
var recent = Subject.GetRecentUpdates(branch, new Version(2, 0), null);
|
|
|
|
|
var recent = Subject.GetRecentUpdates(branch, new Version(3, 0), null);
|
|
|
|
|
|
|
|
|
|
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.FileName.Contains($"Sonarr.{c.Branch}.3."));
|
|
|
|
|
recent.Should().OnlyContain(c => c.ReleaseDate.Year >= 2014);
|
|
|
|
|
recent.Where(c => c.Changes != null).Should().OnlyContain(c => c.Changes.New != null);
|
|
|
|
|
recent.Where(c => c.Changes != null).Should().OnlyContain(c => c.Changes.Fixed != null);
|
|
|
|
|
recent.Should().OnlyContain(c => c.Branch == branch);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|